GithubHelp home page GithubHelp logo

500 Internal Server Error about calibre-web HOT 9 CLOSED

janeczku avatar janeczku commented on April 19, 2024
500 Internal Server Error

from calibre-web.

Comments (9)

OzzieIsaacs avatar OzzieIsaacs commented on April 19, 2024 1

I can reproduce the error by downloading after using the newest version of flask-login:
ERROR:cps.web:Exception on / [GET]
Traceback (most recent call last):
File "C:\calibre-web\vendor\flask\app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "C:\calibre-web\vendor\flask\app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\calibre-web\vendor\flask\app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\calibre-web\vendor\flask\app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "C:\calibre-web\vendor\flask\app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "C:/calibre-web\cps\web.py", line 541, in index
return render_template('index.html', random=random, entries=entries, pagination=pagination, title=_(u"Latest Books"))
File "C:\calibre-web\vendor\flask\templating.py", line 128, in render_template
context, ctx.app)
File "C:\calibre-web\vendor\flask\templating.py", line 110, in _render
rv = template.render(context)
File "C:\calibre-web\vendor\jinja2\environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "C:\calibre-web\vendor\jinja2\environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\calibre-web\cps\templates\index.html", line 1, in top-level template code
{% extends "layout.html" %}
File "C:\calibre-web\cps\templates\layout.html", line 54, in top-level template code
{% if g.user.is_authenticated() or g.user.is_anonymous() %}
AttributeError: 'bool' object has no attribute 'call'
ERROR:tornado.access:500 GET / (127.0.0.1) 505.00ms

I try to look after it tomorrow.

from calibre-web.

cervinko avatar cervinko commented on April 19, 2024

Do you get this error when you are logged in to calibre-web or only as anonymous user?

Do you have flask-login installed on your system. if yes what version.

this could be related to miguelgrinberg/flasky#74 but this is just a first guess.

from calibre-web.

wonx avatar wonx commented on April 19, 2024

Sorry for the delay, for some reason I was expecting an email notification.
My error appears when using it as an anonymous user. I just changed the settings, and then the error is more similar to the one you pointed (TypeError: 'bool' object is not callable). The only way I've managed to enter my library is following this method: 1) enter http://url:port/feed. 2) enter login and password 3) enter http:/url:port. If I enter the library directly, I still got the same error.

I didn't have flask-login installed in my system. I just installed it via apt-get and got the 0.2.6-1 version. The problem still persists.

Edit: I also tried installing python-flask-login 0.32 (the latest one) using an Ubuntu deb. The problem still persists.

from calibre-web.

OzzieIsaacs avatar OzzieIsaacs commented on April 19, 2024

i remember an issue like this, caused by anonymous users. I fixed it, i can take a look at it later. Could you please try to switch anon user off and try it with activated user management

from calibre-web.

wonx avatar wonx commented on April 19, 2024

Yes. I'm currently using calibre-web with anon disabled.
Btw, just for the sake of completeness, this is the error message I get when anon user is disabled (in config.ini):

root@host:~/calibre-web-biblio# python cps.py
ERROR:cps.web:Exception on /login [GET]
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/root/calibre-web-psico/cps/web.py", line 625, in login
    if current_user is not None and current_user.is_authenticated():
TypeError: 'bool' object is not callable
ERROR:tornado.access:500 GET /login?next=%2F (188.xxx.xxx.xxx) 5.56ms

Notice how, in the browser, I'm being redirected to http://host:port/login?next=%2F

from calibre-web.

cervinko avatar cervinko commented on April 19, 2024

if this error only occurs with flask-login > 0.3.0 then everything is clear. flask-login changed is_authenticated to a property in UserMixin.
I think we should vendor the latest flask-login and adjust our code to it.

from calibre-web.

OzzieIsaacs avatar OzzieIsaacs commented on April 19, 2024

i can only reproduce it with a new flask-login version, otherwise it works for me

from calibre-web.

wonx avatar wonx commented on April 19, 2024

One temporary solution is downgrading the flask-login version.
pip uninstall flask-login (or apt-get remove python-flask-login if installed via apt-get)
pip install flask-login==0.2.11

I tried it and it works.

from calibre-web.

OzzieIsaacs avatar OzzieIsaacs commented on April 19, 2024

Updated flask-login

from calibre-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.