iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
16.47k stars 1.86k forks source link

[Bug] Subscription to Playlist Fails with 'invalid byte sequence' error #4886

Closed DmitrySandalov closed 1 month ago

DmitrySandalov commented 3 months ago

Describe the bug

Subscription to Playlist Fails with 'invalid byte sequence' error

Steps to Reproduce

  1. Open the playlist at https://example.com/playlist?list=PL4_hYwCyhAvYwYRYQB1QwwwrqDrIgSMou
  2. Click +Subscribe button in the top right corner.

Expected:

Observed:

Logs

Title: invalid byte sequence for encoding "UTF8": 0xd0 (PQ::PQError) Date: 2024-08-28T17:46:50Z Route: /subscribe_playlist?list=PL4_hYwCyhAvYwYRYQB1QwwwrqDrIgSMou Version: 2024.08.26-4782a67 @ (HEAD detached at 4782a67)

Backtrace

``` invalid byte sequence for encoding "UTF8": 0xd0 (PQ::PQError) from lib/pg/src/pq/connection.cr:203:7 in 'handle_error' from lib/pg/src/pq/connection.cr:186:7 in 'handle_async_frames' from lib/pg/src/pq/connection.cr:162:7 in 'read' from lib/pg/src/pq/connection.cr:157:7 in 'read' from lib/pg/src/pq/connection.cr:414:31 in 'expect_frame' from lib/pg/src/pq/connection.cr:413:5 in 'expect_frame' from lib/pg/src/pg/statement.cr:19:5 in 'perform_query' from lib/pg/src/pg/statement.cr:35:14 in 'perform_exec' from lib/db/src/db/statement.cr:85:9 in 'perform_exec_and_release' from lib/db/src/db/statement.cr:70:7 in 'exec:args' from lib/db/src/db/pool_statement.cr:19:30 in 'exec:args' from lib/db/src/db/query_methods.cr:275:7 in 'exec:args' from src/invidious/database/playlists.cr:21:5 in 'insert' from src/invidious/playlists.cr:284:3 in 'subscribe_playlist' from src/invidious/routes/playlists.cr:76:5 in 'subscribe' from src/invidious/routing.cr:86:32 in '->' from lib/kemal/src/kemal/route.cr:12:26 in '->' from src/invidious/helpers/handlers.cr:30:37 in 'process_request' from lib/kemal/src/kemal/route_handler.cr:17:7 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from lib/kemal/src/kemal/websocket_handler.cr:13:14 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from lib/kemal/src/kemal/filter_handler.cr:21:7 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from src/invidious/helpers/handlers.cr:157:5 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from src/invidious/helpers/handlers.cr:94:12 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from src/invidious/helpers/handlers.cr:146:5 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from src/invidious/helpers/handlers.cr:70:5 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from src/ext/kemal_static_file_handler.cr:162:16 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from lib/kemal/src/kemal/exception_handler.cr:8:7 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from src/invidious/helpers/logger.cr:17:35 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from lib/kemal/src/kemal/init_handler.cr:12:7 in 'call' from /usr/share/crystal/src/http/server/request_processor.cr:51:11 in 'process' from /usr/share/crystal/src/http/server.cr:521:5 in 'handle_client' from /usr/share/crystal/src/http/server.cr:451:5 in '->' from /usr/share/crystal/src/fiber.cr:141:11 in 'run' from /usr/share/crystal/src/fiber.cr:93:34 in '->' from ??? ```

Screenshots

Additional context