-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Plugin isn't recognized by netbox #58
Comments
Hi @klaernie! What Netbox version are you using? Try using Netbox testing mode (using port 8000 in Django --insecure mode) and put the terminal logging output here so we can see what is going on. Also, make sure to have Debug mode enabled on this Netbox development mode so that the terminal logging works correctly! |
My image is based on the official https://github.com/netbox-community/netbox-docker image, where the I've now run a second netbox instance in development mode, and port-forwarded it to the outside, but the log still looks fairly clean:
One thing I noticed though, the debug sidebar has a settings panel: The one thing I see there, is that the
Do you know of any mechanism that would cause netbox to reject a configured plugin silently? |
I haven't seen this yet. Could you temporarily remove netbox_topology_views configuration both from PLUGINS and PLUGINS_CONFIG variable, so that we can see if there is any change? Also, make sure to enter Netbox virtual environment and see if netbox_proxbox shows up when listing the packages of the venv by issuing the Don't forget to run database migrations: Lastly, I will take some time to see line by line of the output you just put here and try to find anything that can be leading to this error. |
I currently don't use Netbox Docker on production use or in development one. But I will create an lab using this, although I don't think there should be any different behavior from the manual process. |
Just now I found my issue! I included a configuration.py snippet for the first plugin that I installed, in order to get All I needed to do was klaernie/netbox-docker@76a99ec in order to remove that old cruft, and suddenly the plugin appeared where it should. Now it only remains to verify my work on making Thanks a lot, @emersonfelipesp ! I'm truely sorry I wasted some of your time on this issue. |
To solve it, you'll have to change 1.3.2. Change Netbox 'settings.py' to include Proxbox Template directory
Edit /opt/netbox/netbox/netbox and find TEMPLATE_DIR section How it is configured by default (Netbox >= v3.2.0):TEMPLATES_DIR = BASE_DIR + '/templates'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [TEMPLATES_DIR],
'APP_DIRS': True,
'OPTIONS': {
'builtins': [
'utilities.templatetags.builtins.filters',
'utilities.templatetags.builtins.tags',
],
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.template.context_processors.media',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'netbox.context_processors.settings_and_registry',
],
},
},
] How it MUST be configured to Proxbox work:TEMPLATES_DIR = BASE_DIR + '/templates'
# PROXBOX CUSTOM TEMPLATE
PROXBOX_TEMPLATE_DIR = BASE_DIR + '/netbox-proxbox/netbox_proxbox/templates/netbox_proxbox'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [TEMPLATES_DIR, PROXBOX_TEMPLATE_DIR], # <--- IMPORTANT
# The Parameters below is equal to default Netbox config
'APP_DIRS': True,
'OPTIONS': {
'builtins': [
'utilities.templatetags.builtins.filters',
'utilities.templatetags.builtins.tags',
],
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.template.context_processors.media',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'netbox.context_processors.settings_and_registry',
],
},
},
] Example of error if not configuring the code above on
|
I know. I already implemented it in https://github.com/klaernie/netbox-docker/blob/main/Dockerfile#L12-L13 But now looking at it I now notice my problem: the README snipped clearly expects a full checkout of netbox-proxbox under I've seen that you wrote about the footer issue and the open issue in netbox - which has been merged. So shouldn't there now be a way to implement this directly?
There is also a downside: unless the netbox-plugins-store stores which plugins to install and configure inside the database it will break horrendously in containerized environments. The deployment using the helm chart goes to probably the most extreme approach: netbox is running as a non-root user, all application source code is in the readonly mounted rootfs, and only the few places where the application is expected to write to (namely the media and reports directories) are writable at all. So running the plugin-store on a containerized deployment will break unless you pull some very clever stunts. From my perspective I'd rather prefer a way where every plugin is installable via |
So, turns out it's not too much involved to generate the right path: klaernie/netbox-docker@ad1775e |
It really makes me happy to see Proxbox being useful to you, and things working as expected (or almost like we expected). |
Hi there!
After spending the entire yesterday on trying to get it to work, I'm now at a point where I consider the installation I was using as perfect, yet netbox still will not recognize the plugin. Another plugin installed the same way does work, so there must be something amiss that I cannot put my finger on or lack the debugging knowledge for.
Could you please take a look at the docker container I built:
docker run -ti ghcr.io/klaernie/netbox /bin/bash
)The configuration is not contained in the docker image, but injected later on kubernetes level, as I use https://github.com/bootc/netbox-chart to deploy my image.
This is the relevant part of
![image](https://user-images.githubusercontent.com/5636383/169653223-6dde7017-7153-4c87-ad25-e71badac75db.png)
values.yaml
, that is then used to deploy the configuration to kubernetes:I only blanked out the token values, everything else is harmless to share. I could also upload a censored version of the entire file, but I think it would be way too far to hope that you'd setup an entire kubernetes cluster just to test that.
What did I test that makes me sure that the installation is as it should be?
ImportError
exception.no module named netbox_proxbox.__main__
, which is expected, since netbox-proxbox does not have one. But and compilation errors or missing dependencies would have been found by then.How am I sure, that netbox does have the plugin loaded?
This is what I tried inside the container to verify that everything seems okay:
Do you have any idea what I could try or how I could get more info out of the netbox, so that I can find out why loading the plugin doesn't happen?
Best regards,
Andre
The text was updated successfully, but these errors were encountered: