Sentry Worker gets ConnectionError in the Docker logs

I just installed the sentry via Docker. Here is the instructions I followed. https://docs.sentry.io/server/installation/docker/

I created a web app locally using http-server. I try to send event to the sentry service using Raven-JS. Sentry can get the event. But meanwhile I get the error like this:

ConnectionError: HTTPConnectionPool(host=‘localhost’, port=8000): Max retries exceeded with url: /app/js/controllers.js (Caused by NewConnectionError(’<requests.packages.urllib3.connection.HTTPConnection object at 0x7f123f554dd0>: Failed to establish a new connection: [Errno 111] Connection refused’,))
11:05:58 [WARNING] sentry.lang.javascript.processor: Disabling sources to localhost:8000 for 300s
Traceback (most recent call last):
File “/usr/local/lib/python2.7/site-packages/sentry/utils/safe.py”, line 29, in safe_execute
result = func(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/sentry/plugins/sentry_webhooks/plugin.py”, line 103, in send_webhook
verify_ssl=False,
File “/usr/local/lib/python2.7/site-packages/sentry/http.py”, line 158, in safe_urlopen
**kwargs
File “/usr/local/lib/python2.7/site-packages/requests/sessions.py”, line 475, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python2.7/site-packages/raven/breadcrumbs.py”, line 297, in send
resp = real_send(self, request, *args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/requests/sessions.py”, line 596, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python2.7/site-packages/sentry/http.py”, line 108, in send
return super(BlacklistAdapter, self).send(request, *args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/requests/adapters.py”, line 487, in send
raise ConnectionError(e, request=request)

I guess the Sentry in Docker can not “communicate” with the world outside. How should I do the configuration in order to make it right? Do you guys have any idea? Thanks in advance.

There’s nothing really wrong here. Sentry is trying to fetch sourcemaps and the JavaScript files to go with your error, but the url is to localhost which just obviously can’t be downloaded by the server.

This error is safe to ignore.

Well, the similar exception happens, when I try to use Webhook. I create a simple Restfull Web service which is hosted by a local tomcat. Unfortunately, the event in Sentry can not be forwarded to the Web service. I think the basic problem I have is that the sentry in Docker can not recognize the url in this case localhost with port number. I guess I need some further configuration, :slight_smile:

Yeah, that’d be for a similar reason. From within the docker container, it’s not going to be able to access localhost for you, since localhost would be actually pointing to inside the container. You’d need to use a different IP address. You can effectively treat the container as running on an entirely different host that needs an actual network to communicate to other services, even if they’re running on the same physical machine.

thanks for the input. I will try to fix the problem. Have a nice day, dude, :slight_smile: