maubot / maubot

A plugin-based Matrix bot system.
https://mau.bot
GNU Affero General Public License v3.0
719 stars 92 forks source link

mbc auth behind a proxy -> network unreachable #185

Open leguye opened 2 years ago

leguye commented 2 years ago

Hello,

I just installed maubot on a server that accesses the internet via a proxy.

When i use mbc auth to the public server matrix.my.domain.fr I get this error:

mautrix.errors.base.MatrixConnectionError: Cannot connect to host matrix.my.domain.fr:443 ssl:default [Network is unreachable]
[2022-09-02 08:38:24,222] [INFO@aiohttp.access] 127.0.0.1 "POST /_matrix/maubot/v1/client/auth/matrix.my.domain.fr/login 500 246 in 0.0086s"

I tried to set http_proxy and https_proxy environment variables (shell).

Is there a way to use mbc auth in a such context (proxy)?

Thank you.

Madko commented 1 year ago

Hi,

same problem here :

ERROR maubot.serverTraceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/aiohttp/connector.py", line 1152, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
  File "/usr/lib/python3.10/site-packages/aiohttp/connector.py", line 874, in _resolve_host
    addrs = await self._resolver.resolve(host, port, family=self._family)
  File "/usr/lib/python3.10/site-packages/aiohttp/resolver.py", line 33, in resolve
    infos = await self._loop.getaddrinfo(
  File "/usr/lib/python3.10/asyncio/base_events.py", line 863, in getaddrinfo
    return await self.run_in_executor(
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve

I have set env variables like HTTP_PROXY/HTTPS_PROXY etc with no luck so far. Same problem. How to configure maubot to use an http proxy ?