Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2.1.17] AttributeError: type object 'Callable' has no attribute '_abc_registry' #1592

Closed
jean-christophe-manciot opened this issue May 20, 2019 · 8 comments
Milestone

Comments

@jean-christophe-manciot

Ubuntu 19.10
gns3-server v2.1.17

Some incorrect requirements has resurfaced in the requirements.txt as already reported here:
v2.1.16 requirements.txt:

aiohttp>=2.3.3,<2.4.0 # pyup: ignore
aiohttp-cors>=0.5.3,<0.6.0 # pyup: ignore

This leads to:

● gns3.service - GNS3 server
   Loaded: loaded (/lib/systemd/system/gns3.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-05-20 12:08:22 CEST; 10ms ago
  Process: 19321 ExecStartPre=/bin/mkdir -p /var/log/gns3 /var/run/gns3 (code=exited, status=0/SUCCESS)
  Process: 19322 ExecStartPre=/bin/chown -R root: /var/log/gns3 /var/run/gns3 (code=exited, status=0/SUCCESS)
  Process: 19323 ExecStart=/usr/local/bin/gns3server --log /var/log/gns3/gns3.log --pid /var/run/gns3/gns3.pid --daemon (code=exited, status=0/SUCCESS)
 Main PID: 19327 (gns3server)
    Tasks: 1 (limit: 4915)
   Memory: 44.5M
   CGroup: /system.slice/gns3.service
           └─19327 /usr/bin/python3.7 /usr/local/bin/gns3server --log /var/log/gns3/gns3.log --pid /var/run/gns3/gns3.pid --daemon

May 20 12:08:21 samsung5-debian systemd[1]: Starting GNS3 server...
May 20 12:08:21 samsung5-debian systemd[1]: gns3.service: Can't open PID file /run/gns3/gns3.pid (yet?) after start: No such file or directory
May 20 12:08:22 samsung5-debian systemd[1]: Started GNS3 server.

v2.1.17 requirements.txt:

aiohttp==2.3.10
aiohttp-cors==0.5.3

The latter prevents gns3.service from starting:

● gns3.service - GNS3 server
   Loaded: loaded (/lib/systemd/system/gns3.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Mon 2019-05-20 12:05:04 CEST; 18ms ago
  Process: 31105 ExecStartPre=/bin/mkdir -p /var/log/gns3 /var/run/gns3 (code=exited, status=0/SUCCESS)
  Process: 31106 ExecStartPre=/bin/chown -R root: /var/log/gns3 /var/run/gns3 (code=exited, status=0/SUCCESS)
  Process: 31107 ExecStart=/usr/local/bin/gns3server --log /var/log/gns3/gns3.log --pid /var/run/gns3/gns3.pid --daemon (code=exited, status=0/SUCCESS)

May 20 12:03:34 samsung5-debian gns3server[31107]:   File "/usr/local/lib/python3.7/dist-packages/yarl/quoting.py", line 3, in <module>
May 20 12:03:34 samsung5-debian gns3server[31107]:     from typing import Optional, TYPE_CHECKING, cast
May 20 12:03:34 samsung5-debian gns3server[31107]:   File "/usr/local/lib/python3.7/dist-packages/typing.py", line 1356, in <module>
May 20 12:03:34 samsung5-debian gns3server[31107]:     class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
May 20 12:03:34 samsung5-debian gns3server[31107]:   File "/usr/local/lib/python3.7/dist-packages/typing.py", line 1004, in __new__
May 20 12:03:34 samsung5-debian gns3server[31107]:     self._abc_registry = extra._abc_registry
May 20 12:03:34 samsung5-debian gns3server[31107]: AttributeError: type object 'Callable' has no attribute '_abc_registry'
May 20 12:05:04 samsung5-debian systemd[1]: gns3.service: Start operation timed out. Terminating.
May 20 12:05:04 samsung5-debian systemd[1]: gns3.service: Failed with result 'timeout'.
May 20 12:05:04 samsung5-debian systemd[1]: Failed to start GNS3 server.
@grossmj
Copy link
Member

grossmj commented May 20, 2019

We will revert this since this didn't solve the issue we were trying to fix (#1583). Thanks for catching this.

grossmj added a commit that referenced this issue May 20, 2019
@grossmj
Copy link
Member

grossmj commented May 20, 2019

We will release version 2.1.18 as soon as #1583 is solved. Thanks again.

@grossmj grossmj closed this as completed May 20, 2019
@jean-christophe-manciot
Copy link
Author

jean-christophe-manciot commented May 27, 2019

On debian buster, installing gns3-server 2.1.18 leads to the same issue:

Setting up gns3-server (2.1.18-10) ...
Requirement already satisfied: jsonschema==2.6.0 in /usr/local/lib/python3.7/dist-packages (from -r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 1)) (2.6.0)
Requirement already satisfied: aiohttp<2.4.0,>=2.3.3 in /usr/local/lib/python3.7/dist-packages (from -r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 2)) (2.3.10)
Requirement already satisfied: aiohttp-cors<0.6.0,>=0.5.3 in /usr/local/lib/python3.7/dist-packages (from -r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 3)) (0.5.3)
Requirement already satisfied: yarl>=0.11 in /usr/local/lib/python3.7/dist-packages (from -r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 4)) (1.3.0)
Requirement already satisfied: Jinja2>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from -r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 5)) (2.10.1)
Requirement already satisfied: raven>=5.23.0 in /usr/local/lib/python3.7/dist-packages (from -r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 6)) (6.10.0)
Requirement already satisfied: psutil>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from -r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 7)) (5.6.2)
Requirement already satisfied: zipstream>=1.1.4 in /usr/local/lib/python3.7/dist-packages (from -r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 8)) (1.1.4)
Requirement already satisfied: typing>=3.5.3.0 in /usr/local/lib/python3.7/dist-packages (from -r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 9)) (3.6.6)
Requirement already satisfied: prompt-toolkit==1.0.15 in /usr/local/lib/python3.7/dist-packages (from -r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 10)) (1.0.15)
Requirement already satisfied: async-timeout<3.0.0 in /usr/local/lib/python3.7/dist-packages (from -r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 11)) (2.0.1)
Requirement already satisfied: multidict>=4.0.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp<2.4.0,>=2.3.3->-r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 2)) (4.5.2)
Requirement already satisfied: chardet in /usr/local/lib/python3.7/dist-packages (from aiohttp<2.4.0,>=2.3.3->-r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 2)) (3.0.4)
Requirement already satisfied: idna-ssl>=1.0.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp<2.4.0,>=2.3.3->-r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 2)) (1.1.0)
Requirement already satisfied: idna>=2.0 in /usr/local/lib/python3.7/dist-packages (from yarl>=0.11->-r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 4)) (2.8)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.7/dist-packages (from Jinja2>=2.7.3->-r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 5)) (1.1.1)
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.7/dist-packages (from prompt-toolkit==1.0.15->-r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 10)) (1.12.0)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.7/dist-packages (from prompt-toolkit==1.0.15->-r /usr/local/lib/python3.7/dist-packages/gns3-server-requirements.txt (line 10)) (0.1.7)
Job for gns3.service failed because a timeout was exceeded.
See "systemctl status gns3.service" and "journalctl -xe" for details.
● gns3.service - GNS3 server
   Loaded: loaded (/lib/systemd/system/gns3.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Mon 2019-05-27 09:57:20 CEST; 20ms ago
  Process: 8601 ExecStartPre=/bin/mkdir -p /var/log/gns3 /var/run/gns3 (code=exited, status=0/SUCCESS)
  Process: 8602 ExecStartPre=/bin/chown -R root: /var/log/gns3 /var/run/gns3 (code=exited, status=0/SUCCESS)
  Process: 8603 ExecStart=/usr/local/bin/gns3server --log /var/log/gns3/gns3.log --pid /var/run/gns3/gns3.pid --daemon (code=exited, status=0/SUCCESS)

May 27 09:55:50 samsung5-debian gns3server[8603]:   File "/usr/local/lib/python3.7/dist-packages/yarl/quoting.py", line 3, in <module>
May 27 09:55:50 samsung5-debian gns3server[8603]:     from typing import Optional, TYPE_CHECKING, cast
May 27 09:55:50 samsung5-debian gns3server[8603]:   File "/usr/local/lib/python3.7/dist-packages/typing.py", line 1356, in <module>
May 27 09:55:50 samsung5-debian gns3server[8603]:     class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
May 27 09:55:50 samsung5-debian gns3server[8603]:   File "/usr/local/lib/python3.7/dist-packages/typing.py", line 1004, in __new__
May 27 09:55:50 samsung5-debian gns3server[8603]:     self._abc_registry = extra._abc_registry
May 27 09:55:50 samsung5-debian gns3server[8603]: AttributeError: type object 'Callable' has no attribute '_abc_registry'
May 27 09:57:20 samsung5-debian systemd[1]: gns3.service: Start operation timed out. Terminating.
May 27 09:57:20 samsung5-debian systemd[1]: gns3.service: Failed with result 'timeout'.
May 27 09:57:20 samsung5-debian systemd[1]: Failed to start GNS3 server.
dpkg: error processing package gns3-server (--install):
 installed gns3-server package post-installation script subprocess returned error exit status 3
Errors were encountered while processing:
 gns3-server

If I upgrade aiohttp-cors and uninstall typing as suggested by this post, I realize that the latter is now hardcoded:

pkg_resources.DistributionNotFound: The 'typing>=3.5.3.0' distribution was not found and is required by gns3

Does gns3-server really need that dependency now because of some import?

@grossmj grossmj reopened this May 27, 2019
@grossmj
Copy link
Member

grossmj commented May 27, 2019

We currently have this: typing>=3.5.3.0 # Otherwise yarl fails with python 3.4 This suggests that we need to have typing installed because of yarl. I will run some tests with different version of Python.

@grossmj grossmj added this to the 2.1.19 milestone May 27, 2019
@grossmj
Copy link
Member

grossmj commented May 27, 2019

I hope this will solve the problem once and for all: 907807d

Please, can you try to install the dev version on your side? Thanks.

@grossmj
Copy link
Member

grossmj commented May 27, 2019

I tested on the GNS3 VM for 2.1 which uses Python 3.4 and I got no issues. I also tested with Python 3.7 in a virtual environment, no problem there too.

@jean-christophe-manciot
Copy link
Author

Fine on Ubuntu 19.10 eoan
Fine on Debian 10 buster.

@grossmj
Copy link
Member

grossmj commented May 28, 2019

Perfect, I am going to release 2.1.19 then 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants