Page MenuHomePhabricator

CodeSearch shows unable to contact hound on visit
Closed, ResolvedPublic

Description

When I go on https://codesearch.wmflabs.org it shows:

Unable to contact hound. If <https://codesearch.wmflabs.org/_health>
says "starting up", please wait a few minutes for the initial indexing
to complete.

If this error continues, please report it in Phabricator
with the following information:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 138, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 98, in create_connection
    raise err
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 88, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 361, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.5/http/client.py", line 1107, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/usr/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 163, in connect
    conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 147, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7f95d939fda0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 643, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 363, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=6080): Max retries exceeded with url: /?i=nope&files=&q=%5C%24%28self%7Cthat%29+%3D+%5C%24this%3B (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f95d939fda0>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/codesearch/app.py", line 225, in proxy
    params=request.args
  File "/usr/lib/python3/dist-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=6080): Max retries exceeded with url: /?i=nope&files=&q=%5C%24%28self%7Cthat%29+%3D+%5C%24this%3B (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f95d939fda0>: Failed to establish a new connection: [Errno 111] Connection refused',))

When I go on https://codesearch.wmflabs.org/_health it shows search - down and it constantly changes from search - pre-start to search - down.

Event Timeline

Kizule triaged this task as Unbreak Now! priority.Jan 18 2020, 1:31 PM
Kizule created this task.

The search everything docker just goes down and it's not coming up. The error is very very helpful:

Jan 18 17:22:46 codesearch4 docker[29147]: panic: EOF
Jan 18 17:22:46 codesearch4 docker[29147]: goroutine 1 [running]:
Jan 18 17:22:46 codesearch4 docker[29147]: main.main()
Jan 18 17:22:46 codesearch4 docker[29147]:         /go/src/github.com/etsy/hound/cmds/houndd/main.go:129 +0x806
Ladsgroup closed this task as Resolved.EditedJan 18 2020, 5:38 PM
Ladsgroup claimed this task.
Ladsgroup added a subscriber: Legoktm.

It should be resolved now, the /srv/hound/hound-search/config.json was empty for reasons unknown to me, running python write_config.py failed for introducing "-> dict" notation which is very new and the old VM in labs doesn't support it. cc @Legoktm

It should be resolved now, the /srv/hound/hound-search/config.json was empty for reasons unknown to me, running python write_config.py failed for introducing "-> dict" notation which is very new and the old VM in labs doesn't support it. cc @Legoktm

Yes, thank you! Maybe codesearch4 should be upgraded to buster? https://tools.wmflabs.org/openstack-browser/project/codesearch

It should be resolved now, the /srv/hound/hound-search/config.json was empty for reasons unknown to me, running python write_config.py failed for introducing "-> dict" notation which is very new and the old VM in labs doesn't support it. cc @Legoktm

Did you literally run python write_config.py? It has to be run using Python 3....at which point I get the following exception:

legoktm@codesearch4:/srv/codesearch$ ./write_config.py 
Traceback (most recent call last):
  File "./write_config.py", line 303, in <module>
    main()
  File "./write_config.py", line 287, in main
    operations=True, twn=True, pywikibot=True, services=True)
  File "./write_config.py", line 280, in make_conf
    json.dump(conf, f, indent='\t')
  File "/usr/lib/python3.5/json/__init__.py", line 179, in dump
    fp.write(chunk)
OSError: [Errno 28] No space left on device

soooo codesearch4 is out of diskspace.

legoktm@codesearch4:/srv/codesearch$ df -h
Filesystem                          Size  Used Avail Use% Mounted on
udev                                2.0G     0  2.0G   0% /dev
tmpfs                               396M   43M  353M  11% /run
/dev/vda3                            19G  6.2G   12G  36% /
tmpfs                               2.0G     0  2.0G   0% /dev/shm
tmpfs                               5.0M     0  5.0M   0% /run/lock
tmpfs                               2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/mapper/vd-second--local--disk   20G   19G     0 100% /srv
tmpfs                               396M     0  396M   0% /run/user/0
tmpfs                               396M     0  396M   0% /run/user/3182
tmpfs                               396M     0  396M   0% /run/user/2552

Mentioned in SAL (#wikimedia-cloud) [2020-01-19T06:08:21Z] <legoktm> temporarily taking everything down to free up disk space (T243121)

Should be fixed now.

It should be resolved now, the /srv/hound/hound-search/config.json was empty for reasons unknown to me, running python write_config.py failed for introducing "-> dict" notation which is very new and the old VM in labs doesn't support it. cc @Legoktm

Did you literally run python write_config.py? It has to be run using Python 3....at which point I get the following exception:

No I ran it with python 3 but I think it's an older version of python3 then the version in buster.

legoktm@codesearch4:/srv/codesearch$ ./write_config.py 
Traceback (most recent call last):
  File "./write_config.py", line 303, in <module>
    main()
  File "./write_config.py", line 287, in main
    operations=True, twn=True, pywikibot=True, services=True)
  File "./write_config.py", line 280, in make_conf
    json.dump(conf, f, indent='\t')
  File "/usr/lib/python3.5/json/__init__.py", line 179, in dump
    fp.write(chunk)
OSError: [Errno 28] No space left on device

soooo codesearch4 is out of diskspace.

I didn't get that. That interesting. We soon should be using the new version anyway. Thanks for doing it.