Closed gpmidi closed 8 months ago
Thank you for opening a bug report. I was unable to reproduce the reported behavior on NetBox v3.6.7. Please re-confirm the reported behavior on the current stable release and adjust your post above as necessary. Remember to provide detailed steps that someone else can follow using a clean installation of NetBox to reproduce the issue. Remember to include the steps taken to create any initial objects or other data.
I'm seeing the same issue on the newest versions of netbox-docker and netbox-secrets.
Just created a completely bare, fresh install with no objects other than my user. Tried with 2048 and 4096-bit keys and got the same message as OP.
AttributeError at /plugins/secrets/user-key/edit/
'str' object has no attribute '_meta'
Request Method: POST
Request URL: http://localhost:8050/plugins/secrets/user-key/edit/
Django Version: 4.2.9
Exception Type: AttributeError
Exception Value:
'str' object has no attribute '_meta'
Exception Location: /opt/netbox/netbox/utilities/templatetags/builtins/filters.py, line 95, in meta
Raised during: netbox_secrets.views.UserKeyEditView
Python Executable: /opt/netbox/venv/bin/python
Python Version: 3.11.4
Python Path:
['/opt/netbox/netbox/',
'/usr/lib/python311.zip',
'/usr/lib/python3.11',
'/usr/lib/python3.11/lib-dynload',
'/opt/netbox/venv/lib/python3.11/site-packages']
Server time: Tue, 13 Feb 2024 02:16:50 +0000
Unless someone provides us the steps to reproduce this bug, it's not possible for us to find which condition might have caused this. We too use our plugin and have not yet encountered it anywhere.
As provided in the setup instructions:
git clone -b release https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
plugin_requirements.txt
netbox-secrets
Dockerfile-Plugins
FROM netboxcommunity/netbox:latest
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
docker-compose.override.yml
version: '3.4'
services:
netbox:
image: netbox:latest-plugins
ports:
- "8050: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
plugins.py
PLUGINS = ["netbox_secrets"]
PLUGINS_CONFIG = {
"netbox_secrets": {},
}
docker compose build --no-cache
docker-compose up -d
docker compose exec netbox /opt/netbox/netbox/manage.py createsuperuser
log into web interface Click on 'Plugins' in the navigation bar Click on 'User key' under 'NETBOX-SECRETS'
Add User Key Enter any 1024, 2048, or 4096-bit RSA public key
See error from previous message
Remember to provide detailed steps that someone else can follow using a clean installation of NetBox to reproduce the issue. Remember to include the steps taken to create any initial objects or other data.
Rather than setup instructions, please provide the steps that caused the issue in the first place. I did exactly as you outlined in your setup instructions and I cannot reproduce the issue. So, I'm left to believe that this is a user error for now as you are failing to provide the steps.
NetBox Secrets plugin version
v1.9.0
NetBox version
v3.6.7
Steps to Reproduce
'str' object has no attribute '_meta'
Might be related to Netbox issue 7474
Expected Behavior
A new public key should be added for my user
Observed Behavior