Skip to content

DEFAULT_USER_PREFERENCES.tables not applied on Reset or on anonymous dashboard #1057

@ybizeul

Description

@ybizeul

Current Behavior

Using the docker-compose method to deploy :

git clone https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
tee docker-compose.override.yml <<EOF
version: '3.4'
services:
  netbox:
    ports:
      - 8000:8080
EOF

Add extra configuration for DEFAULT_USER_PREFERENCES

vi configuration/extra.py
# Add on last line :
DEFAULT_USER_PREFERENCES = {"tables":{"DeviceTable":{"columns":["name","rack","device_role","manufacturer","device_type","primary_ip","comments"]}}}

Start the stack

docker compose up -d

docker compose exec netbox /opt/netbox/netbox/manage.py createsuperuser
🧬 loaded config '/etc/netbox/config/configuration.py'
🧬 loaded config '/etc/netbox/config/extra.py'
🧬 loaded config '/etc/netbox/config/logging.py'
🧬 loaded config '/etc/netbox/config/plugins.py'
Username (leave blank to use 'unit'): admin
Email address: admin@localhost
Password:
Password (again):
Superuser created successfully.

When I log in and go to devices, columns are according to DEFAULT_USER_PREFERENCES, see below:
image

Configure table show me this :
image

After Reset I get this :
image

Hence, Reset not reverting to DEFAULT_USER_PREFERENCES.

This has been reported on the main netbox repo and couldn't be reproduced on a direct install, there is probably something missing from docker configuration : netbox-community/netbox#13312

Expected Behavior

When reverting to default, it should apply DEFAULT_USER_PREFERENCES instead of applying stock netbox configuration

Docker Compose Version

Docker Compose version v2.20.2-desktop.1

Docker Version

Client:
 Version:           24.0.2-rd
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        e63f5fa
 Built:             Fri May 26 16:40:56 2023
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.22.0 (117440)
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.6
  Git commit:       a61e2b4
  Built:            Fri Jul 21 20:35:38 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

The git Revision

22486fe

The git Status

On branch release
Your branch is up to date with 'origin/release'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   configuration/extra.py

no changes added to commit (use "git add" and/or "git commit -a")

Startup Command

docker compose up

NetBox Logs

docker compose exec netbox /opt/netbox/netbox/manage.py createsuperuser
🧬 loaded config '/etc/netbox/config/configuration.py'
🧬 loaded config '/etc/netbox/config/extra.py'
🧬 loaded config '/etc/netbox/config/logging.py'
🧬 loaded config '/etc/netbox/config/plugins.py'
Username (leave blank to use 'unit'): admin
Email address: admin@localhost
Password:
Password (again):
Superuser created successfully.

Content of docker-compose.override.yml

version: '3.4'
services:
  netbox:
    ports:
      - 8000:8080

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions