Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Unable to create a user - "Connection Refused"? #7253

Closed
steveharman opened this issue Apr 9, 2020 · 4 comments
Closed

Unable to create a user - "Connection Refused"? #7253

steveharman opened this issue Apr 9, 2020 · 4 comments

Comments

@steveharman
Copy link

steveharman commented Apr 9, 2020

Apologies for spamming the issues page with this, I searched everywhere for a support forum without success (feel free to point out my obvious omission!)

  • I've installed all officially listed dependencies
  • I've followed three different installation guides (Digital Ocean, official, random user)
  • I've tried two different freshly created Ubuntu installs (18, 16) and one on Debian (current)
  • But I always arrive at the same blocker after issuing register_new_matrix_user -c /etc/matrix-synapse/homeserver.yaml https://localhost:8448 - after three different install guides on "different" OSes.

It feels more like a config issue than a code fault but I'm out of ideas and would really appreciate any assistance.

Thanks,

% register_new_matrix_user -c /etc/matrix-synapse/homeserver.yaml https://localhost:8448
New user localpart [root]:
Password:
Confirm password:
Make admin [no]: yes

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 80, in create_connection
    raise err
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 70, 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 600, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 841, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 301, in connect
    conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 168, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f493ecd90f0>: 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 449, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='localhost', port=8448): Max retries exceeded with url: /_matrix/client/r0/admin/register (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f493ecd90f0>: 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/bin/register_new_matrix_user", line 22, in <module>
    main()
  File "/usr/lib/python3/dist-packages/synapse/_scripts/register_new_matrix_user.py", line 224, in main
    admin, args.user_type)
  File "/usr/lib/python3/dist-packages/synapse/_scripts/register_new_matrix_user.py", line 138, in register_new_user
    bool(admin), user_type)
  File "/usr/lib/python3/dist-packages/synapse/_scripts/register_new_matrix_user.py", line 47, in request_registration
    r = requests.get(url, verify=False)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='localhost', port=8448): Max retries exceeded with url: /_matrix/client/r0/admin/register (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f493ecd90f0>: Failed to establish a new connection: [Errno 111] Connection refused')
@clokep
Copy link
Member

clokep commented Apr 9, 2020

Apologies for spamming the issues page with this, I searched everywhere for a support forum without success (feel free to point out my obvious omission!)

#synapse:matrix.org is usually a good first step for support questions.

In this case it seems like Synapse is either not running, or maybe isn't bound to that port (or isn't using TLS locally -- maybe you have TLS configured via the reverse proxy).

@clokep clokep closed this as completed Apr 9, 2020
@dklimpel
Copy link
Contributor

dklimpel commented Apr 9, 2020

Either you have not a valid SSL certificate or your server is not listen with HTTPS at 8448.
One alternative, not very secure, is to use HTTP at 8008.

@clokep
Copy link
Member

clokep commented Apr 9, 2020

Also #3672 and the related bugs from that might be worth looking at.

@melroy89
Copy link

melroy89 commented Oct 4, 2020

By default try 8008 (which can/should be used in combination with Nginx reverse proxy), so:

docker exec -it synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml

Note: Where synapse is the name of your docker container.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants