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

Getting 500 uncaught exception error when clicking subscriptions button on homepage #191

Open
rec-email-gt opened this issue Jan 16, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@rec-email-gt
Copy link

Hi there,
Whenever I try to see my subscriptions via the subscriptions button at the homepage I get this "500 Uncaught exception" error with the following code:

Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lt/youtube-local/youtube/subscriptions.py", line 942, in get_subscriptions_page
videos, number_of_videos_in_db = _get_videos(cursor, 60, (page - 1)*60, tag)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lt/youtube-local/youtube/subscriptions.py", line 177, in _get_videos
'time_published': exact_timestamp(db_video[3]) if db_video[4] else posix_to_dumbed_down(db_video[3]),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lt/youtube-local/youtube/subscriptions.py", line 282, in posix_to_dumbed_down
delta = int(time.time() - posix_time)
~~~~~~~~~~~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'float' and 'str'

A few days ago it'd only happen after tagging and grouping a bunch of channels by tags in the subscription manager, but as of today it's started happening with no tags or grouping at all.

Thanks a lot in advance!
Cheers!

@user234683
Copy link
Owner

Can you add this before line 282 in /home/lt/youtube-local/youtube/subscriptions.py:
print(posix_time)
print(time.time())

@rec-email-gt
Copy link
Author

Hi there! Thanks for your response!
I just did what you suggested, but I'm still getting a very similar error under the same circumstances.
Here's the text of the current error in case there's any significant difference from the one I'd already shared further above:

Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lt/youtube-local/youtube/subscriptions.py", line 944, in get_subscriptions_page
videos, number_of_videos_in_db = _get_videos(cursor, 60, (page - 1)*60, tag)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lt/youtube-local/youtube/subscriptions.py", line 177, in _get_videos
'time_published': exact_timestamp(db_video[3]) if db_video[4] else posix_to_dumbed_down(db_video[3]),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lt/youtube-local/youtube/subscriptions.py", line 282, in posix_to_dumbed_down
print(posix_time)
OSError: [Errno 5] Input/output error

Thanks a bunch once again!!

@user234683
Copy link
Owner

How are you running it? Can you run this in a terminal? It appears there's no stdout available for the print statement to output to.

Should not be getting this unless there's nowhere for the output to go: "OSError: [Errno 5] Input/output error"

@user234683 user234683 added the bug Something isn't working label Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants