Error while viewing data in NetBox

240 views
Skip to first unread message

sajal tiwari

unread,
Sep 21, 2018, 3:53:57 AM9/21/18
to NetBox
Hello,
I have installed NetBox in HA for the first time, I installed Netbox separately on 2 VM's and then did a hot-standby replication of postgress.

[root@ ~]# python3 -V
Python 3.6.4

NetBox - v2.3.6

[root@ ~]# pip3 freeze
asn1crypto==0.24.0
bcrypt==3.1.4
cdiff==1.0
certifi==2018.8.24
cffi==1.11.5
chardet==3.0.4
click==6.7
coreapi==2.3.3
coreschema==0.0.4
cryptography==2.3.1
Django==1.11.15
django-cors-headers==2.4.0
django-debug-toolbar==1.10.1
django-filter==1.1.0
django-js-asset==1.1.0
django-mptt==0.9.1
django-tables2==2.0.1
django-timezone-field==2.1
djangorestframework==3.8.2
drf-yasg==1.10.2
flex==6.13.2
future==0.16.0
graphviz==0.9
gunicorn==19.9.0
idna==2.7
inflection==0.3.1
itypes==1.1.0
Jinja2==2.10
jsonpointer==1.14
jsonschema==2.6.0
junos-eznc==2.2.0
lxml==4.2.5
Markdown==2.6.11
MarkupSafe==1.0
napalm==2.3.2
natsort==5.4.1
ncclient==0.5.3
netaddr==0.7.18
netmiko==2.2.2
paramiko==2.4.1
Pillow==5.2.0
prettytable==0.7.2
psutil==5.4.7
psycopg2==2.7.5
psycopg2-binary==2.7.5
py-gfm==0.1.3
pyasn1==0.4.4
pycparser==2.18
pycryptodome==3.6.6
pyeapi==0.8.2
pyIOSXR==0.53
PyNaCl==1.2.1
pynxos==0.0.3
pyserial==3.4
python-dateutil==2.7.3
pytz==2018.5
PyYAML==3.13
requests==2.19.1
rfc3987==1.3.8
ruamel.yaml==0.15.66
scp==0.11.0
selectors2==2.0.1
six==1.11.0
sqlparse==0.2.4
strict-rfc3339==0.7
swagger-spec-validator==2.4.0
textfsm==0.4.1
tzlocal==1.5.1
uritemplate==3.0.0
urllib3==1.23
validate-email==1.3
xmltodict==0.11.0


Before bringing in HA both the application were working fine, but after enabling replication I am unable to view the data of master and getting below error. 


There was a problem with your request. Please contact an administrator.




The complete exception is provided below:
<class 'TypeError'>


__init__
() got an unexpected keyword argument 'klass'


If further assistance is required, please post to the NetBox mailing list.



On Master server, I can add data without any error. Similarly on Slave server i am getting below error which i think is because of replication settings. Does everyone has the same setup in 2 node VM or i am doing something wrong.


There was a problem with your request. Please contact an administrator.




The complete exception is provided below:
<class 'django.db.utils.InternalError'>


cannot execute INSERT
in a read-only transaction




If further assistance is required, please post to the NetBox mailing list.






sajal tiwari

unread,
Sep 21, 2018, 5:42:51 AM9/21/18
to NetBox
I resolved the slave issue by pointing the Slave Netbox server to the Master DB. Need help on the error i am getting for viewing any data.

rossm...@gmail.com

unread,
Sep 21, 2018, 7:49:43 AM9/21/18
to NetBox
You have to set login required to FALSE in the configuration.py file.

How is yours set?

Login needs to INSERT a value into the DB which it can't as the DB is read only.

Brian Candler

unread,
Sep 21, 2018, 5:36:08 PM9/21/18
to NetBox
Is there any particular reason for using an older version of Netbox (v2.3.6)?  If you're deploying a new cluster, I'd suggest you use the current version v2.4.4.

I suspect your problem is a bad python package.  From version 2.4 onwards, Netbox pins most of its dependencies to exact versions, making problems much less likely to occur when someone releases a new version of a package which is not backwards-compatible.

sajal tiwari

unread,
Sep 22, 2018, 6:30:51 AM9/22/18
to NetBox
Hello, The second issue of read-only DB was resolved by pointing it to the master DB, it seems in replication the slave DB goes into read-only mode.
Is it possible to read from read-only DB via changing the login to false?
Please let me know so i can try that one.

sajal tiwari

unread,
Sep 22, 2018, 6:32:31 AM9/22/18
to NetBox
I am using NetBox in different countries and want all those to be on the same version that's why i chose v2.3.6.
Any idea which python version is more suitable for v2.3.6 as i facing no issue in other standalone NetBox VM in other region.

Brian Candler

unread,
Sep 23, 2018, 4:43:00 AM9/23/18
to NetBox
> I am using NetBox in different countries and want all those to be on the same version that's why i chose v2.3.6.

This sort of thing use to happen frequently, which is why Netbox was changed to pin packages more precisely.

The options you have are:

1. Update all your Netbox instances to v2.4.4.  (This is what I would do).  There is a good chance that this in itself will fix the problem.  If not, you have some other underlying issue and you'll need to get a backtrace to find out which bit of code is raising that exception.

2. Take one of your working Netbox v2.3.6 instances and compare it with your broken v2.3.6 instance.  Look at the "pip3 list" output line by line, looking for any tiny difference.  Look at the OS-installed packages (dpkg-query -l or rpm -qa) and again look for any tiny differences.  Keep digging until you find the problem.

Some people run Netbox under docker, which I think is a good approach if you are managing multiple instances across multiple sites and want to keep them completely identical.

Regards,

Brian.

sajal tiwari

unread,
Sep 24, 2018, 1:07:55 PM9/24/18
to NetBox
Thank you Brian for your valuable suggestions,  I will upgrade it to the latest version and check.
Reply all
Reply to author
Forward
0 new messages