yoxcu / maubot-token Goto Github PK
View Code? Open in Web Editor NEWA maubot to manage your synapse user registration tokens.
License: GNU Affero General Public License v3.0
A maubot to manage your synapse user registration tokens.
License: GNU Affero General Public License v3.0
When I try to generate a token the bot doesn't respond and I get this in the logs.
16:02:06ERRORclient/@bot:gianmarco.ga Failed to run handler
16:02:06ERRORclient/@bot:gianmarco.ga Traceback (most recent call last):
File "/home/gianmarco/maubot/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "/home/gianmarco/maubot/lib/python3.9/site-packages/urllib3/util/connection.py", line 72, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/gianmarco/maubot/lib/python3.9/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/home/gianmarco/maubot/lib/python3.9/site-packages/urllib3/connectionpool.py", line 398, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/home/gianmarco/maubot/lib/python3.9/site-packages/urllib3/connection.py", line 239, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/lib/python3.9/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/lib/python3.9/http/client.py", line 950, in send
self.connect()
File "/home/gianmarco/maubot/lib/python3.9/site-packages/urllib3/connection.py", line 205, in connect
conn = self._new_conn()
File "/home/gianmarco/maubot/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f031837b6d0>: Failed to establish a new connection: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/gianmarco/maubot/lib/python3.9/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/home/gianmarco/maubot/lib/python3.9/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/home/gianmarco/maubot/lib/python3.9/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='synapse', port=8008): Max retries exceeded with url: /_synapse/admin/v1/registration_tokens/new (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f031837b6d0>: Failed to establish a new connection: [Errno -2] Name or service not known'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/gianmarco/maubot/lib/python3.9/site-packages/mautrix/client/syncer.py", line 229, in _catch_errors
await handler(data)
File "/home/gianmarco/maubot/lib/python3.9/site-packages/maubot/handlers/command.py", line 141, in __call__
ok, res = await self.__call_subcommand__(evt, call_args, remaining_val)
File "/home/gianmarco/maubot/lib/python3.9/site-packages/maubot/handlers/command.py", line 162, in __call_subcommand__
return True, await subcommand(
File "/home/gianmarco/maubot/lib/python3.9/site-packages/maubot/handlers/command.py", line 153, in __call__
return await self.__mb_func__(self.__bound_instance__, evt, **call_args)
File "/home/gianmarco/maubot/plugins/de.yoxcu.token-v1.0.0.mbp/token.py", line 142, in generate_token
ret, available_token=gen_token(self.config["admin_api"],self.config["access_token"],uses,expiry)
File "/home/gianmarco/maubot/plugins/de.yoxcu.token-v1.0.0.mbp/token.py", line 56, in gen_token
r = requests.post(url, data=json.dumps(payload), headers=headers)
File "/home/gianmarco/maubot/lib/python3.9/site-packages/requests/api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "/home/gianmarco/maubot/lib/python3.9/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/home/gianmarco/maubot/lib/python3.9/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/home/gianmarco/maubot/lib/python3.9/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/home/gianmarco/maubot/lib/python3.9/site-packages/requests/adapters.py", line 565, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='synapse', port=8008): Max retries exceeded with url: /_synapse/admin/v1/registration_tokens/new (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f031837b6d0>: Failed to establish a new connection: [Errno -2] Name or service not known'))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.