cxa
V2EX  ›  问与答

Python 使用 sentry 的问题

  •  
  •   cxa · Nov 6, 2018 · 2111 views
    This topic created in 2759 days ago, the information mentioned may be changed or developed.

    请问这是什么错误啊,系统 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 replies    2018-11-06 13:43:39 +08:00
    kdwycz
        1
    kdwycz  
       Nov 6, 2018
    raven 版本? 记得新版的 dsn 地址不是这样的
    cxa
        2
    cxa  
    OP
       Nov 6, 2018
    @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  
       Nov 6, 2018
    Connection reset by peer
    kdwycz
        4
    kdwycz  
       Nov 6, 2018
    @cxa #2 最新版 raven 和 sentry 的话,检查下 dsn 地址吧,新版的地址短一些
    cxa
        5
    cxa  
    OP
       Nov 6, 2018
    @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
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2984 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 14:54 · PVG 22:54 · LAX 07:54 · JFK 10:54
    ♥ Do have faith in what you're doing.