micahflee / semiphemeral

Automatically delete your old tweets, except for the ones you want to keep
MIT License
885 stars 85 forks source link

500 Internal Server Error with the self-hosted version while running configure #87

Closed shivangswain closed 2 years ago

shivangswain commented 3 years ago

Note: I have already used both the latest version of Tweepy and Tweepy v3.10.0.

⋊> ~ semiphemeral configure

semiphemeral 0.6
Load this website in a browser to configure semiphemeral, and press Ctrl-C when done
http://127.0.0.1:8080

 * Serving Flask app 'semiphemeral.web' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)
127.0.0.1 - - [17/Nov/2021 22:23:10] "GET / HTTP/1.1" 302 -
127.0.0.1 - - [17/Nov/2021 22:23:10] "GET /settings HTTP/1.1" 200 -
127.0.0.1 - - [17/Nov/2021 22:23:10] "GET /static/style.css HTTP/1.1" 304 -
127.0.0.1 - - [17/Nov/2021 22:23:10] "GET /static/js/lib/jquery-3.4.1.min.js HTTP/1.1" 304 -
127.0.0.1 - - [17/Nov/2021 22:23:10] "GET /static/js/base.js HTTP/1.1" 304 -
127.0.0.1 - - [17/Nov/2021 22:23:10] "GET /static/js/settings.js HTTP/1.1" 304 -
[2021-11-17 22:23:10,669] ERROR in app: Exception on /api/statistics [GET]
Traceback (most recent call last):
  File "/home/shivangswain/.local/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/shivangswain/.local/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/shivangswain/.local/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/shivangswain/.local/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/shivangswain/.local/lib/python3.9/site-packages/semiphemeral/web.py", line 143, in api_statistics
    return jsonify(common.get_stats())
  File "/home/shivangswain/.local/lib/python3.9/site-packages/semiphemeral/common.py", line 28, in get_stats
    int(self.settings.get("user_id"))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
127.0.0.1 - - [17/Nov/2021 22:23:10] "GET /api/statistics HTTP/1.1" 500 -

⋊> ~ lsb_release -a

No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye
kees commented 2 years ago

This should be fixed in PR #90 which will avoid trying to load stats if the twitter API settings haven't been configured.