netbox-community / netbox-qrcode

NetBox Plugin for generate QR Codes
Apache License 2.0
209 stars 31 forks source link

plugin installs will not show up on any dcim page. 4.0.2/0.0.12 #75

Closed HomerJaySimpson13 closed 6 days ago

HomerJaySimpson13 commented 5 months ago

i have netbox 4.0.2 running fine. i installed the qrcode plugin and it shows on the admin>system that the plug is loaded. But when i go to any page that would need a qrcode, there is none. it doesn't show anything, i ran the debug log and it shows it loading, i really have no idea where to look to even see what is wrong. Thanks for any assistance. i'm not even sure this is the place to post this question.

cruse1977 commented 5 months ago

Hi, absolutely the right place, I'll see if I can replicate this.

HomerJaySimpson13 commented 5 months ago

out standing. please let me know if i can give you any information. it was a new install as i am just starting. its running on a rocky 9.4 distro and i was using the venv environment.

rcalpha commented 5 months ago

I'm having the same issue. I installed 4.0.5 of Netbox and the latest qecode and It shows nothing. In the admin/system the plugin is loaded

cruse1977 commented 5 months ago

Hi, so I installed a brand new version of netbox-docker and v4.0.5. put some demo data in and enabled qr code (0.0.12) and I see this working as expected on the device page:

image

Can you provide more detail; install method; is there anything in logs, which pages, etc as I'm unable to replicate this at this point in time ?

As an random thought; can you also try running manage.py collectstatic (note environment specific)

HomerJaySimpson13 commented 5 months ago

netbox.log

i am not using the docker version, i am using the downloaded package install method. i am not sure where the qr code shows up, but i have been looking for it on the device page and rack page. not sure if it is anywhere else.

i ran the collectstatic command and got back: 0 static files copied to '/opt/netbox-4.0.5/netbox/static', 487 unmodified.

i also upgraded to 4.0.5 to see if that made a difference, and it did not. i have attached the debug log for me loading the page for a device.

cruse1977 commented 5 months ago

netbox.log

Thanks for doing this ; it was just a random thought.

i also upgraded to 4.0.5 to see if that made a difference, and it did not. i have attached the debug log for me loading the page for a device.

Hm that log shows a few errors but all are NetBox template based rather than QR. Is that log from a simple device (ie: 1ru single device) or a fairly complex (module bays, etc etc) ?

You should see a QR code on devices and racks (you can see the list via QRCode classes)

HomerJaySimpson13 commented 5 months ago

netbox.log Screenshot 2024-06-12 083859

The Earlier one is from a complex device. This log is a simple cable manager so there is no ports or anything.

so i dont see anything anywhere.

cruse1977 commented 5 months ago

so i dont see anything anywhere.

I'm going to try this on a dedicated VM this eve to see if that makes a difference. In theory it shouldn't; Rocky 9.4 ?

HomerJaySimpson13 commented 5 months ago

The OS is : NAME="Rocky Linux" VERSION="9.4 (Blue Onyx)" ID="rocky" ID_LIKE="rhel centos fedora" VERSION_ID="9.4" PLATFORM_ID="platform:el9" PRETTY_NAME="Rocky Linux 9.4 (Blue Onyx)"

jeffgdotorg commented 5 months ago

Unable to reproduce in NetBox v4.0.5 on an Ubuntu 22.04.4 VM created from their cloud-init image. image

cruse1977 commented 5 months ago

The OS is : NAME="Rocky Linux" VERSION="9.4 (Blue Onyx)" ID="rocky" ID_LIKE="rhel centos fedora" VERSION_ID="9.4" PLATFORM_ID="platform:el9" PRETTY_NAME="Rocky Linux 9.4 (Blue Onyx)"

Hi Homer, which python version are you running as 9.4 ships with 3.9 which is unsupported by NetBox 4.x; and how was this installed ? also which installation of Rocky (ie: minimal etc)

we think this is missing libraries and is potentially not a plugin issue.

HomerJaySimpson13 commented 5 months ago

i am using Python 3.12.1 (main, Feb 19 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)]. i used dnf to install it. i used the Application Streams to install it.

ok. what do you recommend for the type of installation as i dont remember what i used. i can put up another box and try it again.

cruse1977 commented 5 months ago

Hi Homer, still can't replicate. As said we think this might be a missing library somewhere from possibly a minimal installation. My output:

(venv) [root@localhost netbox]# pip freeze | grep pillow
pillow==10.3.0
(venv) [root@localhost netbox]# pip freeze | grep qrcode
netbox-qrcode==0.0.12
qrcode==7.4.2

min libs for pillow:

(venv) [root@localhost netbox]# rpm -qa | grep libjpeg
libjpeg-turbo-2.0.90-7.el9.x86_64
(venv) [root@localhost netbox]# rpm -qa | grep zlib
zlib-1.2.11-40.el9.x86_64

unsure on pip qrcode libs.

(venv) [root@localhost netbox]# uname -a Linux localhost.localdomain 5.14.0-427.20.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jun 7 14:51:39 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux (venv) [root@localhost netbox]# cat /etc/rocky-release Rocky Linux release 9.4 (Blue Onyx)

image
HomerJaySimpson13 commented 5 months ago

i am currently rebuilding the server. i'll let you know if it works when i get done. on the current server i am getting the same versions of all the software execpt netbox-qrcode, i am getting version 0.0.13.

jeffgdotorg commented 5 months ago

@HomerJaySimpson13 are you also the Redditor behind this thread?

HomerJaySimpson13 commented 5 months ago

ok. so i twice rebuilt the server using both another rocky 9.4 install and a ubunbtu 24.0.4. it get the same results.

NetBox version | 4.0.5 Python version | 3.12.3 Django version | 5.0.6 PostgreSQL 16.3 qrcode | 0.0.13

so in the end it must be something i am doing. i just cant figure out what it is.

HomerJaySimpson13 commented 5 months ago

if i have debuging logging turned on, should i be seeing anything about qrcode? when i grep the log, i see nothing with qr in it.

supertasksupertask commented 5 months ago
  1. I have tried that rhel8.8 does not have a menu or picture with a QR code like rocky8.5, although the plug-in has been successfully installed.

2、The only difference is the libjpeg version, which is. Libjpeg-turbo-1.5.3-12.el8.x86_64 instead of libjpeg-turbo-2.0.90-7.el9.x86_64, because installation of version 8.x conflicts

cruse1977 commented 5 months ago

My only comment so far is that both RHEL and Rocky are running older version of quite a few things. The base python version as an example is below the one NetBox supports.

Can I asked what installation type was used please ? ie: minimal; etc ? and also how python was installed given the OS version isn't compatible ?

rcalpha commented 5 months ago

Hi...

I'm using ubuntu 20.04.6 and I have the same issue. I read above posts and I share the details of version:

NetBox version | 4.0.5 Python version | 3.12.4 Django version | 5.0.6 PostgreSQL 12.18 qrcode | 0.0.13 zlib: 1:1.2.11.dfsg-2ubuntu1.5 pillow: 10.3.0 libjpeg: 8c-2ubuntu8 libjpeg-turbo: 2.0.3-0ubuntu1.20.04.3

I'm not using docker, I'm using the git version

rcalpha commented 5 months ago

I installed on a brand new ubuntu server 22.04.4 netbox, migrated the data and it's working.... There is issue with ubuntu 20.04.6 with python 3 installed by another way. ubuntu 20.04.6 doesn't have supported python3 version required by netbox

cruse1977 commented 5 months ago

Thanks for doing this and it fits what I think is happening with rocky. Rocky's python version is 3.9 which is unsupported netbox 4. I have a feeling the non os distro python being installed on these rocky instances is causing the problem. It has to be that or a minimal installation or similar.

On Fri, 21 Jun 2024, 00:52 Ruben Cheng, @.***> wrote:

I installed on a brand new ubuntu server 22.04.4 netbox, migrated the data and it's working.... There is issue with ubuntu 20.04.6 with python 3 installed by another way. ubuntu 20.04.6 doesn't have supported python3 version required by netbox

— Reply to this email directly, view it on GitHub https://github.com/netbox-community/netbox-qrcode/issues/75#issuecomment-2181741166, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKJY366RI75TNUFISGGGOLZINTLXAVCNFSM6AAAAABJEVOTMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBRG42DCMJWGY . You are receiving this because you were assigned.Message ID: @.***>

brourk commented 4 months ago

I had this problem on AlmaLinux 8.10 after installing python 3.12 and Netbox 4.06. I think the problem may be that pkg_resources (netbox_qrcode/utilities.py) is deprecated and removed in Python 3.12. What fixed it for me was "pip install setuptools" and restart netbox.

cruse1977 commented 4 months ago

thanks @brourk ; @rcalpha @supertasksupertask @HomerJaySimpson13 - can you try this fix as above please ?

I'll look at replacing pkg_resources with importlib for a future version

HomerJaySimpson13 commented 4 months ago

i just ran the pip install setuptools and it fixed it.

Thanks everyone for helping out!

harryajc commented 3 months ago

Was having this issue on Ubuntu 24.04, with netbox 4.0.9, "pip install setuptools" fixed the issue

MisterProblems commented 2 months ago

I had this problem on AlmaLinux 8.10 after installing python 3.12 and Netbox 4.06. I think the problem may be that pkg_resources (netbox_qrcode/utilities.py) is deprecated and removed in Python 3.12. What fixed it for me was "pip install setuptools" and restart netbox.

Thanks ! It works for me. (python 3.12 , netbox 4.0.9)

k01ek commented 2 months ago

may be we just need to include setuptools to install_requires