getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
38.91k stars 4.17k forks source link

Max retries error with using Discovery #13399

Closed scott-wilson closed 5 years ago

scott-wilson commented 5 years ago

Important Details

How are you running Sentry?

Description

I am running the Discovery query builder, and it is erroring out with the following traceback when I run a query:

SnubaError: HTTPConnectionPool(host='localhost', port=1218): Max retries exceeded with url: /query (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5b1cdf2cd0>: Failed to establish a new connection: [Errno 111] Connection refused',))
  File "sentry/api/base.py", line 90, in handle_exception
    response = super(Endpoint, self).handle_exception(exc)
  File "sentry/api/base.py", line 190, in dispatch
    response = handler(request, *args, **kwargs)
  File "sentry/api/endpoints/organization_discover_query.py", line 335, in post
    turbo=serialized.get('turbo'),
  File "sentry/api/endpoints/organization_discover_query.py", line 266, in do_query
    max_per_page=1000
  File "sentry/api/base.py", line 244, in paginate
    cursor=input_cursor,
  File "sentry/api/paginator.py", line 388, in get_result
    data = self.data_fn(offset=offset, limit=limit + 1)
  File "sentry/utils/snuba.py", line 342, in transform_aliases_and_query
    result = raw_query(**kwargs)
  File "sentry/utils/snuba.py", line 477, in raw_query
    raise SnubaError(err)

Steps to Reproduce

  1. Set up a local Sentry instance pointing to localhost.
  2. Enable the following features (SENTRY_FEATURES): organizations:discover, organizations:events-v2, organizations:global-views in sentry.conf.py
  3. Run the onprem upgrade walkthrough here https://github.com/getsentry/onpremise/
  4. Reload the UI, go to Discover, and run a query. It should error at this point.
mattrobenolt commented 5 years ago

When things are ready, there will be documentation for all of this. But as of now, these things are disabled and behind a switch for a reason and not ready to be consumed easily for onpremise. There are extra components that will be needed as seen here.

scott-wilson commented 5 years ago

That's fair. The main reason why I was looking into Discover was to see if it answers this thread https://forum.sentry.io/t/how-to-show-all-events-for-all-projects/6789. Is there another way to get the same result, or is Discover going to be the way to get a global view on the events?

Thanks for taking a look!

dreamyeah commented 5 years ago

@mattrobenolt i face this error 172.17.0.1 - - [04/Jun/2019:10:24:26 +0000] "GET /api/0/organizations/sentry/ HTTP/1.1" 200 4323 "http://localhost:9000/settings/sentry/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36" Traceback (most recent call last): File "/usr/src/sentry/src/sentry/api/base.py", line 90, in handle_exception response = super(Endpoint, self).handle_exception(exc) File "/usr/src/sentry/src/sentry/api/base.py", line 190, in dispatch response = handler(request, *args, kwargs) File "/usr/src/sentry/src/sentry/api/endpoints/organization_stats.py", line 112, in get self._parse_args(request, query_kwargs)) File "/usr/src/sentry/src/sentry/utils/services.py", line 105, in context[key] = (lambda f: lambda *a, *k: getattr(self, f)(a, k))(key) File "/usr/src/sentry/src/sentry/tsdb/redissnuba.py", line 78, in method return getattr(self.backends[backend], key)(*a, kw) File "/usr/src/sentry/src/sentry/tsdb/snuba.py", line 141, in get_range aggregation='count()', group_on_time=True) File "/usr/src/sentry/src/sentry/tsdb/snuba.py", line 89, in get_data is_grouprelease=(model == TSDBModel.frequent_releases_by_group) File "/usr/src/sentry/src/sentry/utils/snuba.py", line 632, in query kwargs File "/usr/src/sentry/src/sentry/utils/snuba.py", line 592, in raw_query raise SnubaError(err) SnubaError: HTTPConnectionPool(host='localhost', port=1218): Max retries exceeded with url: /query (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc5b8320b10>: Failed to establish a new connection: [Errno 111] Connection refused',)) 172.17.0.1 - - [04/Jun/2019:10:24:28 +0000] "GET /api/0/organizations/sentry/projects/?query= HTTP/1.1" 200 2651 "http://localhost:9000/settings/sentry/projects/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36" 172.17.0.1 - - [04/Jun/2019:10:24:28 +0000] "GET /api/0/organizations/sentry/stats/?since=1559557467.984&stat=generated&group=project HTTP/1.1" 500 437 "http://localhost:9000/settings/sentry/projects/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36" 172.17.0.1 - - [04/Jun/2019:10:24:29 +0000] "GET /api/embed/error-page/?dsn=http://7f9524af184d4a0ca5936999879a0061@sentry.xiaohongshu.com:9000/1&eventId=78524ab6ec3941e598647129edb7a181 HTTP/1.1" 200 15289 "http://localhost:9000/settings/sentry/projects/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"

Can you explain what is the main reason of this error? master branch。

mattrobenolt commented 5 years ago

As I’ve said, this requires undocumented services for it to work. When we’re ready to release it all, we will say so. Until then, there’s not much effort we can provide to helping you through this. Run the latest tagged release instead.