简体   繁体   English

哨兵日志记录错误,我的配置有什么问题,如何从哨兵那里获得更详细的错误? (可能与 Docker 相关?)

[英]Sentry Logging Error, what's wrong with my config and how can I get more detailed errors from sentry? (Possibly Docker related?)

I recently have been working with Sentry, and I have been having some issues with it.我最近一直在与 Sentry 合作,但我遇到了一些问题。

After many hours of frustration getting it to work, I enabled debug mode to see the output.经过数小时的挫败后,我启用了调试模式以查看 output。 This is what happens every time:这是每次都会发生的事情:

在此处输入图像描述

I have followed the docs step by step on integrating this.我已逐步按照文档进行集成。 I have a file to initialize the logging, and then my index file.我有一个文件来初始化日志记录,然后是我的索引文件。 Here is my logging initialization file:这是我的日志记录初始化文件:

const Sentry = require("@sentry/node");
const Tracing = require("@sentry/tracing");

Sentry.init({
  dsn: [REDACTED],
  tracesSampleRate: 1.0,
  attachStacktrace: true,
  debug: true,
  environment: process.env.VERSION
});

module.exports = Sentry

From there, I am importing this file to my index, and including an intentional error in this file to test it:从那里,我将此文件导入我的索引,并在此文件中包含一个故意错误以对其进行测试:

const Sentry = require('./logging/sentry.js')


try {
    doSomeFunction();
} catch(error) {
    Sentry.captureException(error);
}

What's wrong here?这里有什么问题? Am I using Sentry wrong?我使用 Sentry 错了吗? I've not been able to find any info regarding this.我无法找到任何有关此的信息。 I was able to get it to work on my machine (of course haha) but when I deployed it to my Docker container, it did not work, which makes me believe this might be part of the issue.我能够让它在我的机器上工作(当然哈哈)但是当我将它部署到我的 Docker 容器时,它不起作用,这让我相信这可能是问题的一部分。

Thank you!谢谢!

UPDATE:更新:

Tried rewriting this with no luck, I'm truly unsure what is wrong here, I cannot get it to work even though I am following the documentation.尝试重写它没有运气,我真的不确定这里有什么问题,即使我遵循文档,我也无法让它工作。 Some help would be really appreciated.一些帮助将不胜感激。

UPDATE2:更新2:

I am now confident this issue is due to Docker, possibly blocking port 443. I have done sudo ufw allow 443 with success, but the issue is still intact.我现在确信这个问题是由于 Docker 造成的,可能阻塞了端口 443。我已经成功完成了sudo ufw allow 443 ,但问题仍然完好无损。

UPDATE3:更新3:

Based on some readings I believe IPTables is having this issue (maybe even cloudflare?)根据一些读数,我相信 IPTables 存在这个问题(甚至可能是 cloudflare?)

Here is my IPTables:这是我的 IPTables:

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         
DOCKER     all  --  anywhere             anywhere             ADDRTYPE match dst-type LOCAL
DNAT       tcp  --  anywhere             anywhere             tcp dpt:https to:172.17.0.3:8443

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
DOCKER     all  --  anywhere            !localhost/8          ADDRTYPE match dst-type LOCAL

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  172.17.0.0/16        anywhere            
MASQUERADE  all  --  172.18.0.0/16        anywhere            
MASQUERADE  tcp  --  172.18.0.6           172.18.0.6           tcp dpt:3000
MASQUERADE  tcp  --  172.18.0.7           172.18.0.7           tcp dpt:https
MASQUERADE  tcp  --  172.18.0.7           172.18.0.7           tcp dpt:http

Chain DOCKER (2 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere            
RETURN     all  --  anywhere             anywhere            
DNAT       tcp  --  anywhere             anywhere             tcp dpt:3000 to:172.18.0.6:3000
DNAT       tcp  --  anywhere             anywhere             tcp dpt:https to:172.18.0.7:443
DNAT       tcp  --  anywhere             anywhere             tcp dpt:http to:172.18.0.7:80

I wonder if this is relevant!我想知道这是否相关!

  1. Is DSN An array, or a String? DSN 是数组还是字符串? It should be a String according to the Sentry docs.根据 Sentry 文档,它应该是一个字符串。

  2. An error which mentions 0.0.0.0 is frequently DNS related.提及 0.0.0.0 的错误经常与 DNS 相关。 Have you checked the DNS configuration for your docker?您是否检查过 docker 的 DNS 配置? Is there a hosts file?有没有hosts文件? A possible cause could be something intercepting the DNS requests and returning 0.0.0.0.一个可能的原因可能是拦截了 DNS 请求并返回 0.0.0.0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM