Giter Club home page Giter Club logo

Comments (9)

packetlifter avatar packetlifter commented on June 27, 2024 1

@jvanderaa

  • nautobot_config.py PLUGINS and PLUGINS_CONFIG

#Enable installed plugins. Add the name of each plugin to the list.
PLUGINS = ["nautobot_chatops"]

#Plugins configuration settings. These settings are used by various plugins that the user may have installed.
#Each key in the dictionary is the name of an installed plugin and its value is a dictionary of settings.
PLUGINS_CONFIG = {
'nautobot_chatops': {
'enable_slack': True,
'slack_api_token': 'xoxb-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'slack_signing_secret': '6e13fxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
}

  • What platform/environment is this installed on (Ubuntu/RHEL/Centos/Other, Docker, nautobot-lab Docker?)
    I'm using Ubuntu 20.04.2

  • What DB back end are you using? Right now only Postgres is supported, 1.5 of the ChatOps plugin due out shortly will also support MySQL.
    psql (12.8 (Ubuntu 12.8-0ubuntu0.20.04.1))

I always do this restart whenever i change the nautobot_config.py

Thanks,

from nautobot-app-chatops.

matt852 avatar matt852 commented on June 27, 2024

I'm unable to replicate this issue as described above. Are you still having this issue?

The only thing I see wrong initially with the Steps To Reproduce is that you're missing the plugin settings for PLUGIN_CONFIG. You'll want to configure at least one client using the settings listed in the documentation (Slack, Mattermost, Webex, or Microsoft Teams).

If you're still having this issue after updating those settings, please list what those are (omitting any passwords/keys/etc).

from nautobot-app-chatops.

packetlifter avatar packetlifter commented on June 27, 2024

I'm having the same issue. I have the PLUGINS_CONFIG configured correctly.


Traceback (most recent call last):
  File "/opt/nautobot/lib/python3.8/site-packages/rq/worker.py", line 1031, in perform_job
    rv = job.perform()
  File "/opt/nautobot/lib/python3.8/site-packages/rq/job.py", line 749, in perform
    self._result = self._execute()
  File "/opt/nautobot/lib/python3.8/site-packages/rq/job.py", line 772, in _execute
    result = self.func(*self.args, **self.kwargs)
  File "/opt/nautobot/lib/python3.8/site-packages/rq/job.py", line 225, in func
    return import_attribute(self.func_name)
  File "/opt/nautobot/lib/python3.8/site-packages/rq/utils.py", line 142, in import_attribute
    module = importlib.import_module(module_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/nautobot/lib/python3.8/site-packages/nautobot_chatops/workers/__init__.py", line 17, in <module>
    from nautobot_chatops.models import CommandLog
  File "/opt/nautobot/lib/python3.8/site-packages/nautobot_chatops/models.py", line 14, in <module>
    class CommandLog(BaseModel):
  File "/opt/nautobot/lib/python3.8/site-packages/django/db/models/base.py", line 113, in __new__
    raise RuntimeError(
RuntimeError: Model class nautobot_chatops.models.CommandLog doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

I see this log on Failed jobs under background-tasks of admin UI whenever I do /nautobot from slack

nautobot = 1.1.2
nautobot-chatops = 1.4.1

from nautobot-app-chatops.

jvanderaa avatar jvanderaa commented on June 27, 2024

I tested with the original thought of having Slack disabled and executing. This currently provides a 404 response message.

from nautobot-app-chatops.

smk4664 avatar smk4664 commented on June 27, 2024

I think this might be an issue with the rq-worker not having restarted after installing. Mind restarting the nautobot-worker service, and if running Nautobot>=1.1.0 restart nautobot-rq-worker.

from nautobot-app-chatops.

jvanderaa avatar jvanderaa commented on June 27, 2024

@smk4664 I get a different error when installing Nautobot Chatops and only restart Nautobot, not the worker:

Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]: 12:32:33 Traceback (most recent call last):
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/rq/job.py", line 249, in _deserialize_data
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     self._func_name, self._instance, self._args, self._kwargs = self.serializer.loads(self.data)
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/nautobot_chatops/dispatchers/slack.py", line 27, in <module>
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     class SlackDispatcher(Dispatcher):
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/nautobot_chatops/dispatchers/slack.py", line 36, in SlackDispatcher
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     command_prefix = settings.PLUGINS_CONFIG["nautobot_chatops"]["slack_slash_command_prefix"]
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]: KeyError: 'nautobot_chatops'
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]: The above exception was the direct cause of the following exception:
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]: Traceback (most recent call last):
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/rq/worker.py", line 1026, in perform_job
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     self.prepare_job_execution(job)
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/rq/worker.py", line 911, in prepare_job_execution
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     self.procline(msg.format(job.func_name, job.origin, time.time()))
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/rq/job.py", line 284, in func_name
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     self._deserialize_data()
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/rq/job.py", line 252, in _deserialize_data
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     raise DeserializationError() from e
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]: rq.exceptions.DeserializationError
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]: Traceback (most recent call last):
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/rq/job.py", line 249, in _deserialize_data
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     self._func_name, self._instance, self._args, self._kwargs = self.serializer.loads(self.data)
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/nautobot_chatops/dispatchers/slack.py", line 27, in <module>
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     class SlackDispatcher(Dispatcher):
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/nautobot_chatops/dispatchers/slack.py", line 36, in SlackDispatcher
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     command_prefix = settings.PLUGINS_CONFIG["nautobot_chatops"]["slack_slash_command_prefix"]
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]: KeyError: 'nautobot_chatops'
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]: The above exception was the direct cause of the following exception:
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]: Traceback (most recent call last):
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/rq/worker.py", line 1026, in perform_job
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     self.prepare_job_execution(job)
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/rq/worker.py", line 911, in prepare_job_execution
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     self.procline(msg.format(job.func_name, job.origin, time.time()))
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/rq/job.py", line 284, in func_name
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     self._deserialize_data()
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:   File "/opt/nautobot/lib/python3.8/site-packages/rq/job.py", line 252, in _deserialize_data
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]:     raise DeserializationError() from e
Aug 16 17:32:33 nautobot-dev01 nautobot-server[15508]: rq.exceptions.DeserializationError

from nautobot-app-chatops.

jvanderaa avatar jvanderaa commented on June 27, 2024

Attempted to recreate this with restarting just the worker. This gives a 301 error.

from nautobot-app-chatops.

jvanderaa avatar jvanderaa commented on June 27, 2024

@packetlifter can you provide:

  • nautobot_config.py PLUGINS and PLUGINS_CONFIG
  • What platform/environment is this installed on (Ubuntu/RHEL/Centos/Other, Docker, nautobot-lab Docker?)
  • What DB back end are you using? Right now only Postgres is supported, 1.5 of the ChatOps plugin due out shortly will also support MySQL.

Also, please attempt to execute systemctl restart nautobot nautobot-worker

Thanks,

Josh

from nautobot-app-chatops.

jvanderaa avatar jvanderaa commented on June 27, 2024

Just to confirm as well, nautobot-server post_upgrade was run as well?

from nautobot-app-chatops.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.