GNU Mailman 3.3.1 (Tom Sawyer) Python 3.6.8 (default, Sep 26 2019, 11:57:09) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] config file: /opt/mailman/mailman/var/etc/mailman.cfg db url: sqlite:////opt/mailman/mailman/var/data/mailman.db devmode: DISABLED REST root url: https://empire:8001/3.1/ REST credentials: r****n:r*****s
My REST API is running on "empire" (192.168.0.27), but isn't this messages referencing
snip
python manage.py runserver 0.0.0.0:8000 Performing system checks...
System check identified no issues (0 silenced). April 22, 2020 - 19:05:09 Django version 2.2.12, using settings 'settings' Starting development server at http://0.0.0.0:8000/ Quit the server with CONTROL-C. ERROR Mailman REST API not available Traceback (most recent call last): File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/urllib3-1.25.8-py3.6.egg/urllib3/connection.py", line 157, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/urllib3-1.25.8-py3.6.egg/urllib3/util/connection.py", line 84, in create_connection raise err File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/urllib3-1.25.8-py3.6.egg/urllib3/util/connection.py", line 74, 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 "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/urllib3-1.25.8-py3.6.egg/urllib3/connectionpool.py", line 672, in urlopen chunked=chunked, File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/urllib3-1.25.8-py3.6.egg/urllib3/connectionpool.py", line 387, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib64/python3.6/http/client.py", line 1254, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib64/python3.6/http/client.py", line 1300, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib64/python3.6/http/client.py", line 1249, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib64/python3.6/http/client.py", line 1036, in _send_output self.send(msg) File "/usr/lib64/python3.6/http/client.py", line 974, in send self.connect() File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/urllib3-1.25.8-py3.6.egg/urllib3/connection.py", line 184, in connect conn = self._new_conn() File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/urllib3-1.25.8-py3.6.egg/urllib3/connection.py", line 169, in _new_conn self, "Failed to establish a new connection: %s" % e urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f8dd8cdee80>: 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 "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/requests-2.23.0-py3.6.egg/requests/adapters.py", line 449, in send timeout=timeout File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/urllib3-1.25.8-py3.6.egg/urllib3/connectionpool.py", line 720, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/urllib3-1.25.8-py3.6.egg/urllib3/util/retry.py", line 436, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8001): Max retries exceeded with url: /3.0/lists?advertised=true&count=0&page=1 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8dd8cdee80>: 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 "/opt/mailman/mailmanclient/src/mailmanclient/restbase/connection.py", line 96, in call headers=headers) File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/requests-2.23.0-py3.6.egg/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/requests-2.23.0-py3.6.egg/requests/sessions.py", line 530, in request resp = self.send(prep, **send_kwargs) File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/requests-2.23.0-py3.6.egg/requests/sessions.py", line 643, in send r = adapter.send(request, **kwargs) File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/requests-2.23.0-py3.6.egg/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8001): Max retries exceeded with url: /3.0/lists?advertised=true&count=0&page=1 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8dd8cdee80>: 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 "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/Django-2.2.12-py3.6.egg/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/mailman/postorius/src/postorius/views/list.py", line 755, in list_index paginator_class=MailmanPaginator) File "/opt/mailman/django-mailman3/django_mailman3/lib/paginator.py", line 71, in paginate objects = paginator.page(page_num) File "/opt/mailman/django-mailman3/django_mailman3/lib/paginator.py", line 46, in page number = self.validate_number(number) File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/Django-2.2.12-py3.6.egg/django/core/paginator.py", line 48, in validate_number if number > self.num_pages: File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/Django-2.2.12-py3.6.egg/django/utils/functional.py", line 80, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/Django-2.2.12-py3.6.egg/django/core/paginator.py", line 97, in num_pages if self.count == 0 and not self.allow_empty_first_page: File "/opt/mailman/venv-3.6/lib64/python3.6/site-packages/Django-2.2.12-py3.6.egg/django/utils/functional.py", line 80, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/opt/mailman/django-mailman3/django_mailman3/lib/paginator.py", line 56, in count return self.function(count=0, page=1).total_size File "/opt/mailman/postorius/src/postorius/views/list.py", line 751, in _get_list_page advertised=advertised, mail_host=mail_host, count=count, page=page) File "/opt/mailman/mailmanclient/src/mailmanclient/client.py", line 181, in get_list_page return Page(self._connection, url, MailingList, count, page) File "/opt/mailman/mailmanclient/src/mailmanclient/restbase/page.py", line 37, in __init__ self._create_page() File "/opt/mailman/mailmanclient/src/mailmanclient/restbase/page.py", line 62, in _create_page response, content = self._connection.call(self._build_url()) File "/opt/mailman/mailmanclient/src/mailmanclient/restbase/connection.py", line 120, in call 'Could not connect to Mailman API: ', repr(e)) mailmanclient.restbase.connection.MailmanConnectionError: ('Could not connect to Mailman API: ', 'ConnectionError(MaxRetryError("HTTPConnectionPool(host=\'localhost\', port=8001): Max retries exceeded with url: /3.0/lists?advertised=true&count=0&page=1 (Caused by NewConnectionError(\'<urllib3.connection.HTTPConnection object at 0x7f8dd8cdee80>: Failed to establish a new connection: [Errno 111] Connection refused\',))",),)')
<<<< snip
not sure I understand???
On 4/22/20 2:50 PM, Mark Sapiro wrote:
On 4/22/20 11:35 AM, Ralf Wiegand wrote:
but I am getting :
mailmanclient.restbase.connection.MailmanConnectionError: ('Could not connect to Mailman API: ', 'ConnectionError(MaxRetryError("HTTPConnectionPool(host=\'localhost\', port=8001): Max retries exceeded with url: /3.0/lists?advertised=true&count=0&page=1 (Caused by NewConnectionError(\'<urllib3.connection.HTTPConnection object at 0x7f88fe4cb4e0>: Failed to establish a new connection: [Errno 111] Connection refused\',))",),)')
What do you have for ALLOWED_HOSTS in your settings file(s)? You may want something like
ALLOWED_HOSTS = ['*']
or
ALLOWED_HOSTS = ['192.168.*']