running upgrade.sh on a fresh install fails with 'django.db.utils.ProgrammingError: operator does not exist: character varying >= integer' #3536

Closed
opened 2025-12-29 18:29:45 +01:00 by adam · 3 comments
Owner

Originally created by @austin987 on GitHub (Apr 3, 2020).

Environment

  • Python version: Python 3.6.10
  • NetBox version: 2.7.11
  • Postgresql version: 10

Steps to Reproduce

#!/bin/bash
set -e
set -x

postgresql="10"
release="2.7.11"

/etc/init.d/postgresql-${postgresql} stop zap

rm -rf /opt/netbox*
cd /opt || exit 1

# get package
wget -c https://github.com/netbox-community/netbox/archive/v${release}.tar.gz
tar xf v${release}.tar.gz
ln -sf netbox-${release} netbox

# setup symlinks for config files
ln -s /etc/netbox/gunicorn_config.py /opt/netbox/gunicorn_config.py
ln -s /etc/netbox/configuration.py /opt/netbox/netbox/netbox/configuration.py

cd /opt/netbox || exit 1

# postgresql (wipe/reinit)
rm -rf /var/lib/postgresql/${postgresql}/data
emerge --config dev-db/postgresql:${postgresql}
/etc/init.d/postgresql-${postgresql} restart
# Setup netbox users/roles
bash -x /usr/bin/initialize-netboxdb

# run upgrade.sh:
bash -x upgrade.sh

Expected Behavior

Netbox configuration finishes and is usable

Observed Behavior

Traceback from: django

Traceback (most recent call last):
  File "netbox/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped
    res = handle_func(*args, **kwargs)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/core/management/commands/migrate.py", line 234, in handle
    fake_initial=fake_initial,
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 245, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/migrations/migration.py", line 124, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/migrations/operations/fields.py", line 249, in database_forwards
    schema_editor.alter_field(from_model, from_field, to_field)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 535, in alter_field
    old_db_params, new_db_params, strict)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/postgresql/schema.py", line 124, in _alter_field
    new_db_params, strict,
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 685, in _alter_field
    params,
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 137, in execute
    cursor.execute(sql, params)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/cacheops/transaction.py", line 99, in execute
    result = self._no_monkey.execute(self, sql, params)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django_prometheus/db/common.py", line 67, in execute
    return super(CursorWrapper, self).execute(*args, **kwargs)
django.db.utils.ProgrammingError: operator does not exist: character varying >= integer
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

Extra info:
This worked with 2.6.8. I bisected the regression, which points to e09ad6915f#

I've reproduced this with 2.7.8 and 2.7.11. In addition, I tried all available stable postgresql versions in gentoo, but behavior was the same, so I don't think that's the issue:

dev-db/postgresql-10.9
dev-db/postgresql-11.4
dev-db/postgresql-11.6
dev-db/postgresql-11.7
dev-db/postgresql-12.1
dev-db/postgresql-9.4.22
dev-db/postgresql-9.4.25
dev-db/postgresql-9.5.17
dev-db/postgresql-9.5.18
dev-db/postgresql-9.5.20
dev-db/postgresql-9.6.13
dev-db/postgresql-9.6.14
dev-db/postgresql-9.6.16
dev-db/postgresql-9.6.17

Also attach the full output of the reproduction script (with set -x enabled) for reference:
netbox-2.7.11.txt

Originally created by @austin987 on GitHub (Apr 3, 2020). ### Environment * Python version: Python 3.6.10 * NetBox version: 2.7.11 * Postgresql version: 10 ### Steps to Reproduce ``` #!/bin/bash set -e set -x postgresql="10" release="2.7.11" /etc/init.d/postgresql-${postgresql} stop zap rm -rf /opt/netbox* cd /opt || exit 1 # get package wget -c https://github.com/netbox-community/netbox/archive/v${release}.tar.gz tar xf v${release}.tar.gz ln -sf netbox-${release} netbox # setup symlinks for config files ln -s /etc/netbox/gunicorn_config.py /opt/netbox/gunicorn_config.py ln -s /etc/netbox/configuration.py /opt/netbox/netbox/netbox/configuration.py cd /opt/netbox || exit 1 # postgresql (wipe/reinit) rm -rf /var/lib/postgresql/${postgresql}/data emerge --config dev-db/postgresql:${postgresql} /etc/init.d/postgresql-${postgresql} restart # Setup netbox users/roles bash -x /usr/bin/initialize-netboxdb # run upgrade.sh: bash -x upgrade.sh ``` ### Expected Behavior Netbox configuration finishes and is usable ### Observed Behavior Traceback from: django ``` Traceback (most recent call last): File "netbox/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv self.execute(*args, **cmd_options) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 364, in execute output = self.handle(*args, **options) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped res = handle_func(*args, **kwargs) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/core/management/commands/migrate.py", line 234, in handle fake_initial=fake_initial, File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 245, in apply_migration state = migration.apply(state, schema_editor) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/migrations/migration.py", line 124, in apply operation.database_forwards(self.app_label, schema_editor, old_state, project_state) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/migrations/operations/fields.py", line 249, in database_forwards schema_editor.alter_field(from_model, from_field, to_field) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 535, in alter_field old_db_params, new_db_params, strict) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/postgresql/schema.py", line 124, in _alter_field new_db_params, strict, File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 685, in _alter_field params, File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 137, in execute cursor.execute(sql, params) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/cacheops/transaction.py", line 99, in execute result = self._no_monkey.execute(self, sql, params) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers return executor(sql, params, many, context) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/utils.py", line 89, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/opt/netbox-2.7.11/venv/lib64/python3.6/site-packages/django_prometheus/db/common.py", line 67, in execute return super(CursorWrapper, self).execute(*args, **kwargs) django.db.utils.ProgrammingError: operator does not exist: character varying >= integer HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. ``` Extra info: This worked with 2.6.8. I bisected the regression, which points to https://github.com/netbox-community/netbox/commit/e09ad6915fd1702b3e06592f3cdf30b601b9f346# I've reproduced this with 2.7.8 and 2.7.11. In addition, I tried all available stable postgresql versions in gentoo, but behavior was the same, so I don't think that's the issue: ``` dev-db/postgresql-10.9 dev-db/postgresql-11.4 dev-db/postgresql-11.6 dev-db/postgresql-11.7 dev-db/postgresql-12.1 dev-db/postgresql-9.4.22 dev-db/postgresql-9.4.25 dev-db/postgresql-9.5.17 dev-db/postgresql-9.5.18 dev-db/postgresql-9.5.20 dev-db/postgresql-9.6.13 dev-db/postgresql-9.6.14 dev-db/postgresql-9.6.16 dev-db/postgresql-9.6.17 ``` Also attach the full output of the reproduction script (with set -x enabled) for reference: [netbox-2.7.11.txt](https://github.com/netbox-community/netbox/files/4423978/netbox-2.7.11.txt)
adam closed this issue 2025-12-29 18:29:45 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 3, 2020):

The upgrade script is provided for upgrading an existing release only. New installations must be performed according to the installation documentation.

@jeremystretch commented on GitHub (Apr 3, 2020): The upgrade script is provided for upgrading an existing release only. New installations must be performed according to the [installation documentation](https://netbox.readthedocs.io/en/stable/installation/).
Author
Owner

@austin987 commented on GitHub (Apr 6, 2020):

Both upgrade.sh and the full installation instructions fail the same way, both end up calling 'python3 manage.py migrate` [1] [2], which is where it fails. For reference, without upgrade.sh:

netbox1 ~ # time /home/austin/bootstrap-netbox 
+ postgresql=10
+ /etc/init.d/postgresql-10 stop zap
 * Stopping PostgreSQL 10 (this can take up to 92 seconds) ...                                                                                                                          [ ok ]
 * Manually resetting postgresql-10 to stopped state
+ /etc/init.d/netbox-conf stop zap
 * WARNING: netbox-conf is already stopped
 * Manually resetting netbox-conf to stopped state
+ /etc/init.d/netbox stop zap
 * WARNING: netbox is already stopped
 * Manually resetting netbox to stopped state
+ rm -rf /opt/netbox /opt/netbox-2.7.11 /root/netbox/venv
+ cd /opt
+ release=2.7.11
+ wget -c https://github.com/netbox-community/netbox/archive/v2.7.11.tar.gz
--2020-04-06 20:04:14--  https://github.com/netbox-community/netbox/archive/v2.7.11.tar.gz
Resolving github.com... 192.30.255.112
Connecting to github.com|192.30.255.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/netbox-community/netbox/tar.gz/v2.7.11 [following]
--2020-04-06 20:04:14--  https://codeload.github.com/netbox-community/netbox/tar.gz/v2.7.11
Resolving codeload.github.com... 192.30.255.121
Connecting to codeload.github.com|192.30.255.121|:443... connected.
HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable

    The file is already fully retrieved; nothing to do.

+ tar xf v2.7.11.tar.gz
+ ln -sf netbox-2.7.11 netbox
+ ln -s /etc/netbox/gunicorn_config.py /opt/netbox/gunicorn_config.py
+ ln -s /etc/netbox/configuration.py /opt/netbox/netbox/netbox/configuration.py
+ cd /opt/netbox
+ cat
+ chmod +x /opt/netbox/pip-wrapper.sh
+ cat
+ chmod +x /etc/init.d/netbox
+ cat
+ chmod +x /opt/netbox/netbox/pip-rqworker-wrapper
+ cat
+ chmod +x /etc/init.d/netbox-rqworker
+ rm -rf /var/lib/postgresql/10/data
+ emerge --config dev-db/postgresql:10


Configuring pkg...

 * You can modify the paths and options passed to initdb by editing:
 *     /etc/conf.d/postgresql-10
 * 
 * Information on options that can be passed to initdb are found at:
 *     https://www.postgresql.org/docs/10/static/creating-cluster.html
 *     https://www.postgresql.org/docs/10/static/app-initdb.html
 * 
 * PG_INITDB_OPTS is currently set to:
 *     --encoding=UTF8
 * 
 * Configuration files will be installed to:
 *     /etc/postgresql-10/
 * 
 * The database cluster will be created in:
 *     /var/lib/postgresql/10/data
 * 
 * Continuing initialization in 5 seconds (Control-C to cancel) ...                                                                                                                    [ ok ]
 * Creating the data directory ...
 * Initializing the database ...
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locales
  COLLATE:  en_US.utf8
  CTYPE:    en_US.utf8
  MESSAGES: en_US.utf8
  MONETARY: en_US.utf8
  NUMERIC:  en_US.utf8
  TIME:     C.utf8
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/10/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... UTC
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /usr/lib64/postgresql-10/bin/pg_ctl -D /var/lib/postgresql/10/data -l logfile start

 * The autovacuum function, which was in contrib, has been moved to the main
 * PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled
 * by default. You can disable it in the cluster's:
 *     /etc/postgresql-10/postgresql.conf
 * 
 * The PostgreSQL server, by default, will log events to:
 *     /var/lib/postgresql/10/data/postmaster.log
 * 
 * You should use the '/etc/init.d/postgresql-10' script to run PostgreSQL
 * instead of 'pg_ctl'.

+ /etc/init.d/postgresql-10 restart
 * Caching service dependencies ...                                                                                                                                                     [ ok ]
 * /run/postgresql: correcting mode
 * Starting PostgreSQL 10 ...                                                                                                                                                           [ ok ]
+ /usr/bin/initialize-netboxdb
++ mktemp -d
+ tempdir=/tmp/tmp.oti55CEhve
+ trap 'rm -rf "${tempdir}"' EXIT
+ netbox_passwordfile=/etc/netbox/secrets/netboxuser.password
+ postgres_passwordfile=/etc/netbox/secrets/postgresuser.password
+ postgres_pgpassfile=/etc/netbox/secrets/postgresuser.pgpass
+ [[ ! -f /etc/netbox/secrets/postgresuser.password ]]
+ [[ ! -s /etc/netbox/secrets/postgresuser.password ]]
+ echo 'Setting postgres system password (not printing password):'
Setting postgres system password (not printing password):
+ set +x
New password: Retype new password: passwd: password updated successfully
+ [[ ! -f /etc/netbox/secrets/postgresuser.pgpass ]]
+ [[ ! -s /etc/netbox/secrets/postgresuser.pgpass ]]
+ export PGPASSFILE=/etc/netbox/secrets/postgresuser.pgpass
+ PGPASSFILE=/etc/netbox/secrets/postgresuser.pgpass
+ psql -lqt -U postgres
+ cut -d '|' -f 1
+ grep -qw netbox
+ psql -U postgres -c 'create database netbox with encoding '\''UTF8'\'';'
CREATE DATABASE
++ psql -U postgres -tAc 'SELECT 1 FROM pg_roles WHERE rolname='\''netbox'\'''
+ '[' '' '!=' 1 ']'
+ psql -U postgres -c 'DROP SCHEMA IF EXISTS public CASCADE;'
DROP SCHEMA
+ psql -U postgres -c 'create role netbox with createdb login;'
CREATE ROLE
+ psql -U postgres -c 'grant all privileges on database netbox to netbox;'
GRANT
+ psql -U postgres -c 'DROP SCHEMA IF EXISTS public CASCADE;' -d netbox
DROP SCHEMA
+ psql -U postgres -tAc 'CREATE SCHEMA AUTHORIZATION netbox;' -d netbox
CREATE SCHEMA
+ [[ ! -f /etc/netbox/secrets/netboxuser.password ]]
+ [[ ! -s /etc/netbox/secrets/netboxuser.password ]]
+ echo 'Setting netbox'\''s password: (not printing with set -x because of password'
Setting netbox's password: (not printing with set -x because of password
+ echo 'psql -U postgres -c "ALTER USER netbox WITH PASSWORD '\''password_here'\'';"'
psql -U postgres -c "ALTER USER netbox WITH PASSWORD 'password_here';"
+ set +x
ALTER ROLE
+ rm -rf /tmp/tmp.oti55CEhve
+ python3.6 -m venv /opt/netbox/venv
+ source /opt/netbox/venv/bin/activate
++ deactivate nondestructive
++ '[' -n '' ']'
++ '[' -n '' ']'
++ '[' -n /bin/bash -o -n '' ']'
++ hash -r
++ '[' -n '' ']'
++ unset VIRTUAL_ENV
++ '[' '!' nondestructive = nondestructive ']'
++ VIRTUAL_ENV=/opt/netbox/venv
++ export VIRTUAL_ENV
++ _OLD_VIRTUAL_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/9/bin
++ PATH=/opt/netbox/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/9/bin
++ export PATH
++ '[' -n '' ']'
++ '[' -z '' ']'
++ _OLD_VIRTUAL_PS1=
++ '[' 'x(venv) ' '!=' x ']'
++ PS1='(venv) '
++ export PS1
++ '[' -n /bin/bash -o -n '' ']'
++ hash -r
+ pip3 install -r requirements.txt
Collecting Django<2.3,>=2.2 (from -r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/af/d1/903cdbda68cd6ee74bf8ac7c86ffa04b2baf0254dfd6edeeafe4426c9c8b/Django-2.2.12-py3-none-any.whl
Collecting django-cacheops==4.2 (from -r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/c6/c9/6f2ff431ffe57f6e5bbecb41b21f01e0523fa4ff816cae1caa97025b65fb/django_cacheops-4.2-py2.py3-none-any.whl
Collecting django-cors-headers==3.2.1 (from -r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/19/4e/dd037bf42cc33d1d61e45b973507303afad14fc18bd36329ec8ab3673373/django_cors_headers-3.2.1-py3-none-any.whl
Collecting django-debug-toolbar==2.1 (from -r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/14/92/d923c1df1f927d5395438eb2dc0cab41084009fcaae13b4974eca1d821b2/django_debug_toolbar-2.1-py3-none-any.whl
Collecting django-filter==2.2.0 (from -r requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/0a/c9/acc63b687002afae8b5137afd6230d88c99411aa2daedf07fed3f0913516/django_filter-2.2.0-py3-none-any.whl
Collecting django-mptt==0.9.1 (from -r requirements.txt (line 6))
  Using cached https://files.pythonhosted.org/packages/46/ec/415a72ff8c41be0e00900941fad48b3c696fd1da7f8e8ac1e6abc59d8981/django_mptt-0.9.1-py2.py3-none-any.whl
Collecting django-pglocks==1.0.4 (from -r requirements.txt (line 7))
Collecting django-prometheus==1.1.0 (from -r requirements.txt (line 8))
  Using cached https://files.pythonhosted.org/packages/7b/ff/6484e583bf2ab678886961ed5b5d3cff9d7ee6c0c11571ae123375a4d2c3/django_prometheus-1.1.0-py3-none-any.whl
Collecting django-rq==2.2.0 (from -r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/a2/64/8bb8edab5af3b49fa81698ccb2013a03485bc9f7d8f0bd9d708425b27c6c/django_rq-2.2.0-py2.py3-none-any.whl
Collecting django-tables2==2.2.1 (from -r requirements.txt (line 10))
  Using cached https://files.pythonhosted.org/packages/91/5c/c6326c54cd5a539b752382371d6079ba9d6acb107cf9cc67894c7e2a2ae5/django_tables2-2.2.1-py2.py3-none-any.whl
Collecting django-taggit==1.2.0 (from -r requirements.txt (line 11))
  Using cached https://files.pythonhosted.org/packages/52/08/b7669250b0121ffd9c77c9017249caba8f112d7ff7b3a9fa0c39ca6755c8/django_taggit-1.2.0-py3-none-any.whl
Collecting django-taggit-serializer==0.1.7 (from -r requirements.txt (line 12))
Collecting django-timezone-field==4.0 (from -r requirements.txt (line 13))
  Using cached https://files.pythonhosted.org/packages/b3/23/ac06d9dcc9450b8ed51a7f861630b5ae4c1779c53401c83703fb87fbef39/django_timezone_field-4.0-py3-none-any.whl
Collecting djangorestframework==3.10.3 (from -r requirements.txt (line 14))
  Using cached https://files.pythonhosted.org/packages/33/8e/87a4e0025e3c4736c1dc728905b1b06a94968ce08de15304417acb40e374/djangorestframework-3.10.3-py3-none-any.whl
Collecting drf-yasg[validation]==1.17.0 (from -r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/27/48/9b121cee33d2ea6df64f14d2ad2d92b2e658b63ad006fe33a16505a12d51/drf_yasg-1.17.0-py2.py3-none-any.whl
Collecting gunicorn==20.0.4 (from -r requirements.txt (line 16))
  Using cached https://files.pythonhosted.org/packages/69/ca/926f7cd3a2014b16870086b2d0fdc84a9e49473c68a8dff8b57f7c156f43/gunicorn-20.0.4-py2.py3-none-any.whl
Collecting Jinja2==2.10.3 (from -r requirements.txt (line 17))
  Using cached https://files.pythonhosted.org/packages/65/e0/eb35e762802015cab1ccee04e8a277b03f1d8e53da3ec3106882ec42558b/Jinja2-2.10.3-py2.py3-none-any.whl
Collecting Markdown==3.2.1 (from -r requirements.txt (line 18))
  Using cached https://files.pythonhosted.org/packages/ab/c4/ba46d44855e6eb1770a12edace5a165a0c6de13349f592b9036257f3c3d3/Markdown-3.2.1-py2.py3-none-any.whl
Collecting netaddr==0.7.19 (from -r requirements.txt (line 19))
  Using cached https://files.pythonhosted.org/packages/ba/97/ce14451a9fd7bdb5a397abf99b24a1a6bb7a1a440b019bebd2e9a0dbec74/netaddr-0.7.19-py2.py3-none-any.whl
Collecting Pillow==7.0.0 (from -r requirements.txt (line 20))
  Using cached https://files.pythonhosted.org/packages/19/5e/23dcc0ce3cc2abe92efd3cd61d764bee6ccdf1b667a1fb566f45dc249953/Pillow-7.0.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting psycopg2-binary==2.8.4 (from -r requirements.txt (line 21))
  Using cached https://files.pythonhosted.org/packages/1e/c0/16303cef8d54fdcfae7be7880cf471f21449225687f61cc3be2a7ef4e6e5/psycopg2_binary-2.8.4-cp36-cp36m-manylinux1_x86_64.whl
Collecting pycryptodome==3.9.4 (from -r requirements.txt (line 22))
  Using cached https://files.pythonhosted.org/packages/93/79/30fb604bf82abbab621ecdbbca932d294e1d4cf95336bb3fc2b5871d297a/pycryptodome-3.9.4-cp36-cp36m-manylinux1_x86_64.whl
Collecting PyYAML==5.3 (from -r requirements.txt (line 23))
Collecting redis==3.3.11 (from -r requirements.txt (line 24))
  Using cached https://files.pythonhosted.org/packages/32/ae/28613a62eea0d53d3db3147f8715f90da07667e99baeedf1010eb400f8c0/redis-3.3.11-py2.py3-none-any.whl
Collecting svgwrite==1.3.1 (from -r requirements.txt (line 25))
  Using cached https://files.pythonhosted.org/packages/4f/2e/f36cfec1da6162055b884e6366074cff18475a9538559ceae0c0bc58e186/svgwrite-1.3.1-py2.py3-none-any.whl
Collecting sqlparse (from Django<2.3,>=2.2->-r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/85/ee/6e821932f413a5c4b76be9c5936e313e4fc626b33f16e027866e1d60f588/sqlparse-0.3.1-py2.py3-none-any.whl
Collecting pytz (from Django<2.3,>=2.2->-r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl
Collecting six>=1.4.0 (from django-cacheops==4.2->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Collecting funcy<2.0,>=1.8 (from django-cacheops==4.2->-r requirements.txt (line 2))
Collecting django-js-asset (from django-mptt==0.9.1->-r requirements.txt (line 6))
  Using cached https://files.pythonhosted.org/packages/aa/2d/98089cf51c8e83bc70723021390b94a3638a4a0ce30a47e2e70476b2095d/django_js_asset-1.2.2-py2.py3-none-any.whl
Collecting prometheus-client>=0.7 (from django-prometheus==1.1.0->-r requirements.txt (line 8))
Collecting rq>=1.0 (from django-rq==2.2.0->-r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/50/d5/5956980ef7151855892003e9fd8e525b4982b261867a53caa597158aa29d/rq-1.3.0-py2.py3-none-any.whl
Collecting inflection>=0.3.1 (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/52/c1/36be286d85dbd76527fb613527222a795d7c071da195fa916e7bf3cb03cb/inflection-0.4.0-py2.py3-none-any.whl
Collecting packaging (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/62/0a/34641d2bf5c917c96db0ded85ae4da25b6cd922d6b794648d4e7e07c88e5/packaging-20.3-py2.py3-none-any.whl
Collecting uritemplate>=3.0.0 (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/bf/0c/60d82c077998feb631608dca3cc1fe19ac074e772bf0c24cf409b977b815/uritemplate-3.0.1-py2.py3-none-any.whl
Collecting ruamel.yaml>=0.15.34 (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/a6/92/59af3e38227b9cc14520bf1e59516d99ceca53e3b8448094248171e9432b/ruamel.yaml-0.16.10-py2.py3-none-any.whl
Collecting coreapi>=2.3.3 (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/fc/3a/9dedaad22962770edd334222f2b3c3e7ad5e1c8cab1d6a7992c30329e2e5/coreapi-2.3.3-py2.py3-none-any.whl
Collecting coreschema>=0.0.4 (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
Collecting swagger-spec-validator>=2.1.0; extra == "validation" (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/bf/09/03a8d574d4a76a0ffee0a0b0430fb6ba9295dd48bb09ea73d1f3c67bb4b4/swagger_spec_validator-2.5.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools>=3.0 in ./venv/lib/python3.6/site-packages (from gunicorn==20.0.4->-r requirements.txt (line 16)) (40.6.2)
Collecting MarkupSafe>=0.23 (from Jinja2==2.10.3->-r requirements.txt (line 17))
  Using cached https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting pyparsing>=2.0.1 (from svgwrite==1.3.1->-r requirements.txt (line 25))
  Using cached https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl
Collecting click>=5.0 (from rq>=1.0->django-rq==2.2.0->-r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/dd/c0/4d8f43a9b16e289f36478422031b8a63b54b6ac3b1ba605d602f10dd54d6/click-7.1.1-py2.py3-none-any.whl
Collecting ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.9" (from ruamel.yaml>=0.15.34->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/53/77/4bcd63f362bcb6c8f4f06253c11f9772f64189bf08cf3f40c5ccbda9e561/ruamel.yaml.clib-0.2.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting requests (from coreapi>=2.3.3->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl
Collecting itypes (from coreapi>=2.3.3->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
Collecting jsonschema (from swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/c5/8f/51e89ce52a085483359217bc72cdbf6e75ee595d5b1d4b5ade40c7e018b8/jsonschema-3.2.0-py2.py3-none-any.whl
Collecting chardet<4,>=3.0.2 (from requests->coreapi>=2.3.3->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests->coreapi>=2.3.3->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/e8/74/6e4f91745020f967d09332bb2b8b9b10090957334692eb88ea4afe91b77f/urllib3-1.25.8-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests->coreapi>=2.3.3->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/57/2b/26e37a4b034800c960a00c4e1b3d9ca5d7014e983e6e729e33ea2f36426c/certifi-2020.4.5.1-py2.py3-none-any.whl
Collecting idna<3,>=2.5 (from requests->coreapi>=2.3.3->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl
Collecting attrs>=17.4.0 (from jsonschema->swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl
Collecting pyrsistent>=0.14.0 (from jsonschema->swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
Collecting importlib-metadata; python_version < "3.8" (from jsonschema->swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/ad/e4/891bfcaf868ccabc619942f27940c77a8a4b45fd8367098955bb7e152fb1/importlib_metadata-1.6.0-py2.py3-none-any.whl
Collecting zipp>=0.5 (from importlib-metadata; python_version < "3.8"->jsonschema->swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15))
  Using cached https://files.pythonhosted.org/packages/b2/34/bfcb43cc0ba81f527bc4f40ef41ba2ff4080e047acb0586b56b3d017ace4/zipp-3.1.0-py3-none-any.whl
Installing collected packages: sqlparse, pytz, Django, six, funcy, redis, django-cacheops, django-cors-headers, django-debug-toolbar, django-filter, django-js-asset, django-mptt, django-pglocks, prometheus-client, django-prometheus, click, rq, django-rq, django-tables2, django-taggit, django-taggit-serializer, django-timezone-field, djangorestframework, inflection, pyparsing, packaging, uritemplate, ruamel.yaml.clib, ruamel.yaml, chardet, urllib3, certifi, idna, requests, itypes, MarkupSafe, Jinja2, coreschema, coreapi, attrs, pyrsistent, zipp, importlib-metadata, jsonschema, PyYAML, swagger-spec-validator, drf-yasg, gunicorn, Markdown, netaddr, Pillow, psycopg2-binary, pycryptodome, svgwrite
Successfully installed Django-2.2.12 Jinja2-2.10.3 Markdown-3.2.1 MarkupSafe-1.1.1 Pillow-7.0.0 PyYAML-5.3 attrs-19.3.0 certifi-2020.4.5.1 chardet-3.0.4 click-7.1.1 coreapi-2.3.3 coreschema-0.0.4 django-cacheops-4.2 django-cors-headers-3.2.1 django-debug-toolbar-2.1 django-filter-2.2.0 django-js-asset-1.2.2 django-mptt-0.9.1 django-pglocks-1.0.4 django-prometheus-1.1.0 django-rq-2.2.0 django-tables2-2.2.1 django-taggit-1.2.0 django-taggit-serializer-0.1.7 django-timezone-field-4.0 djangorestframework-3.10.3 drf-yasg-1.17.0 funcy-1.14 gunicorn-20.0.4 idna-2.9 importlib-metadata-1.6.0 inflection-0.4.0 itypes-1.1.0 jsonschema-3.2.0 netaddr-0.7.19 packaging-20.3 prometheus-client-0.7.1 psycopg2-binary-2.8.4 pycryptodome-3.9.4 pyparsing-2.4.7 pyrsistent-0.16.0 pytz-2019.3 redis-3.3.11 requests-2.23.0 rq-1.3.0 ruamel.yaml-0.16.10 ruamel.yaml.clib-0.2.0 six-1.14.0 sqlparse-0.3.1 svgwrite-1.3.1 swagger-spec-validator-2.5.0 uritemplate-3.0.1 urllib3-1.25.8 zipp-3.1.0
You are using pip version 18.1, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
+ cd /opt/netbox/netbox
+ python3.6 manage.py migrate
Operations to perform:
  Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, secrets, sessions, taggit, tenancy, users, virtualization
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying auth.0010_alter_group_name_max_length... OK
  Applying auth.0011_update_proxy_permissions... OK
  Applying taggit.0001_initial... OK
  Applying taggit.0002_auto_20150616_2121... OK
  Applying tenancy.0001_initial_squashed_0005_change_logging... OK
  Applying dcim.0001_initial... OK
  Applying ipam.0001_initial... OK
  Applying dcim.0002_auto_20160622_1821... OK
  Applying extras.0001_initial_squashed_0013_objectchange... OK
  Applying ipam.0002_vrf_add_enforce_unique... OK
  Applying dcim.0003_auto_20160628_1721_squashed_0010_devicebay_installed_device_set_null... OK
  Applying ipam.0003_ipam_add_vlangroups_squashed_0011_rir_add_is_private... OK
  Applying dcim.0011_devicetype_part_number_squashed_0022_color_names_to_rgb... OK
  Applying ipam.0012_services_squashed_0018_remove_service_uniqueness_constraint... OK
  Applying dcim.0023_devicetype_comments_squashed_0043_device_component_name_lengths... OK
  Applying virtualization.0001_virtualization... OK
  Applying ipam.0019_virtualization_squashed_0020_ipaddress_add_role_carp... OK
  Applying dcim.0044_virtualization_squashed_0061_platform_napalm_args... OK
  Applying extras.0014_configcontexts_squashed_0019_tag_taggeditem... OK
  Applying dcim.0062_interface_mtu_squashed_0065_front_rear_ports... OK
  Applying circuits.0001_initial_squashed_0006_terminations... OK
  Applying dcim.0066_cables...
    Adding console connections... 0 cables created
    Adding power connections... 0 cables created
    Adding interface connections... 0 cables created
 OK
  Applying circuits.0007_circuit_add_description_squashed_0017_circuittype_description...
    Adding circuit terminations... 0 cables created
Traceback (most recent call last):
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django_prometheus/db/common.py", line 67, in execute
    return super(CursorWrapper, self).execute(*args, **kwargs)
psycopg2.errors.UndefinedFunction: operator does not exist: character varying >= integer
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped
    res = handle_func(*args, **kwargs)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/management/commands/migrate.py", line 234, in handle
    fake_initial=fake_initial,
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 245, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/migrations/migration.py", line 124, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/migrations/operations/fields.py", line 249, in database_forwards
    schema_editor.alter_field(from_model, from_field, to_field)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 535, in alter_field
    old_db_params, new_db_params, strict)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/postgresql/schema.py", line 124, in _alter_field
    new_db_params, strict,
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 685, in _alter_field
    params,
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 137, in execute
    cursor.execute(sql, params)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/cacheops/transaction.py", line 99, in execute
    result = self._no_monkey.execute(self, sql, params)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django_prometheus/db/common.py", line 67, in execute
    return super(CursorWrapper, self).execute(*args, **kwargs)
django.db.utils.ProgrammingError: operator does not exist: character varying >= integer
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

[1] https://github.com/netbox-community/netbox/blob/develop/upgrade.sh#L53
[2] https://netbox.readthedocs.io/en/stable/installation/3-netbox/

@austin987 commented on GitHub (Apr 6, 2020): Both `upgrade.sh` and the full installation instructions fail the same way, both end up calling 'python3 manage.py migrate` [1] [2], which is where it fails. For reference, without upgrade.sh: ``` netbox1 ~ # time /home/austin/bootstrap-netbox + postgresql=10 + /etc/init.d/postgresql-10 stop zap * Stopping PostgreSQL 10 (this can take up to 92 seconds) ... [ ok ] * Manually resetting postgresql-10 to stopped state + /etc/init.d/netbox-conf stop zap * WARNING: netbox-conf is already stopped * Manually resetting netbox-conf to stopped state + /etc/init.d/netbox stop zap * WARNING: netbox is already stopped * Manually resetting netbox to stopped state + rm -rf /opt/netbox /opt/netbox-2.7.11 /root/netbox/venv + cd /opt + release=2.7.11 + wget -c https://github.com/netbox-community/netbox/archive/v2.7.11.tar.gz --2020-04-06 20:04:14-- https://github.com/netbox-community/netbox/archive/v2.7.11.tar.gz Resolving github.com... 192.30.255.112 Connecting to github.com|192.30.255.112|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://codeload.github.com/netbox-community/netbox/tar.gz/v2.7.11 [following] --2020-04-06 20:04:14-- https://codeload.github.com/netbox-community/netbox/tar.gz/v2.7.11 Resolving codeload.github.com... 192.30.255.121 Connecting to codeload.github.com|192.30.255.121|:443... connected. HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable The file is already fully retrieved; nothing to do. + tar xf v2.7.11.tar.gz + ln -sf netbox-2.7.11 netbox + ln -s /etc/netbox/gunicorn_config.py /opt/netbox/gunicorn_config.py + ln -s /etc/netbox/configuration.py /opt/netbox/netbox/netbox/configuration.py + cd /opt/netbox + cat + chmod +x /opt/netbox/pip-wrapper.sh + cat + chmod +x /etc/init.d/netbox + cat + chmod +x /opt/netbox/netbox/pip-rqworker-wrapper + cat + chmod +x /etc/init.d/netbox-rqworker + rm -rf /var/lib/postgresql/10/data + emerge --config dev-db/postgresql:10 Configuring pkg... * You can modify the paths and options passed to initdb by editing: * /etc/conf.d/postgresql-10 * * Information on options that can be passed to initdb are found at: * https://www.postgresql.org/docs/10/static/creating-cluster.html * https://www.postgresql.org/docs/10/static/app-initdb.html * * PG_INITDB_OPTS is currently set to: * --encoding=UTF8 * * Configuration files will be installed to: * /etc/postgresql-10/ * * The database cluster will be created in: * /var/lib/postgresql/10/data * * Continuing initialization in 5 seconds (Control-C to cancel) ... [ ok ] * Creating the data directory ... * Initializing the database ... The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locales COLLATE: en_US.utf8 CTYPE: en_US.utf8 MESSAGES: en_US.utf8 MONETARY: en_US.utf8 NUMERIC: en_US.utf8 TIME: C.utf8 The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /var/lib/postgresql/10/data ... ok creating subdirectories ... ok selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default timezone ... UTC selecting dynamic shared memory implementation ... posix creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: /usr/lib64/postgresql-10/bin/pg_ctl -D /var/lib/postgresql/10/data -l logfile start * The autovacuum function, which was in contrib, has been moved to the main * PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled * by default. You can disable it in the cluster's: * /etc/postgresql-10/postgresql.conf * * The PostgreSQL server, by default, will log events to: * /var/lib/postgresql/10/data/postmaster.log * * You should use the '/etc/init.d/postgresql-10' script to run PostgreSQL * instead of 'pg_ctl'. + /etc/init.d/postgresql-10 restart * Caching service dependencies ... [ ok ] * /run/postgresql: correcting mode * Starting PostgreSQL 10 ... [ ok ] + /usr/bin/initialize-netboxdb ++ mktemp -d + tempdir=/tmp/tmp.oti55CEhve + trap 'rm -rf "${tempdir}"' EXIT + netbox_passwordfile=/etc/netbox/secrets/netboxuser.password + postgres_passwordfile=/etc/netbox/secrets/postgresuser.password + postgres_pgpassfile=/etc/netbox/secrets/postgresuser.pgpass + [[ ! -f /etc/netbox/secrets/postgresuser.password ]] + [[ ! -s /etc/netbox/secrets/postgresuser.password ]] + echo 'Setting postgres system password (not printing password):' Setting postgres system password (not printing password): + set +x New password: Retype new password: passwd: password updated successfully + [[ ! -f /etc/netbox/secrets/postgresuser.pgpass ]] + [[ ! -s /etc/netbox/secrets/postgresuser.pgpass ]] + export PGPASSFILE=/etc/netbox/secrets/postgresuser.pgpass + PGPASSFILE=/etc/netbox/secrets/postgresuser.pgpass + psql -lqt -U postgres + cut -d '|' -f 1 + grep -qw netbox + psql -U postgres -c 'create database netbox with encoding '\''UTF8'\'';' CREATE DATABASE ++ psql -U postgres -tAc 'SELECT 1 FROM pg_roles WHERE rolname='\''netbox'\''' + '[' '' '!=' 1 ']' + psql -U postgres -c 'DROP SCHEMA IF EXISTS public CASCADE;' DROP SCHEMA + psql -U postgres -c 'create role netbox with createdb login;' CREATE ROLE + psql -U postgres -c 'grant all privileges on database netbox to netbox;' GRANT + psql -U postgres -c 'DROP SCHEMA IF EXISTS public CASCADE;' -d netbox DROP SCHEMA + psql -U postgres -tAc 'CREATE SCHEMA AUTHORIZATION netbox;' -d netbox CREATE SCHEMA + [[ ! -f /etc/netbox/secrets/netboxuser.password ]] + [[ ! -s /etc/netbox/secrets/netboxuser.password ]] + echo 'Setting netbox'\''s password: (not printing with set -x because of password' Setting netbox's password: (not printing with set -x because of password + echo 'psql -U postgres -c "ALTER USER netbox WITH PASSWORD '\''password_here'\'';"' psql -U postgres -c "ALTER USER netbox WITH PASSWORD 'password_here';" + set +x ALTER ROLE + rm -rf /tmp/tmp.oti55CEhve + python3.6 -m venv /opt/netbox/venv + source /opt/netbox/venv/bin/activate ++ deactivate nondestructive ++ '[' -n '' ']' ++ '[' -n '' ']' ++ '[' -n /bin/bash -o -n '' ']' ++ hash -r ++ '[' -n '' ']' ++ unset VIRTUAL_ENV ++ '[' '!' nondestructive = nondestructive ']' ++ VIRTUAL_ENV=/opt/netbox/venv ++ export VIRTUAL_ENV ++ _OLD_VIRTUAL_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/9/bin ++ PATH=/opt/netbox/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/9/bin ++ export PATH ++ '[' -n '' ']' ++ '[' -z '' ']' ++ _OLD_VIRTUAL_PS1= ++ '[' 'x(venv) ' '!=' x ']' ++ PS1='(venv) ' ++ export PS1 ++ '[' -n /bin/bash -o -n '' ']' ++ hash -r + pip3 install -r requirements.txt Collecting Django<2.3,>=2.2 (from -r requirements.txt (line 1)) Using cached https://files.pythonhosted.org/packages/af/d1/903cdbda68cd6ee74bf8ac7c86ffa04b2baf0254dfd6edeeafe4426c9c8b/Django-2.2.12-py3-none-any.whl Collecting django-cacheops==4.2 (from -r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/c6/c9/6f2ff431ffe57f6e5bbecb41b21f01e0523fa4ff816cae1caa97025b65fb/django_cacheops-4.2-py2.py3-none-any.whl Collecting django-cors-headers==3.2.1 (from -r requirements.txt (line 3)) Using cached https://files.pythonhosted.org/packages/19/4e/dd037bf42cc33d1d61e45b973507303afad14fc18bd36329ec8ab3673373/django_cors_headers-3.2.1-py3-none-any.whl Collecting django-debug-toolbar==2.1 (from -r requirements.txt (line 4)) Using cached https://files.pythonhosted.org/packages/14/92/d923c1df1f927d5395438eb2dc0cab41084009fcaae13b4974eca1d821b2/django_debug_toolbar-2.1-py3-none-any.whl Collecting django-filter==2.2.0 (from -r requirements.txt (line 5)) Using cached https://files.pythonhosted.org/packages/0a/c9/acc63b687002afae8b5137afd6230d88c99411aa2daedf07fed3f0913516/django_filter-2.2.0-py3-none-any.whl Collecting django-mptt==0.9.1 (from -r requirements.txt (line 6)) Using cached https://files.pythonhosted.org/packages/46/ec/415a72ff8c41be0e00900941fad48b3c696fd1da7f8e8ac1e6abc59d8981/django_mptt-0.9.1-py2.py3-none-any.whl Collecting django-pglocks==1.0.4 (from -r requirements.txt (line 7)) Collecting django-prometheus==1.1.0 (from -r requirements.txt (line 8)) Using cached https://files.pythonhosted.org/packages/7b/ff/6484e583bf2ab678886961ed5b5d3cff9d7ee6c0c11571ae123375a4d2c3/django_prometheus-1.1.0-py3-none-any.whl Collecting django-rq==2.2.0 (from -r requirements.txt (line 9)) Using cached https://files.pythonhosted.org/packages/a2/64/8bb8edab5af3b49fa81698ccb2013a03485bc9f7d8f0bd9d708425b27c6c/django_rq-2.2.0-py2.py3-none-any.whl Collecting django-tables2==2.2.1 (from -r requirements.txt (line 10)) Using cached https://files.pythonhosted.org/packages/91/5c/c6326c54cd5a539b752382371d6079ba9d6acb107cf9cc67894c7e2a2ae5/django_tables2-2.2.1-py2.py3-none-any.whl Collecting django-taggit==1.2.0 (from -r requirements.txt (line 11)) Using cached https://files.pythonhosted.org/packages/52/08/b7669250b0121ffd9c77c9017249caba8f112d7ff7b3a9fa0c39ca6755c8/django_taggit-1.2.0-py3-none-any.whl Collecting django-taggit-serializer==0.1.7 (from -r requirements.txt (line 12)) Collecting django-timezone-field==4.0 (from -r requirements.txt (line 13)) Using cached https://files.pythonhosted.org/packages/b3/23/ac06d9dcc9450b8ed51a7f861630b5ae4c1779c53401c83703fb87fbef39/django_timezone_field-4.0-py3-none-any.whl Collecting djangorestframework==3.10.3 (from -r requirements.txt (line 14)) Using cached https://files.pythonhosted.org/packages/33/8e/87a4e0025e3c4736c1dc728905b1b06a94968ce08de15304417acb40e374/djangorestframework-3.10.3-py3-none-any.whl Collecting drf-yasg[validation]==1.17.0 (from -r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/27/48/9b121cee33d2ea6df64f14d2ad2d92b2e658b63ad006fe33a16505a12d51/drf_yasg-1.17.0-py2.py3-none-any.whl Collecting gunicorn==20.0.4 (from -r requirements.txt (line 16)) Using cached https://files.pythonhosted.org/packages/69/ca/926f7cd3a2014b16870086b2d0fdc84a9e49473c68a8dff8b57f7c156f43/gunicorn-20.0.4-py2.py3-none-any.whl Collecting Jinja2==2.10.3 (from -r requirements.txt (line 17)) Using cached https://files.pythonhosted.org/packages/65/e0/eb35e762802015cab1ccee04e8a277b03f1d8e53da3ec3106882ec42558b/Jinja2-2.10.3-py2.py3-none-any.whl Collecting Markdown==3.2.1 (from -r requirements.txt (line 18)) Using cached https://files.pythonhosted.org/packages/ab/c4/ba46d44855e6eb1770a12edace5a165a0c6de13349f592b9036257f3c3d3/Markdown-3.2.1-py2.py3-none-any.whl Collecting netaddr==0.7.19 (from -r requirements.txt (line 19)) Using cached https://files.pythonhosted.org/packages/ba/97/ce14451a9fd7bdb5a397abf99b24a1a6bb7a1a440b019bebd2e9a0dbec74/netaddr-0.7.19-py2.py3-none-any.whl Collecting Pillow==7.0.0 (from -r requirements.txt (line 20)) Using cached https://files.pythonhosted.org/packages/19/5e/23dcc0ce3cc2abe92efd3cd61d764bee6ccdf1b667a1fb566f45dc249953/Pillow-7.0.0-cp36-cp36m-manylinux1_x86_64.whl Collecting psycopg2-binary==2.8.4 (from -r requirements.txt (line 21)) Using cached https://files.pythonhosted.org/packages/1e/c0/16303cef8d54fdcfae7be7880cf471f21449225687f61cc3be2a7ef4e6e5/psycopg2_binary-2.8.4-cp36-cp36m-manylinux1_x86_64.whl Collecting pycryptodome==3.9.4 (from -r requirements.txt (line 22)) Using cached https://files.pythonhosted.org/packages/93/79/30fb604bf82abbab621ecdbbca932d294e1d4cf95336bb3fc2b5871d297a/pycryptodome-3.9.4-cp36-cp36m-manylinux1_x86_64.whl Collecting PyYAML==5.3 (from -r requirements.txt (line 23)) Collecting redis==3.3.11 (from -r requirements.txt (line 24)) Using cached https://files.pythonhosted.org/packages/32/ae/28613a62eea0d53d3db3147f8715f90da07667e99baeedf1010eb400f8c0/redis-3.3.11-py2.py3-none-any.whl Collecting svgwrite==1.3.1 (from -r requirements.txt (line 25)) Using cached https://files.pythonhosted.org/packages/4f/2e/f36cfec1da6162055b884e6366074cff18475a9538559ceae0c0bc58e186/svgwrite-1.3.1-py2.py3-none-any.whl Collecting sqlparse (from Django<2.3,>=2.2->-r requirements.txt (line 1)) Using cached https://files.pythonhosted.org/packages/85/ee/6e821932f413a5c4b76be9c5936e313e4fc626b33f16e027866e1d60f588/sqlparse-0.3.1-py2.py3-none-any.whl Collecting pytz (from Django<2.3,>=2.2->-r requirements.txt (line 1)) Using cached https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl Collecting six>=1.4.0 (from django-cacheops==4.2->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl Collecting funcy<2.0,>=1.8 (from django-cacheops==4.2->-r requirements.txt (line 2)) Collecting django-js-asset (from django-mptt==0.9.1->-r requirements.txt (line 6)) Using cached https://files.pythonhosted.org/packages/aa/2d/98089cf51c8e83bc70723021390b94a3638a4a0ce30a47e2e70476b2095d/django_js_asset-1.2.2-py2.py3-none-any.whl Collecting prometheus-client>=0.7 (from django-prometheus==1.1.0->-r requirements.txt (line 8)) Collecting rq>=1.0 (from django-rq==2.2.0->-r requirements.txt (line 9)) Using cached https://files.pythonhosted.org/packages/50/d5/5956980ef7151855892003e9fd8e525b4982b261867a53caa597158aa29d/rq-1.3.0-py2.py3-none-any.whl Collecting inflection>=0.3.1 (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/52/c1/36be286d85dbd76527fb613527222a795d7c071da195fa916e7bf3cb03cb/inflection-0.4.0-py2.py3-none-any.whl Collecting packaging (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/62/0a/34641d2bf5c917c96db0ded85ae4da25b6cd922d6b794648d4e7e07c88e5/packaging-20.3-py2.py3-none-any.whl Collecting uritemplate>=3.0.0 (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/bf/0c/60d82c077998feb631608dca3cc1fe19ac074e772bf0c24cf409b977b815/uritemplate-3.0.1-py2.py3-none-any.whl Collecting ruamel.yaml>=0.15.34 (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/a6/92/59af3e38227b9cc14520bf1e59516d99ceca53e3b8448094248171e9432b/ruamel.yaml-0.16.10-py2.py3-none-any.whl Collecting coreapi>=2.3.3 (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/fc/3a/9dedaad22962770edd334222f2b3c3e7ad5e1c8cab1d6a7992c30329e2e5/coreapi-2.3.3-py2.py3-none-any.whl Collecting coreschema>=0.0.4 (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Collecting swagger-spec-validator>=2.1.0; extra == "validation" (from drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/bf/09/03a8d574d4a76a0ffee0a0b0430fb6ba9295dd48bb09ea73d1f3c67bb4b4/swagger_spec_validator-2.5.0-py2.py3-none-any.whl Requirement already satisfied: setuptools>=3.0 in ./venv/lib/python3.6/site-packages (from gunicorn==20.0.4->-r requirements.txt (line 16)) (40.6.2) Collecting MarkupSafe>=0.23 (from Jinja2==2.10.3->-r requirements.txt (line 17)) Using cached https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl Collecting pyparsing>=2.0.1 (from svgwrite==1.3.1->-r requirements.txt (line 25)) Using cached https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl Collecting click>=5.0 (from rq>=1.0->django-rq==2.2.0->-r requirements.txt (line 9)) Using cached https://files.pythonhosted.org/packages/dd/c0/4d8f43a9b16e289f36478422031b8a63b54b6ac3b1ba605d602f10dd54d6/click-7.1.1-py2.py3-none-any.whl Collecting ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.9" (from ruamel.yaml>=0.15.34->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/53/77/4bcd63f362bcb6c8f4f06253c11f9772f64189bf08cf3f40c5ccbda9e561/ruamel.yaml.clib-0.2.0-cp36-cp36m-manylinux1_x86_64.whl Collecting requests (from coreapi>=2.3.3->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl Collecting itypes (from coreapi>=2.3.3->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Collecting jsonschema (from swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/c5/8f/51e89ce52a085483359217bc72cdbf6e75ee595d5b1d4b5ade40c7e018b8/jsonschema-3.2.0-py2.py3-none-any.whl Collecting chardet<4,>=3.0.2 (from requests->coreapi>=2.3.3->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests->coreapi>=2.3.3->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/e8/74/6e4f91745020f967d09332bb2b8b9b10090957334692eb88ea4afe91b77f/urllib3-1.25.8-py2.py3-none-any.whl Collecting certifi>=2017.4.17 (from requests->coreapi>=2.3.3->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/57/2b/26e37a4b034800c960a00c4e1b3d9ca5d7014e983e6e729e33ea2f36426c/certifi-2020.4.5.1-py2.py3-none-any.whl Collecting idna<3,>=2.5 (from requests->coreapi>=2.3.3->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl Collecting attrs>=17.4.0 (from jsonschema->swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl Collecting pyrsistent>=0.14.0 (from jsonschema->swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Collecting importlib-metadata; python_version < "3.8" (from jsonschema->swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/ad/e4/891bfcaf868ccabc619942f27940c77a8a4b45fd8367098955bb7e152fb1/importlib_metadata-1.6.0-py2.py3-none-any.whl Collecting zipp>=0.5 (from importlib-metadata; python_version < "3.8"->jsonschema->swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.17.0->-r requirements.txt (line 15)) Using cached https://files.pythonhosted.org/packages/b2/34/bfcb43cc0ba81f527bc4f40ef41ba2ff4080e047acb0586b56b3d017ace4/zipp-3.1.0-py3-none-any.whl Installing collected packages: sqlparse, pytz, Django, six, funcy, redis, django-cacheops, django-cors-headers, django-debug-toolbar, django-filter, django-js-asset, django-mptt, django-pglocks, prometheus-client, django-prometheus, click, rq, django-rq, django-tables2, django-taggit, django-taggit-serializer, django-timezone-field, djangorestframework, inflection, pyparsing, packaging, uritemplate, ruamel.yaml.clib, ruamel.yaml, chardet, urllib3, certifi, idna, requests, itypes, MarkupSafe, Jinja2, coreschema, coreapi, attrs, pyrsistent, zipp, importlib-metadata, jsonschema, PyYAML, swagger-spec-validator, drf-yasg, gunicorn, Markdown, netaddr, Pillow, psycopg2-binary, pycryptodome, svgwrite Successfully installed Django-2.2.12 Jinja2-2.10.3 Markdown-3.2.1 MarkupSafe-1.1.1 Pillow-7.0.0 PyYAML-5.3 attrs-19.3.0 certifi-2020.4.5.1 chardet-3.0.4 click-7.1.1 coreapi-2.3.3 coreschema-0.0.4 django-cacheops-4.2 django-cors-headers-3.2.1 django-debug-toolbar-2.1 django-filter-2.2.0 django-js-asset-1.2.2 django-mptt-0.9.1 django-pglocks-1.0.4 django-prometheus-1.1.0 django-rq-2.2.0 django-tables2-2.2.1 django-taggit-1.2.0 django-taggit-serializer-0.1.7 django-timezone-field-4.0 djangorestframework-3.10.3 drf-yasg-1.17.0 funcy-1.14 gunicorn-20.0.4 idna-2.9 importlib-metadata-1.6.0 inflection-0.4.0 itypes-1.1.0 jsonschema-3.2.0 netaddr-0.7.19 packaging-20.3 prometheus-client-0.7.1 psycopg2-binary-2.8.4 pycryptodome-3.9.4 pyparsing-2.4.7 pyrsistent-0.16.0 pytz-2019.3 redis-3.3.11 requests-2.23.0 rq-1.3.0 ruamel.yaml-0.16.10 ruamel.yaml.clib-0.2.0 six-1.14.0 sqlparse-0.3.1 svgwrite-1.3.1 swagger-spec-validator-2.5.0 uritemplate-3.0.1 urllib3-1.25.8 zipp-3.1.0 You are using pip version 18.1, however version 20.0.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command. + cd /opt/netbox/netbox + python3.6 manage.py migrate Operations to perform: Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, secrets, sessions, taggit, tenancy, users, virtualization Running migrations: Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying admin.0001_initial... OK Applying admin.0002_logentry_remove_auto_add... OK Applying admin.0003_logentry_add_action_flag_choices... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying auth.0007_alter_validators_add_error_messages... OK Applying auth.0008_alter_user_username_max_length... OK Applying auth.0009_alter_user_last_name_max_length... OK Applying auth.0010_alter_group_name_max_length... OK Applying auth.0011_update_proxy_permissions... OK Applying taggit.0001_initial... OK Applying taggit.0002_auto_20150616_2121... OK Applying tenancy.0001_initial_squashed_0005_change_logging... OK Applying dcim.0001_initial... OK Applying ipam.0001_initial... OK Applying dcim.0002_auto_20160622_1821... OK Applying extras.0001_initial_squashed_0013_objectchange... OK Applying ipam.0002_vrf_add_enforce_unique... OK Applying dcim.0003_auto_20160628_1721_squashed_0010_devicebay_installed_device_set_null... OK Applying ipam.0003_ipam_add_vlangroups_squashed_0011_rir_add_is_private... OK Applying dcim.0011_devicetype_part_number_squashed_0022_color_names_to_rgb... OK Applying ipam.0012_services_squashed_0018_remove_service_uniqueness_constraint... OK Applying dcim.0023_devicetype_comments_squashed_0043_device_component_name_lengths... OK Applying virtualization.0001_virtualization... OK Applying ipam.0019_virtualization_squashed_0020_ipaddress_add_role_carp... OK Applying dcim.0044_virtualization_squashed_0061_platform_napalm_args... OK Applying extras.0014_configcontexts_squashed_0019_tag_taggeditem... OK Applying dcim.0062_interface_mtu_squashed_0065_front_rear_ports... OK Applying circuits.0001_initial_squashed_0006_terminations... OK Applying dcim.0066_cables... Adding console connections... 0 cables created Adding power connections... 0 cables created Adding interface connections... 0 cables created OK Applying circuits.0007_circuit_add_description_squashed_0017_circuittype_description... Adding circuit terminations... 0 cables created Traceback (most recent call last): File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/opt/netbox/venv/lib64/python3.6/site-packages/django_prometheus/db/common.py", line 67, in execute return super(CursorWrapper, self).execute(*args, **kwargs) psycopg2.errors.UndefinedFunction: operator does not exist: character varying >= integer HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv self.execute(*args, **cmd_options) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 364, in execute output = self.handle(*args, **options) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped res = handle_func(*args, **kwargs) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/management/commands/migrate.py", line 234, in handle fake_initial=fake_initial, File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 245, in apply_migration state = migration.apply(state, schema_editor) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/migrations/migration.py", line 124, in apply operation.database_forwards(self.app_label, schema_editor, old_state, project_state) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/migrations/operations/fields.py", line 249, in database_forwards schema_editor.alter_field(from_model, from_field, to_field) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 535, in alter_field old_db_params, new_db_params, strict) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/postgresql/schema.py", line 124, in _alter_field new_db_params, strict, File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 685, in _alter_field params, File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 137, in execute cursor.execute(sql, params) File "/opt/netbox/venv/lib64/python3.6/site-packages/cacheops/transaction.py", line 99, in execute result = self._no_monkey.execute(self, sql, params) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers return executor(sql, params, many, context) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/utils.py", line 89, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/opt/netbox/venv/lib64/python3.6/site-packages/django_prometheus/db/common.py", line 67, in execute return super(CursorWrapper, self).execute(*args, **kwargs) django.db.utils.ProgrammingError: operator does not exist: character varying >= integer HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. ``` [1] https://github.com/netbox-community/netbox/blob/develop/upgrade.sh#L53 [2] https://netbox.readthedocs.io/en/stable/installation/3-netbox/
Author
Owner

@austin987 commented on GitHub (Apr 18, 2020):

For anyone else finding this, retesting with 2.8.0 worked for me, git bisect shows this was the fix:

01b9d1a4939bcf17cb2c37c6e65d619ffd1388f5 is the first bad commit
commit 01b9d1a4939bcf17cb2c37c6e65d619ffd1388f5
Author: Jeremy Stretch <stretch@packetlife.net>
Date:   Tue Feb 18 16:03:28 2020 -0500

    Closes #3848: Upgrade to Django 3.0

 netbox/dcim/migrations/0097_mptt.py | 28 ++++++++++++++++++++++++++++
 requirements.txt                    |  6 +++---
 2 files changed, 31 insertions(+), 3 deletions(-)
@austin987 commented on GitHub (Apr 18, 2020): For anyone else finding this, retesting with 2.8.0 worked for me, git bisect shows this was the fix: ``` 01b9d1a4939bcf17cb2c37c6e65d619ffd1388f5 is the first bad commit commit 01b9d1a4939bcf17cb2c37c6e65d619ffd1388f5 Author: Jeremy Stretch <stretch@packetlife.net> Date: Tue Feb 18 16:03:28 2020 -0500 Closes #3848: Upgrade to Django 3.0 netbox/dcim/migrations/0097_mptt.py | 28 ++++++++++++++++++++++++++++ requirements.txt | 6 +++--- 2 files changed, 31 insertions(+), 3 deletions(-) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3536