[GH-ISSUE #1707] Bug: Cannot login with user created from web GUI #4036

Closed
opened 2026-03-15 01:21:47 +03:00 by kerem · 3 comments
Owner

Originally created by @larsony99 on GitHub (Oct 19, 2025).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1707

Originally assigned to: @pirate on GitHub.

Provide a screenshot and describe the bug

When I try to add a user via the web GUI, it allows me to add the user successfully, but when I try to login with the new user and the credentials I created, it gives an error "Please enter the correct username and password for a staff account. Note that both fields may be case-sensitive."

Image Image

Steps to reproduce

1. Installed archivebox on Proxmox using the Community Script (bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/archivebox.sh)")
2. Accessed the web GUI at http://[my local IP]:8000/admin/login
3. Logged in with the default credentials (https://community-scripts.github.io/ProxmoxVE/scripts?id=archivebox)
4. Navigated to the add user page (http://[my local ip]:8000/admin/auth/user/add/)
5. Added user "myuser" with (as an example) "mypassword" as the password; selected superuser status and staff status.
6. I've tried it both with and without adding First/Last name and email address.
7. Logout
8. Try to login with these exact credentials, and I receive the error above.

Logs or errors

This is the file located at /opt/archivebox/data/logs/errors.log:

> /usr/local/bin/archivebox server 0.0.0.0:8000; TS=2025-10-19__04:04:49 VERSION=0.7.2 IN_DOCKER=False IS_TTY=False

> /usr/local/bin/archivebox server 0.0.0.0:8000; TS=2025-10-19__04:04:49 VERSION=0.7.2 IN_DOCKER=False IS_TTY=False

ArchiveBox Version

0.7.2
ArchiveBox v0.7.2 BUILD_TIME=2025-10-19 00:04:20 1760846660
IN_DOCKER=False IN_QEMU=False ARCH=x86_64 OS=Linux PLATFORM=Linux-6.14.11-4-pve-x86_64-with-glibc2.36 PYTHON=Cpython
FS_ATOMIC=True FS_REMOTE=False FS_USER=0:0 FS_PERMS=644
DEBUG=False IS_TTY=True TZ=UTC SEARCH_BACKEND=ripgrep LDAP=False

[i] Dependency versions:
 √  PYTHON_BINARY         v3.11.2         valid     /usr/bin/python3.11                                                         
 √  SQLITE_BINARY         v2.6.0          valid     /usr/lib/python3.11/sqlite3/dbapi2.py                                       
 √  DJANGO_BINARY         v3.1.14         valid     /usr/local/lib/python3.11/dist-packages/django/__init__.py                  
 √  ARCHIVEBOX_BINARY     v0.7.2          valid     /usr/local/bin/archivebox                                                   

 √  CURL_BINARY           v7.88.1         valid     /usr/bin/curl                                                               
 √  WGET_BINARY           v1.21.3         valid     /usr/bin/wget                                                               
 √  NODE_BINARY           v22.20.0        valid     /usr/bin/node                                                               
 √  SINGLEFILE_BINARY     v1.1.54         valid     ./node_modules/single-file-cli/single-file                                  
 √  READABILITY_BINARY    v0.0.11         valid     ./node_modules/readability-extractor/readability-extractor                  
 √  MERCURY_BINARY        v1.0.0          valid     ./node_modules/@postlight/parser/cli.js                                     
 √  GIT_BINARY            v2.39.5         valid     /usr/bin/git                                                                
 √  YOUTUBEDL_BINARY      v2025.10.14     valid     /usr/local/bin/yt-dlp                                                       
 √  CHROME_BINARY         v140.0.7339.16  valid     /home/archivebox/.cache/ms-playwright/chromium-1187/chrome-linux/chrome     
 √  RIPGREP_BINARY        v13.0.0         valid     /usr/bin/rg                                                                 

[i] Source-code locations:
 √  PACKAGE_DIR           23 files        valid     /usr/local/lib/python3.11/dist-packages/archivebox                          
 √  TEMPLATES_DIR         3 files         valid     /usr/local/lib/python3.11/dist-packages/archivebox/templates                
 -  CUSTOM_TEMPLATES_DIR  -               disabled  None                                                                        

[i] Secrets locations:
 -  CHROME_USER_DATA_DIR  -               disabled  None                                                                        
 -  COOKIES_FILE          -               disabled  None                                                                        

[i] Data locations:
 √  OUTPUT_DIR            6 files         valid     /opt/archivebox/data                                                        
 √  SOURCES_DIR           0 files         valid     ./sources                                                                   
 √  LOGS_DIR              1 files         valid     ./logs                                                                      
 √  ARCHIVE_DIR           0 files         valid     ./archive                                                                   
 √  CONFIG_FILE           190.0 Bytes     valid     ./ArchiveBox.conf                                                           
 √  SQL_INDEX             204.0 KB        valid     ./index.sqlite3

How did you install the version of ArchiveBox you are using?

Other

What operating system are you running on?

Other

What type of drive are you using to store your ArchiveBox data?

  • some of data/ is on a local SSD or NVMe drive
  • some of data/ is on a spinning hard drive or external USB drive
  • some of data/ is on a network mount (e.g. NFS/SMB/Ceph/GlusterFS/etc.)
  • some of data/ is on a FUSE mount (e.g. SSHFS/RClone/S3/B2/Google Drive/Dropbox/etc.)

Docker Compose Configuration


ArchiveBox Configuration

SECRET_KEY = [redacted]
[DEPENDENCY_CONFIG]
CHROME_BINARY = /home/archivebox/.cache/ms-playwright/chromium-1187/chrome-linux/chrome
Originally created by @larsony99 on GitHub (Oct 19, 2025). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1707 Originally assigned to: @pirate on GitHub. ### Provide a screenshot and describe the bug When I try to add a user via the web GUI, it allows me to add the user successfully, but when I try to login with the new user and the credentials I created, it gives an error "Please enter the correct username and password for a staff account. Note that both fields may be case-sensitive." <img width="1004" height="1102" alt="Image" src="https://github.com/user-attachments/assets/383b25dd-33b4-4e73-9d0a-4a423d2a3fe2" /> <img width="398" height="571" alt="Image" src="https://github.com/user-attachments/assets/99c03337-277c-423e-b4bd-e876320bf782" /> ### Steps to reproduce ```markdown 1. Installed archivebox on Proxmox using the Community Script (bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/archivebox.sh)") 2. Accessed the web GUI at http://[my local IP]:8000/admin/login 3. Logged in with the default credentials (https://community-scripts.github.io/ProxmoxVE/scripts?id=archivebox) 4. Navigated to the add user page (http://[my local ip]:8000/admin/auth/user/add/) 5. Added user "myuser" with (as an example) "mypassword" as the password; selected superuser status and staff status. 6. I've tried it both with and without adding First/Last name and email address. 7. Logout 8. Try to login with these exact credentials, and I receive the error above. ``` ### Logs or errors ```shell This is the file located at /opt/archivebox/data/logs/errors.log: > /usr/local/bin/archivebox server 0.0.0.0:8000; TS=2025-10-19__04:04:49 VERSION=0.7.2 IN_DOCKER=False IS_TTY=False > /usr/local/bin/archivebox server 0.0.0.0:8000; TS=2025-10-19__04:04:49 VERSION=0.7.2 IN_DOCKER=False IS_TTY=False ``` ### ArchiveBox Version ```shell 0.7.2 ArchiveBox v0.7.2 BUILD_TIME=2025-10-19 00:04:20 1760846660 IN_DOCKER=False IN_QEMU=False ARCH=x86_64 OS=Linux PLATFORM=Linux-6.14.11-4-pve-x86_64-with-glibc2.36 PYTHON=Cpython FS_ATOMIC=True FS_REMOTE=False FS_USER=0:0 FS_PERMS=644 DEBUG=False IS_TTY=True TZ=UTC SEARCH_BACKEND=ripgrep LDAP=False [i] Dependency versions: √ PYTHON_BINARY v3.11.2 valid /usr/bin/python3.11 √ SQLITE_BINARY v2.6.0 valid /usr/lib/python3.11/sqlite3/dbapi2.py √ DJANGO_BINARY v3.1.14 valid /usr/local/lib/python3.11/dist-packages/django/__init__.py √ ARCHIVEBOX_BINARY v0.7.2 valid /usr/local/bin/archivebox √ CURL_BINARY v7.88.1 valid /usr/bin/curl √ WGET_BINARY v1.21.3 valid /usr/bin/wget √ NODE_BINARY v22.20.0 valid /usr/bin/node √ SINGLEFILE_BINARY v1.1.54 valid ./node_modules/single-file-cli/single-file √ READABILITY_BINARY v0.0.11 valid ./node_modules/readability-extractor/readability-extractor √ MERCURY_BINARY v1.0.0 valid ./node_modules/@postlight/parser/cli.js √ GIT_BINARY v2.39.5 valid /usr/bin/git √ YOUTUBEDL_BINARY v2025.10.14 valid /usr/local/bin/yt-dlp √ CHROME_BINARY v140.0.7339.16 valid /home/archivebox/.cache/ms-playwright/chromium-1187/chrome-linux/chrome √ RIPGREP_BINARY v13.0.0 valid /usr/bin/rg [i] Source-code locations: √ PACKAGE_DIR 23 files valid /usr/local/lib/python3.11/dist-packages/archivebox √ TEMPLATES_DIR 3 files valid /usr/local/lib/python3.11/dist-packages/archivebox/templates - CUSTOM_TEMPLATES_DIR - disabled None [i] Secrets locations: - CHROME_USER_DATA_DIR - disabled None - COOKIES_FILE - disabled None [i] Data locations: √ OUTPUT_DIR 6 files valid /opt/archivebox/data √ SOURCES_DIR 0 files valid ./sources √ LOGS_DIR 1 files valid ./logs √ ARCHIVE_DIR 0 files valid ./archive √ CONFIG_FILE 190.0 Bytes valid ./ArchiveBox.conf √ SQL_INDEX 204.0 KB valid ./index.sqlite3 ``` ### How did you install the version of ArchiveBox you are using? Other ### What operating system are you running on? Other ### What type of drive are you using to store your ArchiveBox data? - [x] some of `data/` is on a local SSD or NVMe drive - [ ] some of `data/` is on a spinning hard drive or external USB drive - [ ] some of `data/` is on a network mount (e.g. NFS/SMB/Ceph/GlusterFS/etc.) - [ ] some of `data/` is on a FUSE mount (e.g. SSHFS/RClone/S3/B2/Google Drive/Dropbox/etc.) ### Docker Compose Configuration ```shell ``` ### ArchiveBox Configuration ```shell SECRET_KEY = [redacted] [DEPENDENCY_CONFIG] CHROME_BINARY = /home/archivebox/.cache/ms-playwright/chromium-1187/chrome-linux/chrome ```
kerem closed this issue 2026-03-15 01:21:53 +03:00
Author
Owner

@NR2014 commented on GitHub (Nov 22, 2025):

chatgpt help me fix this

Fix permissions (check manuals / consult others before running this , it helped me though)


chown -R 99:100 /mnt/user/appdata/ArchiveBox
chmod -R u+rwX,g+rwX /mnt/user/appdata/ArchiveBox

go into achievebox shell by running

docker exec -it --user=archivebox ArchiveBox bash

archivebox manage shell

and then this code (edit the username and password) , you can reuse the same password which you gave in admin webui portal.

from django.contrib.auth.models import User

u = User.objects.get(username="yourusername")
u.is_staff = True
u.is_superuser = True
u.set_password("NewPassword123")
u.save()
exit()

This helped me resolve the issue. I am now able to login with non-root id

<!-- gh-comment-id:3566129156 --> @NR2014 commented on GitHub (Nov 22, 2025): chatgpt help me fix this Fix permissions (check manuals / consult others before running this , it helped me though) ``` chown -R 99:100 /mnt/user/appdata/ArchiveBox chmod -R u+rwX,g+rwX /mnt/user/appdata/ArchiveBox ``` go into achievebox shell by running `docker exec -it --user=archivebox ArchiveBox bash` `archivebox manage shell` and then this code (edit the username and password) , you can reuse the same password which you gave in admin webui portal. ``` from django.contrib.auth.models import User u = User.objects.get(username="yourusername") u.is_staff = True u.is_superuser = True u.set_password("NewPassword123") u.save() exit() ``` This helped me resolve the issue. I am now able to login with non-root id
Author
Owner

@pirate commented on GitHub (Dec 29, 2025):

@claude can you implement these fixes on dev

<!-- gh-comment-id:3697604543 --> @pirate commented on GitHub (Dec 29, 2025): @claude can you implement these fixes on dev
Author
Owner

@claude[bot] commented on GitHub (Dec 29, 2025):

Claude finished @pirate's task in 3m 12s —— View jobclaude/issue-1707-20251229-2144Create PR ➔


Fix implemented for user login bug

Tasks

  • Read CLAUDE.md for repository guidelines
  • Locate user creation forms/views in codebase
  • Identify the root cause of the bug
  • Implement fix to ensure proper password hashing and permission flags
  • Commit and push changes
  • Provide PR creation link

Root Cause Identified

Found the bug! In archivebox/core/admin.py line 10:

from archivebox.core.admin_users import UserAdmin

This imports Django's default UserAdmin (which is re-exported from admin_users.py line 4), NOT the CustomUserAdmin class defined in admin_users.py line 9. This means all the custom admin logic was bypassed.

Additionally, CustomUserAdmin was modifying fieldsets to add custom readonly fields, but didn't explicitly preserve add_fieldsets. When fieldsets is customized without preserving add_fieldsets, Django may not properly handle the user creation form.

Fix Implemented

File: archivebox/core/admin.py

  • Changed import from UserAdmin to CustomUserAdmin
  • Changed registration to use CustomUserAdmin instead of UserAdmin

File: archivebox/core/admin_users.py

  • Explicitly set add_fieldsets = UserAdmin.add_fieldsets to preserve Django's default user creation behavior
  • Added comments explaining why this is necessary
  • This ensures passwords are properly hashed via Django's UserCreationForm and permissions are set correctly

Testing Recommendation

To verify the fix:

  1. Start ArchiveBox web server
  2. Navigate to the admin user creation page (/admin/auth/user/add/)
  3. Create a new user with staff and superuser permissions
  4. Log out and attempt to log in with the new user's credentials
  5. Login should now succeed

|

<!-- gh-comment-id:3697606292 --> @claude[bot] commented on GitHub (Dec 29, 2025): **Claude finished @pirate's task in 3m 12s** —— [View job](https://github.com/ArchiveBox/ArchiveBox/actions/runs/20583357469) • [`claude/issue-1707-20251229-2144`](https://github.com/ArchiveBox/ArchiveBox/tree/claude/issue-1707-20251229-2144) • [Create PR ➔](https://github.com/ArchiveBox/ArchiveBox/compare/dev...claude/issue-1707-20251229-2144?quick_pull=1&title=fix%3A%20Use%20CustomUserAdmin%20to%20fix%20user%20creation%20bug&body=%23%23%23%20Summary%0A%0AFixed%20the%20bug%20where%20users%20created%20via%20the%20web%20GUI%20cannot%20login.%0A%0A%23%23%23%20Root%20Cause%0A%0AThe%20issue%20was%20in%20%60archivebox/core/admin.py%60%20which%20imported%20and%20registered%20Django%27s%20default%20%60UserAdmin%60%20instead%20of%20the%20custom%20%60CustomUserAdmin%60%20class.%20This%20bypassed%20all%20custom%20admin%20logic.%20Additionally%2C%20%60CustomUserAdmin%60%20was%20modifying%20%60fieldsets%60%20without%20explicitly%20preserving%20%60add_fieldsets%60%2C%20which%20could%20cause%20Django%20to%20not%20properly%20handle%20the%20user%20creation%20form.%0A%0A%23%23%23%20Changes%0A%0A-%20Updated%20%60admin.py%60%20to%20import%20and%20register%20%60CustomUserAdmin%60%0A-%20Explicitly%20set%20%60add_fieldsets%60%20in%20%60CustomUserAdmin%60%20to%20preserve%20Django%27s%20default%20user%20creation%20behavior%0A-%20Added%20explanatory%20comments%0A%0A%23%23%23%20Testing%0A%0ATo%20verify%20the%20fix%3A%0A1.%20Start%20ArchiveBox%20web%20server%0A2.%20Navigate%20to%20the%20admin%20user%20creation%20page%20%28%60/admin/auth/user/add/%60%29%0A3.%20Create%20a%20new%20user%20with%20staff%20and%20superuser%20permissions%0A4.%20Log%20out%20and%20attempt%20to%20log%20in%20with%20the%20new%20user%27s%20credentials%0A5.%20Login%20should%20now%20succeed%0A%0AFixes%20%231707%0A%0AGenerated%20with%20%5BClaude%20Code%5D%28https%3A//claude.ai/code%29) --- ### Fix implemented for user login bug ### Tasks - [x] Read CLAUDE.md for repository guidelines - [x] Locate user creation forms/views in codebase - [x] Identify the root cause of the bug - [x] Implement fix to ensure proper password hashing and permission flags - [x] Commit and push changes - [x] Provide PR creation link ### Root Cause Identified Found the bug! In `archivebox/core/admin.py` line 10: ```python from archivebox.core.admin_users import UserAdmin ``` This imports Django's default `UserAdmin` (which is re-exported from `admin_users.py` line 4), NOT the `CustomUserAdmin` class defined in `admin_users.py` line 9. This means all the custom admin logic was bypassed. Additionally, `CustomUserAdmin` was modifying `fieldsets` to add custom readonly fields, but didn't explicitly preserve `add_fieldsets`. When `fieldsets` is customized without preserving `add_fieldsets`, Django may not properly handle the user creation form. ### Fix Implemented **File: `archivebox/core/admin.py`** - Changed import from `UserAdmin` to `CustomUserAdmin` - Changed registration to use `CustomUserAdmin` instead of `UserAdmin` **File: `archivebox/core/admin_users.py`** - Explicitly set `add_fieldsets = UserAdmin.add_fieldsets` to preserve Django's default user creation behavior - Added comments explaining why this is necessary - This ensures passwords are properly hashed via Django's `UserCreationForm` and permissions are set correctly ### Testing Recommendation To verify the fix: 1. Start ArchiveBox web server 2. Navigate to the admin user creation page (`/admin/auth/user/add/`) 3. Create a new user with staff and superuser permissions 4. Log out and attempt to log in with the new user's credentials 5. Login should now succeed --- |
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#4036
No description provided.