Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

500 error while uploading a pdf #2313

Closed
konart opened this issue Feb 11, 2022 · 4 comments
Closed

500 error while uploading a pdf #2313

konart opened this issue Feb 11, 2022 · 4 comments

Comments

@konart
Copy link

konart commented Feb 11, 2022

Describe the bug/problem
Calibre-web fires a 500 http error while trying to upload a certain pdf file. The said file can be opened fine on macOS with the default Preview app. I also validated it with https://www.pdf-online.com/osa/validate.aspx Validation result is:

Document validated successfully.
--
The document does conform to the PDF 1.6 standard.

To Reproduce
Steps to reproduce the behavior:

  1. Go to main page
  2. Click on 'upload'
  3. Chose a pdf (not sure if I can provide the pdf in question here)
  4. See error

Trace

  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2073, in wsgi_app   
    response = self.full_dispatch_request()   
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/app/calibre-web/cps/usermanagement.py", line 38, in decorated_view
    return login_required(func)(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/flask_login/utils.py", line 272, in decorated_view
    return func(*args, **kwargs)        
  File "/app/calibre-web/cps/editbooks.py", line 65, in inner
    return f(*args, **kwargs)
  File "/app/calibre-web/cps/editbooks.py", line 1041, in upload
    db_book, input_authors, title_dir = create_book_on_upload(modif_date, meta)
  File "/app/calibre-web/cps/editbooks.py", line 963, in create_book_on_upload
    modif_date |= edit_book_tags(meta.tags, db_book)
  File "/app/calibre-web/cps/editbooks.py", line 442, in edit_book_tags
    input_tags = tags.split(',')
TypeError: a bytes-like object is required, not 'str'

Expected behavior
The pdf is uploaded without an error, user is redirected to the next page

Environment (please complete the following information):

  • OS: Linux 5.4.0-96-generic # 109-Ubuntu x86_64
  • Version: 0.6.16
  • Docker image: lscr.io/linuxserver/calibre-web:latest (source)
  • Browser: Edge 98.0.1108.43
@OzzieIsaacs
Copy link
Collaborator

I tried to figure out what the problem could be, but without the book in question I see no chance. Could you please send me the pdf file via private email (to the email account listed on my profile page)

@wgibcus
Copy link

wgibcus commented Mar 4, 2022

What language is the PDF?

@konart
Copy link
Author

konart commented Mar 9, 2022

First of all: sorry for the late reply.

The language is russian, but I don't think this was the problem as I have a number pdf's in russian.

Anyway - I've updated to 0.6.17 today and now the same pdf works well (uploading etc).

PS: I've send you an email with a pdf in question @OzzieIsaacs, just in case.

@OzzieIsaacs
Copy link
Collaborator

Duplicate of #2302.
I checked your book, it was the same problem as the above mentioned issue. So I consider this as solved

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

No branches or pull requests

3 participants