Login fails when BASE_PATH set #9268

Closed
opened 2025-12-29 20:47:41 +01:00 by adam · 3 comments
Owner

Originally created by @monsdar on GitHub (Feb 19, 2024).

Deployment Type

Self-hosted

NetBox Version

v3.7.2

Python Version

3.11

Steps to Reproduce

  1. Install netbox via Docker image netboxcommunity/netbox:v3.7.2-2.8.0
  • with BASE_PATH = 'netbox/'
  • with superuser admin
  1. Adjust config according to https://gist.github.com/Harry-Chen/032fef8b8ef0effd52b0cb6dd3fdf067
  2. Try to login with the local admin login.

Expected Behavior

User is logged in normally as admin

Observed Behavior

First time you click on the Log In button: you get the login page, and then you are returned to the front screen with a pop-up saying "Logged in as admin". However at this point you are still logged out, and the top-right button shows "Log In" rather than your username. Subsequent clicks of this button just refresh the screen, but you are still logged out.

This is the same error as in #10837 and I can see that the response cookies aren't showing the right path (as it was the case there as well):

  • messages has path=/
  • ✔csrftoken has path=/netbox
  • ✔sessionid has path=/netbox

However my settings.py looks correct (the issue had been fixed). I'm not sure where I need to change things in order for this to get fixed.

Originally created by @monsdar on GitHub (Feb 19, 2024). ### Deployment Type Self-hosted ### NetBox Version v3.7.2 ### Python Version 3.11 ### Steps to Reproduce 1. Install netbox via Docker image netboxcommunity/netbox:v3.7.2-2.8.0 * with BASE_PATH = 'netbox/' * with superuser admin 2. Adjust config according to https://gist.github.com/Harry-Chen/032fef8b8ef0effd52b0cb6dd3fdf067 3. Try to login with the local admin login. ### Expected Behavior User is logged in normally as admin ### Observed Behavior First time you click on the Log In button: you get the login page, and then you are returned to the front screen with a pop-up saying "Logged in as admin". However at this point you are still logged out, and the top-right button shows "Log In" rather than your username. Subsequent clicks of this button just refresh the screen, but you are still logged out. This is the same error as in #10837 and I can see that the response cookies aren't showing the right path (as it was the case there as well): - ❌messages has `path=/` - ✔csrftoken has `path=/netbox` - ✔sessionid has `path=/netbox` However my settings.py looks correct (the issue had been fixed). I'm not sure where I need to change things in order for this to get fixed.
adam closed this issue 2025-12-29 20:47:41 +01:00
Author
Owner

@julianstolp commented on GitHub (Feb 19, 2024):

I tried to reproduce this using v3.7.2 (non docker version), Python 3.10 and nginx but it worked as expected.

@julianstolp commented on GitHub (Feb 19, 2024): I tried to reproduce this using v3.7.2 (non docker version), Python 3.10 and nginx but it worked as expected.
Author
Owner

@monsdar commented on GitHub (Feb 19, 2024):

Guess it has to do with the way the Docker-image is set up then. There are a few differences already, most notably the missing BASE_PATH in the first place.

@monsdar commented on GitHub (Feb 19, 2024): Guess it has to do with the way the Docker-image is set up then. There are a few differences already, most notably the missing `BASE_PATH` in the first place.
Author
Owner

@jeremystretch commented on GitHub (Feb 20, 2024):

Please open bugs related to the Docker package under the netbox-docker repo.

@jeremystretch commented on GitHub (Feb 20, 2024): Please open bugs related to the Docker package under the [netbox-docker](https://github.com/netbox-community/netbox-docker) repo.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9268