ICTU / netbox_slm

Netbox Software Lifecycle Management Extension
Other
36 stars 7 forks source link

Installation of netbox_slm plugin failed #31

Closed jbbenetti closed 1 year ago

jbbenetti commented 1 year ago

Hello everyone,

I've tried to install the netbox_slm plugin. But it fails when I run bash docker-compose up -d. I've followed the instructions on netbox_slm README.md. Moreover, I use the 1.4 version of the plugin. I have created the following files in the netbox's repository.

plugin_requirements.txt netbox-slm

plugins.py

PLUGINS = ["netbox_slm"]

docker-compose.override.yml

version: '3.4' # This is NOT the version of NetBox! No need to adjust :)
services:
  netbox:
    image: netbox:latest-plugins
    ports:
      - 8000:8080
    build:
      context: .
      dockerfile: Dockerfile-Plugins
  netbox-worker:
    image: netbox:latest-plugins
    build:
      context: .
      dockerfile: Dockerfile-Plugins
  netbox-housekeeping:
    image: netbox:latest-plugins
    build:
      context: .
      dockerfile: Dockerfile-Plugins

Dockerfile-Plugins

FROM netboxcommunity/netbox:v3.6-2.7.0 //last version of netbox

COPY ./plugin_requirements.txt /opt/netbox/
RUN /opt/netbox/venv/bin/pip install  --no-warn-script-location -r /opt/netbox/plugin_requirements.txt

# These lines are only required if your plugin has its own static files.
COPY configuration/configuration.py /etc/netbox/config/configuration.py
COPY configuration/plugins.py /etc/netbox/config/plugins.py
RUN SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input

The build works. I have the following logs :

netbox-docker-netbox-1 | **ImportError: cannot import name 'DynamicModelChoiceField'** from 'utilities.forms' (/opt/netbox/netbox/utilities/forms/__init__.py)

How can I resolve this issue ?

wkoot commented 1 year ago

There's already a fix for this in the master branch, it will be released in version 1.5 which I hope to finish either this or next week :)

The bug is due to a change in a recent version of NetBox. If you use NetBox version 3.4, you should not have this error.

wkoot commented 1 year ago

Fixed with 1.5

jbbenetti commented 1 year ago

Thank you very much @wkoot for your answer. So, I will attend the 1.5 version. in the meantime, I will try again with version 3.4 of netbox.

wkoot commented 1 year ago

@jbbenetti I meant that 1.5 was released, so this issue should now be fixed. You don't need to downgrade NetBox, just update the plugin

jbbenetti commented 1 year ago

Woww. Impressive. It works perfectly. Thank you again.