Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Server 500 error on EDIT USERS page #3190

Closed
MattMulhern opened this issue Oct 20, 2024 · 4 comments
Closed

Server 500 error on EDIT USERS page #3190

MattMulhern opened this issue Oct 20, 2024 · 4 comments

Comments

@MattMulhern
Copy link

Describe the bug/problem

Clicking on 'Edit Users' throes an exception

To Reproduce

Steps to reproduce the behavior:

  1. Go to admin settings
  2. Click on the 'EDIT USERS' button
  3. 500 server error page should be shown

Logfile

[2024-10-20 17:21:10,859] DEBUG {cps.updater:331} Stable version: {'version': '0.6.23'}
[2024-10-20 17:22:05,176] ERROR {cps:838} Exception on /admin/usertable [GET]
Traceback (most recent call last):
  File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/app/calibre-web/cps/usermanagement.py", line 111, in decorated_view
    return login_required(func)(*args, **kwargs)
  File "/app/calibre-web/cps/cw_login/utils.py", line 296, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "/app/calibre-web/cps/admin.py", line 98, in inner
    return f(*args, **kwargs)
  File "/app/calibre-web/cps/admin.py", line 308, in edit_user_table
    custom_values = calibre_db.session.query(db.cc_classes[config.config_restricted_column]).all()

Expected behavior

the edit users web page should be available.

Screenshots

image

Environment (please complete the following information):

  • Calibre-Web version: 0.6.23
  • Docker container: lscr.io/linuxserver/calibre-web:latest
> docker image ls |grep calibre-web
lscr.io/linuxserver/calibre-web     latest       ec7924c05be4   14 hours ago    785MB
  • Special Hardware: [e.g. Rasperry Pi Zero]
  • Browser: Firefox 131.0.3 (64-bit), Chrome Version 129.0.6668.101
@OzzieIsaacs
Copy link
Collaborator

The problem is related to custom columns in the calibre library and the "View Restrictions based on Calibre column" setting.What I would need to figure out the problem:

A1) Content of "View Restrictions based on Calibre column" (maybe editing the value, save and change it back will solve the problem for you, but not for anybody else)
or
A2) The app.db file (private email from my profile page)

+ (additionally!!!)

B1) A screenshot of the add custom columns screen from calibre:
grafik
or
B2) The content of the custom_column table from the metadata.db file you are using (some sqlite brwoser will show the content)-> my 2 screenshots are from different libraries:
grafik
or
B3):
The metadata.db file (private email from my profile page)

@MattMulhern
Copy link
Author

MattMulhern commented Oct 24, 2024

I've sent you the app.db and metadata.db files via email now.

So I checked custom columns in my calibre instance and added a new custom column and deleted it again (this is all before sending you the files) and the issue has disappeared.

I've no idea why that would have fixed this for me apologies, but if you want to close off the issue I don't mind :)

@OzzieIsaacs
Copy link
Collaborator

I could reproduce the issue. The only thing I can imagine is the following:

  • You created a custom column in calibre
  • You configured it for Visibility restrictions based on custom column
  • You deleted the column in calibre

In calibre-web there were checks missing to detect this case, in the newest nightly version a warning message is now displayed.

Thanks for reporting

@MattMulhern
Copy link
Author

Thank you again for looking into this!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants