Στις 2019-09-21 22:18, Mark Sapiro έγραψε:
On 9/21/19 1:00 PM, Manos Pitsidianakis wrote:
Can I use a debugger to see exactly what happens in the runner?
You might be able to run the runner under pdb <https://docs.python.org/3.2/library/pdb.html>.
I think I found what's wrong:
/usr/local/lib/python3.5/dist-packages/mailman/core/runner.py(134)run() -> filecnt = self._one_iteration()
/usr/local/lib/python3.5/dist-packages/mailman/core/runner.py(173)_one_iteration() -> self._process_one_file(msg, msgdata)
/usr/local/lib/python3.5/dist-packages/mailman/core/runner.py(266)_process_one_file() -> keepqueued = self._dispose(mlist, msg, msgdata)
/usr/local/lib/python3.5/dist-packages/mailman/runners/outgoing.py(95)_dispose() -> self._func(mlist, msg, msgdata)
/usr/local/lib/python3.5/dist-packages/mailman/mta/deliver.py(86)deliver() -> refused = agent.deliver(mlist, msg, msgdata)
/usr/local/lib/python3.5/dist-packages/mailman/mta/base.py(163)deliver() -> callback(mlist, message_copy, msgdata_copy)
/usr/local/lib/python3.5/dist-packages/mailman/mta/decorating.py(32)decorate() -> decorator.process(mlist, msg, msgdata)
/usr/local/lib/python3.5/dist-packages/mailman/handlers/decorate.py(264)process() -> process(mlist, msg, msgdata)
/usr/local/lib/python3.5/dist-packages/mailman/handlers/decorate.py(89)process() -> footer = decorate('list:member:regular:footer', mlist, d)
/usr/local/lib/python3.5/dist-packages/mailman/handlers/decorate.py(226)decorate() -> template = getUtility(ITemplateLoader).get(name, mlist, **extradict)
/usr/local/lib/python3.5/dist-packages/mailman/model/template.py(188)get() -> name, lookup_context, **substitutions)
/usr/local/lib/python3.5/dist-packages/mailman/database/transaction.py(85)wrapper() -> return function(args[0], config.db.store, *args[1:], **kws)
/usr/local/lib/python3.5/dist-packages/mailman/model/template.py(109)get() -> contents = protocols.get(actual_uri, **auth)
/usr/local/lib/python3.5/dist-packages/mailman/utilities/protocols.py(38)get() -> response = requests.get(url, timeout=REQUEST_TIMEOUT, **kws) /usr/lib/python3/dist-packages/requests/api.py(70)get() -> return request('get', url, params=params, **kwargs) /usr/lib/python3/dist-packages/requests/api.py(56)request() -> return session.request(method=method, url=url, **kwargs) /usr/lib/python3/dist-packages/requests/sessions.py(488)request() -> resp = self.send(prep, **send_kwargs) /usr/lib/python3/dist-packages/requests/sessions.py(609)send() -> r = adapter.send(request, **kwargs) /usr/lib/python3/dist-packages/requests/adapters.py(487)send() -> raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /mailman3/api/templates/list/meli-announce.meli.delivery/list:member:regular:footer (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f4f0495a358>: Failed to establish a new connection: [Errno 111] Connection refused',))
mailman3 tries to get the template I've set via the mailman suite interface but it assumes it is hosted locally: 'http://localhost:8000/mailman3/api/templates/list/meli-announce.meli.deliver...' In my setup, they are separate machines. I can't find any way to change this in the configuration. Also, can't the same template be loaded from the master's localhost:8001 api?
Haven't fiddled with python for some time, why is this exception catched by "except socket.error"? Is it a subclass of requests.exceptions.ConnectionError?