Config Revisions return at the first occurrence when Netbox restarts
Deployment Type
Self-hosted
NetBox Version
v3.7.3
Python Version
3.11
Steps to Reproduce
- Create two Configuration revisons in Admin -> CONFIGURATION -> Config Revisions The second config is Active
- Restart Netbox The first confg is Active and the second config is Inactive
- I have to reactivate the latest version
Expected Behavior
When netbox restarts, I would like the last config to remain active.
Observed Behavior
It happened that the first config was activated when restarting Netbox and the second was deactivated.
I'm unable to reproduce this behavior.
- Restart Netbox
What exactly are you restarting? The current configuration version is stored in Redis, so if you're destroying the Redis database somehow then yes you'll lose the active configuration (along with any other cached data or queued jobs).
I forgot to mention that my netbox instance was installed on docker.
So to restart Netbox I do "docker-compose down && docker-compose up -d".
On older versions of Netbox I didn't have this problem.
Do you have a persistent volume attached to your redis instance? It seems to me that your redis is losing the applied revision
Yes.
# redis redis-reseau: image: redis:7-alpine container_name: redis-reseau restart: unless-stopped command: - sh - -c # this is to evaluate the $REDIS_PASSWORD from the env - redis-server --appendonly yes --requirepass FOOBAR env_file: ./env/redis.env volumes: - netbox-redis-data:/data
netbox-redis-data
Make this a bind mount or an external volume. It should then survive the destruction of the docker-compose project.
From the discussion above this appears to be related to the specific means of deployment and not something that can be addressed in NetBox itself. If means to reproduce this in NetBox natively can be identified, I'll be happy to reopen this issue.
We also run docker, and have done so for years without issues. We have upgraded out test/integrationtest and production environments from 3.4.10 to 3.7.5 the past three weeks. All of the environments behave in the same way! And we use persistent volumes, in this case also on different disks systems. It always default back to the first config revision after an restart of Netbox.
Now, as I understand it, Redis is involved here, but in what way? How is the configuration revision stored and read by Netbox when starting up?