netbox icon indicating copy to clipboard operation
netbox copied to clipboard

psycopg[binary,pool] breaks s390x deployments

Open vmorris opened this issue 1 year ago • 2 comments

Deployment Type

Self-hosted

NetBox Version

v3.7.2

Python Version

3.8

Steps to Reproduce

Hello, This change in the requirements to use the binary psycopg breaks my deployment on s390x.

https://github.com/netbox-community/netbox/blob/develop/requirements.txt#L28

I modified my installation to use just psycopg[pool]==3.1.18 and it is working okay.. Is there any way that you can detect the architecture and not use the binary if it's not available?

Thanks for the awesome product, I really love netbox!

Expected Behavior

Installation of netbox works on s390x without modification to requirements.txt.

Observed Behavior

psycopg binary is unavailable for s390x architecture.

vmorris avatar Feb 19 '24 16:02 vmorris

This change in the requirements to use the binary psycopg breaks my deployment on s390x.

It would help to explain what s390x is. I had to Google it.

This one took some digging. We switched to the binary package of psycopg2 waaay back in NetBox v2.3. According to #1899, this was done because the wheel packages were being renamed.

From what I can glean from pip's documentation, we might be able to replace

psycopg[binary,pool]==3.1.18

with

psycopg[pool]==3.1.18 --prefer-binary=psycopg

to install the binary package where it's available and fall back to the pure Python build where it's not. However, now I'm wondering if we should be using the C package instead.

jeremystretch avatar Feb 20 '24 20:02 jeremystretch

It would help to explain what s390x is. I had to Google it.

Sorry! I'm too close to the problem, I know :D

I also wonder if the [c] option would be better.. I think this is similar to to what we had before, where we were building the psycopg2 binary every time.

vmorris avatar Feb 20 '24 22:02 vmorris

We've switched to the compiled (C) package beginning with NetBox v4.0.

jeremystretch avatar Mar 19 '24 12:03 jeremystretch