V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
cxa
V2EX  ›  问与答

Python 使用 sentry 的问题

  •  
  •   cxa · 2018-11-06 09:37:56 +08:00 · 1679 次点击
    这是一个创建于 1991 天前的主题,其中的信息可能已经有所发展或是发生改变。

    请问这是什么错误啊,系统 mac,python 客户端。 代码

    from raven import Client
    
    client = Client('https://b2e8a12734ae45a5b2ceb0e77040b05c:[email protected]/1')
    
    try:
        1 / 0
    except ZeroDivisionError:
        client.captureException()
    

    报错内容

    Sentry responded with an error: <urlopen error [Errno 54] Connection reset by peer> (url: https://sentry.log.com/api/1/store/)
    
    5 条回复    2018-11-06 13:43:39 +08:00
    kdwycz
        1
    kdwycz  
       2018-11-06 09:51:09 +08:00
    raven 版本? 记得新版的 dsn 地址不是这样的
    cxa
        2
    cxa  
    OP
       2018-11-06 10:09:53 +08:00
    @kdwycz >>> 你好是 raven.get_version() '6.9.0',
    另外我在 docker-compose.yml 也加了 SENTRY_DSN 字段
    environment:
    SENTRY_MEMCACHED_HOST: memcached
    SENTRY_REDIS_HOST: redis
    SENTRY_POSTGRES_HOST: postgres
    SENTRY_EMAIL_HOST: smtp
    SENTRY_SECRET_KEY : '密钥'
    SENTRY_DSN : 'dsn 字符串'
    kslr
        3
    kslr  
       2018-11-06 11:52:53 +08:00
    Connection reset by peer
    kdwycz
        4
    kdwycz  
       2018-11-06 12:20:37 +08:00
    @cxa #2 最新版 raven 和 sentry 的话,检查下 dsn 地址吧,新版的地址短一些
    cxa
        5
    cxa  
    OP
       2018-11-06 13:43:39 +08:00
    @kdwycz
    页面是这样的
    Get started by selecting the platform or language that powers your application.
    DSN
    https://b2e8a12734ae45a5b2ceb0e77040b05c:[email protected]/1
    Public DSN
    https://[email protected]/1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2205 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 00:36 · PVG 08:36 · LAX 17:36 · JFK 20:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.