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

Missing grpc dependency? #290

Open
glennmatthews opened this issue Nov 14, 2023 · 5 comments
Open

Missing grpc dependency? #290

glennmatthews opened this issue Nov 14, 2023 · 5 comments
Assignees

Comments

@glennmatthews
Copy link
Contributor

Environment

  • Python version:
  • Nautobot version: 2.0.4
  • nautobot-chatops version: 3.0.1

Seeing the below recurring traceback from Nautobot:

nautobot-docker-compose-nautobot-1  | Unable to load worker cloudvision, skipping. Exception follows:
nautobot-docker-compose-nautobot-1  | No module named 'grpc'
nautobot-docker-compose-nautobot-1  | Traceback (most recent call last):
nautobot-docker-compose-nautobot-1  |   File "/opt/nautobot/.local/lib/python3.11/site-packages/nautobot_chatops/workers/__init__.py", line 79, in get_commands_registry
nautobot-docker-compose-nautobot-1  |     command_func = worker.load()
nautobot-docker-compose-nautobot-1  |                    ^^^^^^^^^^^^^
nautobot-docker-compose-nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 2518, in load
nautobot-docker-compose-nautobot-1  |     return self.resolve()
nautobot-docker-compose-nautobot-1  |            ^^^^^^^^^^^^^^
nautobot-docker-compose-nautobot-1  |   File "/usr/local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 2524, in resolve
nautobot-docker-compose-nautobot-1  |     module = __import__(self.module_name, fromlist=['__name__'], level=0)
nautobot-docker-compose-nautobot-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-docker-compose-nautobot-1  |   File "/opt/nautobot/.local/lib/python3.11/site-packages/nautobot_chatops/integrations/aristacv/worker.py", line 7, in <module>
nautobot-docker-compose-nautobot-1  |     from .cvpgrpcutils import get_device_tags
nautobot-docker-compose-nautobot-1  |   File "/opt/nautobot/.local/lib/python3.11/site-packages/nautobot_chatops/integrations/aristacv/cvpgrpcutils.py", line 5, in <module>
nautobot-docker-compose-nautobot-1  |     import grpc
nautobot-docker-compose-nautobot-1  | ModuleNotFoundError: No module named 'grpc'
@zackt25
Copy link
Contributor

zackt25 commented Nov 14, 2023

@glennmatthews I ran into this also, @joewesch was able to help me.

I started off by only installing the chatops application 3.0.1 with no extras and hit the error above.
We poetry added grpcio and ran into an error with the next import for arista in that file cvpgrpcutils.py.

We then re-installed the app with the "all" integrations settings and it worked.

Only thing is now when I run my /slash command it's saying that /cloudvision is available, but weird that it isn't listing all the other integrations.

Feels like it trying to load cloudvision even though I'm not requesting it to be loaded with the base install no extras.

@smk4664
Copy link
Contributor

smk4664 commented Nov 14, 2023

Interesting, It shouldn't be trying to load cloudvision unless it is enabled. I will look into this.

@zackt25
Copy link
Contributor

zackt25 commented Nov 15, 2023

This was my pyproject.toml and it worked, but had to add in django-rq.

# Used for local development
nautobot = { version = "2.0.3", optional = true }
python = ">=3.8,<3.12"
nautobot-chatops = {extras = ["aristacv"], version = "^3.0.1"}
django-rq = "^2.8.1"
Markdown = "*"

@smk4664
Copy link
Contributor

smk4664 commented Dec 7, 2023

I know it has been a few weeks, but I am curious @glennmatthews and @zackt25 what you have in your nautobot_config.py. It should only try to load integrations that are enabled in your nautobot_config. For Instance:

PLUGINS_CONFIG = {
    "nautobot_chatops": {
        "enable_aristacv": True,
     },
}

@smk4664
Copy link
Contributor

smk4664 commented Dec 7, 2023

Nevermind, I see the issue. it was renamed from "cloudvision" to "aristacv", but only partially. Also, there is still a reference to rq, which is why you had to install it. I will get a fix out for this.

@smk4664 smk4664 self-assigned this Feb 12, 2024
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

3 participants