Cannot reference Region when creating a new Site #5659

Closed
opened 2025-12-29 19:30:47 +01:00 by adam · 11 comments
Owner

Originally created by @davama on GitHub (Nov 15, 2021).

NetBox version

v3.0.11

Python version

3.8.8

Steps to Reproduce

# setup brand new vm with rockylinux8
# gave it internet access via our proxy (http_proxy / https_proxy)
# configure yum.conf with proxy
sed -i 's/=enforcing/=disabled/' /etc/selinux/config 
dnf clean all
dnf update -y
reboot
# at this point i follow the netbox.readthedocs
sudo yum install -y postgresql-server
sudo postgresql-setup --initdb
# edit ident to md5
vi /var/lib/pgsql/data/pg_hba.conf
sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo -u postgres psql
CREATE DATABASE netbox;
CREATE USER netbox WITH PASSWORD 'netbox';
GRANT ALL PRIVILEGES ON DATABASE netbox TO netbox;
\q
sudo yum install -y redis
sudo systemctl start redis
sudo systemctl enable redis
# install python38
dnf install -y python38 
sudo yum install -y gcc libxml2-devel libxslt-devel libffi-devel libpq-devel openssl-devel redhat-rpm-config
pip3 install --upgrade pip
# clone the repo
sudo mkdir -p /opt/netbox/
cd /opt/netbox/
sudo yum install -y git
git clone -b master --depth 1 https://github.com/netbox-community/netbox.git .
git checkout master
git pull origin master
sudo groupadd --system netbox
sudo adduser --system -g netbox netbox
sudo chown --recursive netbox /opt/netbox/netbox/media/
cd /opt/netbox/netbox/netbox/
sudo cp configuration.example.py configuration.py
python3 ../generate_secret_key.py
# ALLOWED_HOSTS = ['*']  
# updated DATABASE with netbox/netbox credentials
# added SECRET_KEY
vi configuration.py 
/opt/netbox/upgrade.sh
source /opt/netbox/venv/bin/activate
cd /opt/netbox/netbox
python3 manage.py createsuperuser # create credentials admin/admin
sudo ln -s /opt/netbox/contrib/netbox-housekeeping.sh /etc/cron.daily/netbox-housekeeping
systemctl stop firewalld
python3 manage.py runserver 0.0.0.0:8000 --insecure
# access my URL http://10.x.x.x:8000/
# create a region called TEST
# attempt to create site under region TEST but 'No Results' comes up when typing TEST under Region field

Expected Behavior

I should be able to create the new Site under TEST Region.

Observed Behavior

I destroyed my vm and reran the steps above but with v2.11.12 instead, I have no issue creating my first region and creating my first site under said region.

Any input is much appreciated!

EDIT: updated this post, hopefully it's better now

Thank you,
Dave

Originally created by @davama on GitHub (Nov 15, 2021). ### NetBox version v3.0.11 ### Python version 3.8.8 ### Steps to Reproduce ``` # setup brand new vm with rockylinux8 # gave it internet access via our proxy (http_proxy / https_proxy) # configure yum.conf with proxy sed -i 's/=enforcing/=disabled/' /etc/selinux/config dnf clean all dnf update -y reboot # at this point i follow the netbox.readthedocs sudo yum install -y postgresql-server sudo postgresql-setup --initdb # edit ident to md5 vi /var/lib/pgsql/data/pg_hba.conf sudo systemctl start postgresql sudo systemctl enable postgresql sudo -u postgres psql CREATE DATABASE netbox; CREATE USER netbox WITH PASSWORD 'netbox'; GRANT ALL PRIVILEGES ON DATABASE netbox TO netbox; \q sudo yum install -y redis sudo systemctl start redis sudo systemctl enable redis # install python38 dnf install -y python38 sudo yum install -y gcc libxml2-devel libxslt-devel libffi-devel libpq-devel openssl-devel redhat-rpm-config pip3 install --upgrade pip # clone the repo sudo mkdir -p /opt/netbox/ cd /opt/netbox/ sudo yum install -y git git clone -b master --depth 1 https://github.com/netbox-community/netbox.git . git checkout master git pull origin master sudo groupadd --system netbox sudo adduser --system -g netbox netbox sudo chown --recursive netbox /opt/netbox/netbox/media/ cd /opt/netbox/netbox/netbox/ sudo cp configuration.example.py configuration.py python3 ../generate_secret_key.py # ALLOWED_HOSTS = ['*'] # updated DATABASE with netbox/netbox credentials # added SECRET_KEY vi configuration.py /opt/netbox/upgrade.sh source /opt/netbox/venv/bin/activate cd /opt/netbox/netbox python3 manage.py createsuperuser # create credentials admin/admin sudo ln -s /opt/netbox/contrib/netbox-housekeeping.sh /etc/cron.daily/netbox-housekeeping systemctl stop firewalld python3 manage.py runserver 0.0.0.0:8000 --insecure # access my URL http://10.x.x.x:8000/ # create a region called TEST # attempt to create site under region TEST but 'No Results' comes up when typing TEST under Region field ``` ### Expected Behavior I should be able to create the new Site under TEST Region. ### Observed Behavior I destroyed my vm and reran the steps above but with v2.11.12 instead, I have no issue creating my first region and creating my first site under said region. Any input is much appreciated! EDIT: updated this post, hopefully it's better now Thank you, Dave
adam closed this issue 2025-12-29 19:30:47 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 15, 2021):

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

@jeremystretch commented on GitHub (Nov 15, 2021): Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.
Author
Owner

@davama commented on GitHub (Nov 15, 2021):

thank you for the quick response!
going to try to reproduce on a clean install

@davama commented on GitHub (Nov 15, 2021): thank you for the quick response! going to try to reproduce on a clean install
Author
Owner

@davama commented on GitHub (Nov 15, 2021):

Ok, i dropped the postgres netbox db and recreated but as an empty db.
move /opt/netbox to /opt/netbox-3.0.10
and reinstalled using the read docs. https://netbox.readthedocs.io/en/stable/installation/ (using latest git master branch)
had no issues with python3 manage.py runserver 0.0.0.0:8000 --insecure
Added gunicorn and started via systemd

Under the netbox GUI:

  1. Created a new Region
  2. Attempted to created a new Site under said new region and got 'Not Results" ... :(
psql --version
psql (PostgreSQL) 10.15

I'll put a step by step of all the cmds I ran tomorrow

@davama commented on GitHub (Nov 15, 2021): Ok, i dropped the postgres `netbox` db and recreated but as an empty db. move `/opt/netbox` to `/opt/netbox-3.0.10` and reinstalled using the read docs. https://netbox.readthedocs.io/en/stable/installation/ (using latest git master branch) had no issues with `python3 manage.py runserver 0.0.0.0:8000 --insecure` Added gunicorn and started via systemd Under the netbox GUI: 1. Created a new Region 2. Attempted to created a new Site under said new region and got 'Not Results" ... :( ``` psql --version psql (PostgreSQL) 10.15 ``` I'll put a step by step of all the cmds I ran tomorrow
Author
Owner

@davama commented on GitHub (Nov 16, 2021):

Ok, was able to reproduce using these steps:

systemctl stop netbox netbox-rq
rm -rf /opt/netbox
sudo -u postgres psql -c 'drop database netbox'
sudo -u postgres psql -c 'create database netbox'
sudo -u postgres psql -c "CREATE USER netbox WITH PASSWORD 'netbox'"
sudo -u postgres psql -c 'GRANT ALL PRIVILEGES ON DATABASE netbox TO netbox'
sudo yum install -y gcc libxml2-devel libxslt-devel libffi-devel libpq-devel openssl-devel redhat-rpm-config
sudo pip3 install --upgrade pip
sudo mkdir -p /opt/netbox/
cd /opt/netbox/
sudo git clone -b master --depth 1 https://github.com/netbox-community/netbox.git .
cd /opt/netbox/netbox/netbox/
sudo cp configuration.example.py configuration.py
python3 ../generate_secret_key.py
sleep 10
# add db creds and key and ALLOWED_HOSTS = ['*']
vi configuration.py
sudo /opt/netbox/upgrade.sh
source /opt/netbox/venv/bin/activate
cd /opt/netbox/netbox
python3 manage.py createsuperuser
sudo cp /opt/netbox/contrib/gunicorn.py /opt/netbox/gunicorn.py
systemctl restart netbox netbox-rq
systemctl is-active netbox netbox-rq
  1. Then login as root/root
  2. Create 'MY-REGION`
  3. attempt to create a sub-region to 'my-region' called "my-subregion" but get "No Results" in parent...

@jeremystretch hope this helps. Please let me know if im missing anything

Will try to use a previous release to see if this also occurs. Will update

Thanks

@davama commented on GitHub (Nov 16, 2021): Ok, was able to reproduce using these steps: ``` systemctl stop netbox netbox-rq rm -rf /opt/netbox sudo -u postgres psql -c 'drop database netbox' sudo -u postgres psql -c 'create database netbox' sudo -u postgres psql -c "CREATE USER netbox WITH PASSWORD 'netbox'" sudo -u postgres psql -c 'GRANT ALL PRIVILEGES ON DATABASE netbox TO netbox' sudo yum install -y gcc libxml2-devel libxslt-devel libffi-devel libpq-devel openssl-devel redhat-rpm-config sudo pip3 install --upgrade pip sudo mkdir -p /opt/netbox/ cd /opt/netbox/ sudo git clone -b master --depth 1 https://github.com/netbox-community/netbox.git . cd /opt/netbox/netbox/netbox/ sudo cp configuration.example.py configuration.py python3 ../generate_secret_key.py sleep 10 # add db creds and key and ALLOWED_HOSTS = ['*'] vi configuration.py sudo /opt/netbox/upgrade.sh source /opt/netbox/venv/bin/activate cd /opt/netbox/netbox python3 manage.py createsuperuser sudo cp /opt/netbox/contrib/gunicorn.py /opt/netbox/gunicorn.py systemctl restart netbox netbox-rq systemctl is-active netbox netbox-rq ``` 1. Then login as root/root 2. Create 'MY-REGION` 3. attempt to create a sub-region to 'my-region' called "my-subregion" but get "No Results" in parent... @jeremystretch hope this helps. Please let me know if im missing anything Will try to use a previous release to see if this also occurs. Will update Thanks
Author
Owner

@davama commented on GitHub (Nov 16, 2021):

This is definitely a bug...

Tested with relase v3.0.9 and went all they way back until it worked on v2.11.12

v2.11.12-screenshot

Here is a screenshot of the behavior on all version from v3.0.10 to v3.0.0
issue-screenshot

@davama commented on GitHub (Nov 16, 2021): This is definitely a bug... Tested with relase v3.0.9 and went all they way back until it worked on v2.11.12 [v2.11.12-screenshot](https://imgur.com/a/BHzPgma) Here is a screenshot of the behavior on all version from v3.0.10 to v3.0.0 [issue-screenshot](https://imgur.com/a/iMqbtsv)
Author
Owner

@DanSheps commented on GitHub (Nov 17, 2021):

Can you recreate this on the demo netbox instance?

@DanSheps commented on GitHub (Nov 17, 2021): Can you recreate this on the demo netbox instance?
Author
Owner

@davama commented on GitHub (Dec 1, 2021):

Just to update:

I rebuild on a new vm using py3.8 and v3.0.11

Using:

Rocky Linux release 8.5 (Green Obsidian)
postgres (PostgreSQL) 10.17
Redis server v=5.0.3

I am able to manually create a region but then i still cannot assign a site to that region because it shows as No Results

@davama commented on GitHub (Dec 1, 2021): Just to update: I rebuild on a new vm using py3.8 and v3.0.11 Using: ``` Rocky Linux release 8.5 (Green Obsidian) postgres (PostgreSQL) 10.17 Redis server v=5.0.3 ``` I am able to manually create a region but then i still cannot assign a site to that region because it shows as `No Results`
Author
Owner

@jeremystretch commented on GitHub (Dec 1, 2021):

Thank you for opening a bug report. I was unable to reproduce the reported behavior on NetBox v3.0.11. 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.

@jeremystretch commented on GitHub (Dec 1, 2021): Thank you for opening a bug report. I was unable to reproduce the reported behavior on NetBox v3.0.11. 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.
Author
Owner

@davama commented on GitHub (Dec 3, 2021):

@jeremystretch
i've updated the original post.
Please let me know if i missed any information.
Thank you

@davama commented on GitHub (Dec 3, 2021): @jeremystretch i've updated the original post. Please let me know if i missed any information. Thank you
Author
Owner

@DanSheps commented on GitHub (Dec 3, 2021):

Unfortunately, this still cannot be recreated.

As asked, can you recreate this on the demo site?

@DanSheps commented on GitHub (Dec 3, 2021): Unfortunately, this still cannot be recreated. As asked, can you recreate this on the demo site?
Author
Owner

@davama commented on GitHub (Dec 3, 2021):

@DanSheps
I dont experience this issue on the demo site 😞
https://demo.netbox.dev/dcim/sites/26/

what could i be doing wrong?
Dont understand why i get "No Results"

@davama commented on GitHub (Dec 3, 2021): @DanSheps I dont experience this issue on the demo site :disappointed: https://demo.netbox.dev/dcim/sites/26/ what could i be doing wrong? Dont understand why i get "No Results"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5659