尝试将错误发送到 localhost:9000/store 时,Django-Sentry 给出错误 405

发布于 2024-12-22 07:52:08 字数 10359 浏览 2 评论 0原文

姜戈哨兵不爱我。我正在尝试将错误发送到 localhost:9000/store。这是错误:

jamis$ python manage.py runserver
Validating models...

0 errors found
Django version 1.3.1, using settings 'hv.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

// useless info left out

Thu, 22 Dec 2011 18:45:13 +0000 [ERROR] M:sentry.errors.client, P:9067, F:base.py:226, MSG:Unable to reach Sentry log server: HTTP Error 405: METHOD NOT ALLOWED (url: http://0.0.0.0:9000/store, body: )
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/raven/base.py", line 222, in send
    return self.send_remote(url=url, data=message, headers=headers)
  File "/Library/Python/2.7/site-packages/raven/base.py", line 201, in send_remote
    response = urllib2.urlopen(req, data).read()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 432, in error
    result = self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 619, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 405: METHOD NOT ALLOWED
Thu, 22 Dec 2011 18:45:13 +0000 [WARNING] M:sentry.errors.client, P:9067, F:base.py:227, MSG:Not Found: /favicon.ico
Thu, 22 Dec 2011 18:45:13 +0000 [WARNING] M:django.request, P:9067, F:base.py:142, MSG:Not Found: /favicon.ico
[22/Dec/2011 18:45:14] "POST /accounts/login/ HTTP/1.1" 302 0
Thu, 22 Dec 2011 18:45:15 +0000 [ERROR] M:sentry.errors.client, P:9067, F:base.py:226, MSG:Unable to reach Sentry log server: HTTP Error 405: METHOD NOT ALLOWED (url: http://0.0.0.0:9000/store, body: )
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/raven/base.py", line 222, in send
    return self.send_remote(url=url, data=message, headers=headers)
  File "/Library/Python/2.7/site-packages/raven/base.py", line 201, in send_remote
    response = urllib2.urlopen(req, data).read()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 432, in error
    result = self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 619, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 405: METHOD NOT ALLOWED
Thu, 22 Dec 2011 18:45:15 +0000 [CRITICAL] M:sentry.errors.client, P:9067, F:base.py:227, MSG:
Thu, 22 Dec 2011 18:45:15 +0000 [CRITICAL] M:root, P:9067, F:home.py:17, MSG:
[22/Dec/2011 18:45:15] "GET / HTTP/1.1" 200 8903
[22/Dec/2011 18:45:15] "GET /static/css/build/bootstrap/bootstrap.css HTTP/1.1" 304 0
[22/Dec/2011 18:45:15] "GET /static/css/build/hv-pages.css HTTP/1.1" 200 2019
[22/Dec/2011 18:45:15] "GET /static/css/build/pages/hv-notifications-dialogs.css HTTP/1.1" 200 373
Thu, 22 Dec 2011 18:45:15 +0000 [ERROR] M:sentry.errors.client, P:9067, F:base.py:226, MSG:Unable to reach Sentry log server: HTTP Error 405: METHOD NOT ALLOWED (url: http://0.0.0.0:9000/store, body: )
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/raven/base.py", line 222, in send
    return self.send_remote(url=url, data=message, headers=headers)
  File "/Library/Python/2.7/site-packages/raven/base.py", line 201, in send_remote
    response = urllib2.urlopen(req, data).read()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 432, in error
    result = self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 619, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 405: METHOD NOT ALLOWED
Thu, 22 Dec 2011 18:45:15 +0000 [WARNING] M:sentry.errors.client, P:9067, F:base.py:227, MSG:Not Found: /favicon.ico
Thu, 22 Dec 2011 18:45:15 +0000 [WARNING] M:django.request, P:9067, F:base.py:142, MSG:Not Found: /favicon.ico

我在settings.py中设置了一些Sentry设置,如下所示:

SENTRY_SERVERS = ['http://0.0.0.0:9000/store']
SENTRY_KEY = "666"

TEMPLATE_DEBUG = True
SENTRY_TESTING = True

LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'formatters': {
        'default': {
            'format': '%(asctime)s [%(levelname)s] M:%(name)s, P:%(process)d, F:%(filename)s:%(lineno)d, MSG:%(message)s',
            'datefmt': '%a, %d %b %Y %H:%M:%S %z',
        },
    },
    'root': {
            'level':'DEBUG',            # CHANGE TO DEFAULT_LEVEL
            'handlers':['sentry', 'console'],
    },
    'handlers': {
        'sentry': {
            'level':'INFO',
            'class': 'raven.contrib.django.handlers.SentryHandler',
            'formatter':'default'
        },
        'console':{
            'level':'INFO',
            'class':'logging.StreamHandler',
            'formatter': 'default'
        },
    },
    'loggers': {
        'sentry.errors': {
          'level': 'DEBUG',
          'handlers': ['console'],
          'propagate': False,
        },
    }
}

在另一段代码中,我抛出了一个手动错误,如下所示:

logger = logging.getLogger()
logger.critical()

此外,我在INSTALLED_APPS中添加了sentry和raven.contrib.django,


这是Sentry 的默认配置文件(位于 ~/.sentry/sentry.conf.py):

import os.path

from sentry.conf.server import *

ROOT = os.path.dirname(__file__)

DATABASES = {
    'default': {
        # You can swap out the engine for MySQL easily by changing this value
        # to ``django.db.backends.mysql`` or to PostgreSQL with
        # ``django.db.backends.postgresql_psycopg2``
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(ROOT, 'sentry.db'),
        'USER': 'postgres',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
    }
}

SENTRY_KEY = "666"

# Set this to false to require authentication
SENTRY_PUBLIC = True

SENTRY_WEB_HOST = '0.0.0.0'
SENTRY_WEB_PORT = 9000

SENTRY_WEB_LOG_FILE = os.path.join(ROOT, 'sentry.log')
SENTRY_WEB_PID_FILE = os.path.join(ROOT, 'sentry.pid')

我确信我只是错误地访问了 Sentry 服务器,但我不知道为什么。关于 raven 和 django-sentry 的文档非常简洁!任何帮助将不胜感激。

Django-sentry is not loving me. I am trying to send errors to localhost:9000/store. Here is the error:

jamis$ python manage.py runserver
Validating models...

0 errors found
Django version 1.3.1, using settings 'hv.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

// useless info left out

Thu, 22 Dec 2011 18:45:13 +0000 [ERROR] M:sentry.errors.client, P:9067, F:base.py:226, MSG:Unable to reach Sentry log server: HTTP Error 405: METHOD NOT ALLOWED (url: http://0.0.0.0:9000/store, body: )
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/raven/base.py", line 222, in send
    return self.send_remote(url=url, data=message, headers=headers)
  File "/Library/Python/2.7/site-packages/raven/base.py", line 201, in send_remote
    response = urllib2.urlopen(req, data).read()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 432, in error
    result = self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 619, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 405: METHOD NOT ALLOWED
Thu, 22 Dec 2011 18:45:13 +0000 [WARNING] M:sentry.errors.client, P:9067, F:base.py:227, MSG:Not Found: /favicon.ico
Thu, 22 Dec 2011 18:45:13 +0000 [WARNING] M:django.request, P:9067, F:base.py:142, MSG:Not Found: /favicon.ico
[22/Dec/2011 18:45:14] "POST /accounts/login/ HTTP/1.1" 302 0
Thu, 22 Dec 2011 18:45:15 +0000 [ERROR] M:sentry.errors.client, P:9067, F:base.py:226, MSG:Unable to reach Sentry log server: HTTP Error 405: METHOD NOT ALLOWED (url: http://0.0.0.0:9000/store, body: )
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/raven/base.py", line 222, in send
    return self.send_remote(url=url, data=message, headers=headers)
  File "/Library/Python/2.7/site-packages/raven/base.py", line 201, in send_remote
    response = urllib2.urlopen(req, data).read()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 432, in error
    result = self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 619, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 405: METHOD NOT ALLOWED
Thu, 22 Dec 2011 18:45:15 +0000 [CRITICAL] M:sentry.errors.client, P:9067, F:base.py:227, MSG:
Thu, 22 Dec 2011 18:45:15 +0000 [CRITICAL] M:root, P:9067, F:home.py:17, MSG:
[22/Dec/2011 18:45:15] "GET / HTTP/1.1" 200 8903
[22/Dec/2011 18:45:15] "GET /static/css/build/bootstrap/bootstrap.css HTTP/1.1" 304 0
[22/Dec/2011 18:45:15] "GET /static/css/build/hv-pages.css HTTP/1.1" 200 2019
[22/Dec/2011 18:45:15] "GET /static/css/build/pages/hv-notifications-dialogs.css HTTP/1.1" 200 373
Thu, 22 Dec 2011 18:45:15 +0000 [ERROR] M:sentry.errors.client, P:9067, F:base.py:226, MSG:Unable to reach Sentry log server: HTTP Error 405: METHOD NOT ALLOWED (url: http://0.0.0.0:9000/store, body: )
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/raven/base.py", line 222, in send
    return self.send_remote(url=url, data=message, headers=headers)
  File "/Library/Python/2.7/site-packages/raven/base.py", line 201, in send_remote
    response = urllib2.urlopen(req, data).read()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 432, in error
    result = self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 619, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 405: METHOD NOT ALLOWED
Thu, 22 Dec 2011 18:45:15 +0000 [WARNING] M:sentry.errors.client, P:9067, F:base.py:227, MSG:Not Found: /favicon.ico
Thu, 22 Dec 2011 18:45:15 +0000 [WARNING] M:django.request, P:9067, F:base.py:142, MSG:Not Found: /favicon.ico

I've set some Sentry settings in settings.py as follows:

SENTRY_SERVERS = ['http://0.0.0.0:9000/store']
SENTRY_KEY = "666"

TEMPLATE_DEBUG = True
SENTRY_TESTING = True

LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'formatters': {
        'default': {
            'format': '%(asctime)s [%(levelname)s] M:%(name)s, P:%(process)d, F:%(filename)s:%(lineno)d, MSG:%(message)s',
            'datefmt': '%a, %d %b %Y %H:%M:%S %z',
        },
    },
    'root': {
            'level':'DEBUG',            # CHANGE TO DEFAULT_LEVEL
            'handlers':['sentry', 'console'],
    },
    'handlers': {
        'sentry': {
            'level':'INFO',
            'class': 'raven.contrib.django.handlers.SentryHandler',
            'formatter':'default'
        },
        'console':{
            'level':'INFO',
            'class':'logging.StreamHandler',
            'formatter': 'default'
        },
    },
    'loggers': {
        'sentry.errors': {
          'level': 'DEBUG',
          'handlers': ['console'],
          'propagate': False,
        },
    }
}

And in another section of code I throw a manual error as follows:

logger = logging.getLogger()
logger.critical()

Also, I add sentry and raven.contrib.django in my INSTALLED_APPS


Here is the default config file for Sentry (located at ~/.sentry/sentry.conf.py):

import os.path

from sentry.conf.server import *

ROOT = os.path.dirname(__file__)

DATABASES = {
    'default': {
        # You can swap out the engine for MySQL easily by changing this value
        # to ``django.db.backends.mysql`` or to PostgreSQL with
        # ``django.db.backends.postgresql_psycopg2``
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(ROOT, 'sentry.db'),
        'USER': 'postgres',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
    }
}

SENTRY_KEY = "666"

# Set this to false to require authentication
SENTRY_PUBLIC = True

SENTRY_WEB_HOST = '0.0.0.0'
SENTRY_WEB_PORT = 9000

SENTRY_WEB_LOG_FILE = os.path.join(ROOT, 'sentry.log')
SENTRY_WEB_PID_FILE = os.path.join(ROOT, 'sentry.pid')

I'm sure I'm just accessing the Sentry server incorrectly but I have no idea why. The documentation on raven and django-sentry is extremely terse! Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

将军与妓 2024-12-29 07:52:08

我花了几个小时、几个小时、几个小时才弄清楚!如果您遇到此问题,这可能是解决方案:

SENTRY_SERVERS = ['http://0.0.0.0:9000/store']

需要有一个尾部斜杠!

SENTRY_SERVERS = ['http://0.0.0.0:9000/store/']

哎呀。

I figured it out after hours and hours and hours! If you're having this problem, this might be the solution:

SENTRY_SERVERS = ['http://0.0.0.0:9000/store']

needs to have a trailing slash!

SENTRY_SERVERS = ['http://0.0.0.0:9000/store/']

gees.

梦境 2024-12-29 07:52:08

遇到了一个稍微相似的问题,其原因相同。也将其发布在这里。

这就是为哨兵生成的配置文件的样子。

# You should configure the absolute URI to Sentry. It will attempt to guess it if 
# you don't but proxies may interfere with this.
SENTRY_URL_PREFIX = 'http://localhost:9001'  # No trailing slash!
SENTRY_WEB_HOST = '0.0.0.0'
SENTRY_WEB_PORT = 9001`

当我用 sentry test 测试它时它起作用了
但是,当插入日志时,我遇到了一些错误,

ERROR Unable to reach Sentry log server: <urlopen error timed out> 
(url:http://localhost:9001/api/store/) 
..........
..........
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", 
line 1174, in do_open raise URLError(err).....
URLError: <urlopen error timed out>

当我不顾说明添加尾部斜杠时,这些错误消失了。可能和我本地的设置或者什么有关系。

Ran into a slightly simular problem that had the same cause. Posting it here as well.

This is what the generated config file for sentry looks like.

# You should configure the absolute URI to Sentry. It will attempt to guess it if 
# you don't but proxies may interfere with this.
SENTRY_URL_PREFIX = 'http://localhost:9001'  # No trailing slash!
SENTRY_WEB_HOST = '0.0.0.0'
SENTRY_WEB_PORT = 9001`

It worked when I tested it with sentry test
However, when plugging in the logs I got some errors

ERROR Unable to reach Sentry log server: <urlopen error timed out> 
(url:http://localhost:9001/api/store/) 
..........
..........
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", 
line 1174, in do_open raise URLError(err).....
URLError: <urlopen error timed out>

Those errors disappeared when I added a trailing slash inspite the instructions. Maybe it has something to do with my local settings or something.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文