Invidious: Arch Linux error on starting dev server

Created on 25 Jul 2018  Â·  14Comments  Â·  Source: iv-org/invidious

Followed every step of the README.

Output:

🤖  Your SentryBot is vigilant. beep-boop...
🤖  watching file: ./src/invidious/helpers.cr
🤖  watching file: ./src/invidious.cr
🤖  watching file: ./src/invidious/views/search.ecr
🤖  watching file: ./src/invidious/views/subscription_manager.ecr
🤖  watching file: ./src/invidious/views/subscriptions.ecr
🤖  watching file: ./src/invidious/views/index.ecr
🤖  watching file: ./src/invidious/views/watch.ecr
🤖  watching file: ./src/invidious/views/login.ecr
🤖  watching file: ./src/invidious/views/channel.ecr
🤖  watching file: ./src/invidious/views/layout.ecr
🤖  watching file: ./src/invidious/views/error.ecr
🤖  watching file: ./src/invidious/views/components/subscription_video.ecr
🤖  watching file: ./src/invidious/views/components/video.ecr
🤖  watching file: ./src/invidious/views/preferences.ecr
🤖  watching file: ./src/invidious/views/embed.ecr
🤖  compiling invidious...
🤖  starting invidious...
[development] Kemal is ready to lead at http://0.0.0.0:3000
Unhandled exception in spawn:
Unsupported HTTP version: ��XL3������&��]|>���� (Exception)
  from /usr/lib/crystal/http/client/response.cr:126:5 in 'from_io?'
  from /usr/lib/crystal/http/client.cr:499:5 in 'exec_internal_single'
  from /usr/lib/crystal/http/client.cr:485:5 in 'exec_internal'
  from /usr/lib/crystal/http/client.cr:481:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:591:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:329:3 in 'get'
  from src/invidious/helpers.cr:238:12 in '->'
  from /usr/lib/crystal/fiber.cr:255:3 in 'run'
  from /usr/lib/crystal/fiber.cr:29:34 in '->'
  from ???
Unhandled exception in spawn:
SSL_read: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac (OpenSSL::SSL::Error)
  from /usr/lib/crystal/openssl/ssl/socket.cr:102:9 in 'unbuffered_read'
  from /usr/lib/crystal/io/buffered.cr:215:5 in 'fill_buffer'
  from /usr/lib/crystal/io/buffered.cr:89:7 in 'peek'
  from /usr/lib/crystal/http/content.cr:106:14 in 'peek'
  from /usr/lib/crystal/flate/reader.cr:66:17 in 'read'
  from /usr/lib/crystal/gzip/reader.cr:85:7 in 'read'
  from /usr/lib/crystal/io/encoding.cr:76:45 in 'read'
  from /usr/lib/crystal/io.cr:561:11 in 'gets_to_end'
  from /usr/lib/crystal/http/client/response.cr:73:15 in 'consume_body_io'
  from /usr/lib/crystal/http/client/response.cr:97:9 in 'from_io?'
  from /usr/lib/crystal/http/client.cr:499:5 in 'exec_internal_single'
  from /usr/lib/crystal/http/client.cr:485:5 in 'exec_internal'
  from /usr/lib/crystal/http/client.cr:481:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:591:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:329:3 in 'get'
  from src/invidious/helpers.cr:231:12 in '->'
  from /usr/lib/crystal/fiber.cr:255:3 in 'run'
  from /usr/lib/crystal/fiber.cr:29:34 in '->'
  from ???
Unhandled exception in spawn:
SSL_read: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac (OpenSSL::SSL::Error)
  from /usr/lib/crystal/openssl/ssl/socket.cr:102:9 in 'unbuffered_read'
  from /usr/lib/crystal/io/buffered.cr:215:5 in 'fill_buffer'
  from /usr/lib/crystal/io/buffered.cr:89:7 in 'peek'
  from /usr/lib/crystal/io.cr:645:37 in 'gets'
  from /usr/lib/crystal/io.cr:604:5 in 'gets'
  from /usr/lib/crystal/http/client/response.cr:119:12 in 'from_io?'
  from /usr/lib/crystal/http/client.cr:499:5 in 'exec_internal_single'
  from /usr/lib/crystal/http/client.cr:485:5 in 'exec_internal'
  from /usr/lib/crystal/http/client.cr:481:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:591:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:329:3 in 'get'
  from src/invidious/helpers.cr:238:12 in '->'
  from /usr/lib/crystal/fiber.cr:255:3 in 'run'
  from /usr/lib/crystal/fiber.cr:29:34 in '->'
  from ???
Unhandled exception in spawn:
Invalid HTTP chunked content: invalid chunk size (IO::Error)
  from /usr/lib/crystal/http/content.cr:162:31 in 'read_chunk_size'
  from /usr/lib/crystal/http/content.cr:136:7 in 'next_chunk'
  from /usr/lib/crystal/http/content.cr:104:7 in 'peek'
  from /usr/lib/crystal/flate/reader.cr:66:17 in 'read'
  from /usr/lib/crystal/gzip/reader.cr:85:7 in 'read'
  from /usr/lib/crystal/io/encoding.cr:76:45 in 'read'
  from /usr/lib/crystal/io.cr:561:11 in 'gets_to_end'
  from /usr/lib/crystal/http/client/response.cr:73:15 in 'consume_body_io'
  from /usr/lib/crystal/http/client/response.cr:97:9 in 'from_io?'
  from /usr/lib/crystal/http/client.cr:499:5 in 'exec_internal_single'
  from /usr/lib/crystal/http/client.cr:485:5 in 'exec_internal'
  from /usr/lib/crystal/http/client.cr:481:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:591:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:329:3 in 'get'
  from src/invidious/helpers.cr:231:12 in '->'
  from /usr/lib/crystal/fiber.cr:255:3 in 'run'
  from /usr/lib/crystal/fiber.cr:29:34 in '->'
  from ???
Unhandled exception in spawn:
Invalid HTTP response (Exception)
  from /usr/lib/crystal/http/client/response.cr:0:5 in 'from_io?'
  from /usr/lib/crystal/http/client.cr:499:5 in 'exec_internal_single'
  from /usr/lib/crystal/http/client.cr:485:5 in 'exec_internal'
  from /usr/lib/crystal/http/client.cr:481:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:591:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:329:3 in 'get'
  from src/invidious/helpers.cr:238:12 in '->'
  from /usr/lib/crystal/fiber.cr:255:3 in 'run'
  from /usr/lib/crystal/fiber.cr:29:34 in '->'
  from ???
Unhandled exception in spawn:
Invalid HTTP response (Exception)
  from /usr/lib/crystal/http/client/response.cr:0:5 in 'from_io?'
  from /usr/lib/crystal/http/client.cr:499:5 in 'exec_internal_single'
  from /usr/lib/crystal/http/client.cr:485:5 in 'exec_internal'
  from /usr/lib/crystal/http/client.cr:481:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:591:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:329:3 in 'get'
  from src/invidious/helpers.cr:238:12 in '->'
  from /usr/lib/crystal/fiber.cr:255:3 in 'run'
  from /usr/lib/crystal/fiber.cr:29:34 in '->'
  from ???
Unhandled exception in spawn:
SSL_read: error:1408F10B:SSL routines:ssl3_get_record:wrong version number (OpenSSL::SSL::Error)
  from /usr/lib/crystal/openssl/ssl/socket.cr:102:9 in 'unbuffered_read'
  from /usr/lib/crystal/io/buffered.cr:215:5 in 'fill_buffer'
  from /usr/lib/crystal/io/buffered.cr:89:7 in 'peek'
  from /usr/lib/crystal/io.cr:645:37 in 'gets'
  from /usr/lib/crystal/io.cr:604:5 in 'gets'
  from /usr/lib/crystal/io.cr:827:5 in 'read_line:chomp'
  from /usr/lib/crystal/http/content.cr:154:7 in 'read_chunk_size'
  from /usr/lib/crystal/http/content.cr:136:7 in 'next_chunk'
  from /usr/lib/crystal/http/content.cr:104:7 in 'peek'
  from /usr/lib/crystal/flate/reader.cr:66:17 in 'read'
  from /usr/lib/crystal/gzip/reader.cr:85:7 in 'read'
  from /usr/lib/crystal/io/encoding.cr:76:45 in 'read'
  from /usr/lib/crystal/io.cr:561:11 in 'gets_to_end'
  from /usr/lib/crystal/http/client/response.cr:73:15 in 'consume_body_io'
  from /usr/lib/crystal/http/client/response.cr:97:9 in 'from_io?'
  from /usr/lib/crystal/http/client.cr:499:5 in 'exec_internal_single'
  from /usr/lib/crystal/http/client.cr:485:5 in 'exec_internal'
  from /usr/lib/crystal/http/client.cr:481:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:591:5 in 'exec'
  from /usr/lib/crystal/http/client.cr:329:3 in 'get'
  from src/invidious/helpers.cr:231:12 in '->'
  from /usr/lib/crystal/fiber.cr:255:3 in 'run'
  from /usr/lib/crystal/fiber.cr:29:34 in '->'
  from ???
Invalid memory access (signal 11) at address 0x0
[0x5639cceeeaa6] *CallStack::print_backtrace:Int32 +118
[0x5639cce4a89b] __crystal_sigfault_handler +75
[0x7f0c40e1aa80] ???
[0x7f0c4025532f] ???
[0x7f0c4025667a] __libc_malloc +522
[0x7f0c41d32743] ???
[0x7f0c41d30bdf] ???
[0x7f0c41d394d2] ???
[0x7f0c41d3423e] ???
[0x7f0c41d319d4] ???
[0x7f0c41d37adb] ???
[0x7f0c41d41c65] SSL_read +53
[0x5639ccf9adf2] *OpenSSL::SSL::Socket+ +130
[0x5639ccf9accc] *OpenSSL::SSL::Socket+ +76
[0x5639ccf9ac11] *OpenSSL::SSL::Socket+ +49
[0x5639ccf922b8] *IO+ +1096
[0x5639ccf9490e] *IO+ +238
[0x5639ccf947eb] *IO+ +75
[0x5639ccfa1d41] *HTTP::ChunkedContent#read_chunk_size:Int32 +33
[0x5639ccfa0e17] *HTTP::ChunkedContent#next_chunk:(Bool | Nil) +135
[0x5639ccfa056c] *HTTP::ChunkedContent#peek:(Slice(UInt8) | Nil) +28
[0x5639ccfb162f] *Flate::Reader#read<Slice(UInt8)>:Int32 +543
[0x5639ccfb0043] *Gzip::Reader#read<Slice(UInt8)>:Int32 +227
[0x5639ccf4c2db] *IO::Decoder#read<IO+>:Nil +891
[0x5639ccf94f5d] *IO+ +125
[0x5639cd077fad] *HTTP::Client::Response#consume_body_io:Nil +125
[0x5639cd077efe] *HTTP::Client::Response::from_io?<(OpenSSL::SSL::Socket+ | TCPSocket+), Bool, Bool>:(HTTP::Client::Response | Nil) +2270
[0x5639cd074520] *HTTP::Client#exec_internal_single<HTTP::Request>:(HTTP::Client::Response | Nil) +80
[0x5639cd0742d0] *HTTP::Client#exec_internal<HTTP::Request>:HTTP::Client::Response +32
[0x5639cd0742a6] *HTTP::Client#exec<HTTP::Request>:HTTP::Client::Response +6
[0x5639cd074006] *HTTP::Client#exec<String, String, Nil, Nil>:HTTP::Client::Response +22
[0x5639cd073fe7] *HTTP::Client#get<String>:HTTP::Client::Response +39
[0x5639cce801a1] ~procProc(Nil) +161
[0x5639ccf1f5fe] *Fiber#run:(IO::FileDescriptor | Nil) +174
[0x5639cce49f66] ~proc2Proc(Fiber, (IO::FileDescriptor | Nil)) +6
[0x0] ???

All 14 comments

Alright, found out how to solve this one.

In helpers.cr on line 455 you're passing the NO_SSL2 flag to OpenSSL. By removing that I get rid of this error, but another one arises.

It's constantly spamming : Index out of bounds.

I can't test this right now, but you might try turning off all the jobs except one, using ./sentry --run-args -t 0 -v 0 -c 1 and trying each one. My guess is this job is failing when it calls search.

Will see if I can't do it later :) Kind of busy right now as well

@omarroth None of those work;

Unhandled exception: Invalid option: -v (OptionParser::InvalidOption)
  from /usr/lib/crystal/option_parser.cr:79:45 in '->'
  from /usr/lib/crystal/option_parser.cr:379:7 in '__crystal_main'
  from /usr/lib/crystal/crystal/main.cr:53:14 in 'main'
  from /usr/lib/crystal/string.cr:251:5 in 'parse_node'
  from _start
  from ???

My mistake: command needs to be written as ./sentry --run-args="-t 0 -v 0 - c 1"

Wonderful, that fixed both problems! :tada:

Though, I suppose there should be a permanent fix?

Managed to track it back to here https://github.com/omarroth/invidious/blob/master/src/invidious/helpers.cr#L451-L462, where it's throwing SSL_read: error:1408F10B:SSL routines:ssl3_get_record:wrong version number (OpenSSL::SSL::Error)

Good find! If it throws index errors after removing NO_SSL_V2, then my guess is the other problem is right here. Which would indicate a problem with the search function. If that's the case, then it'll probably be fixed on the way to implementing #30.

Well, I don't know why it worked (or at least it seemed like it) earlier, because it doesn't now. If I remove it now it just throws the same error.

Here is the error from after removing NO_SSL_V2:

[development] Kemal is ready to lead at http://0.0.0.0:3000 Unhandled exception in spawn: SSL_read: error:1408F10B:SSL routines:ssl3_get_record:wrong version number (OpenSSL::SSL::Error) from /usr/lib/crystal/openssl/ssl/socket.cr:102:9 in 'unbuffered_read' from /usr/lib/crystal/io/buffered.cr:215:5 in 'fill_buffer' from /usr/lib/crystal/io/buffered.cr:89:7 in 'peek' from /usr/lib/crystal/io.cr:645:37 in 'gets' from /usr/lib/crystal/io.cr:604:5 in 'gets' from /usr/lib/crystal/http/client/response.cr:119:12 in 'from_io?' from /usr/lib/crystal/http/client.cr:499:5 in 'exec_internal_single' from /usr/lib/crystal/http/client.cr:485:5 in 'exec_internal' from /usr/lib/crystal/http/client.cr:481:5 in 'exec' from /usr/lib/crystal/http/client.cr:591:5 in 'exec' from /usr/lib/crystal/http/client.cr:329:3 in 'get' from src/invidious/helpers.cr:238:12 in '->' from /usr/lib/crystal/fiber.cr:255:3 in 'run' from /usr/lib/crystal/fiber.cr:29:34 in '->' from ??? Unhandled exception in spawn: SSL_read: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac (OpenSSL::SSL::Error) from /usr/lib/crystal/openssl/ssl/socket.cr:102:9 in 'unbuffered_read' from /usr/lib/crystal/io/buffered.cr:215:5 in 'fill_buffer' from /usr/lib/crystal/io/buffered.cr:89:7 in 'peek' from /usr/lib/crystal/http/content.cr:106:14 in 'peek' from /usr/lib/crystal/flate/reader.cr:66:17 in 'read' from /usr/lib/crystal/gzip/reader.cr:85:7 in 'read' from /usr/lib/crystal/io/encoding.cr:76:45 in 'read' from /usr/lib/crystal/io.cr:561:11 in 'gets_to_end' from /usr/lib/crystal/http/client/response.cr:73:15 in 'consume_body_io' from /usr/lib/crystal/http/client/response.cr:97:9 in 'from_io?' from /usr/lib/crystal/http/client.cr:499:5 in 'exec_internal_single' from /usr/lib/crystal/http/client.cr:485:5 in 'exec_internal' from /usr/lib/crystal/http/client.cr:481:5 in 'exec' from /usr/lib/crystal/http/client.cr:591:5 in 'exec' from /usr/lib/crystal/http/client.cr:329:3 in 'get' from src/invidious/helpers.cr:231:12 in '->' from /usr/lib/crystal/fiber.cr:255:3 in 'run' from /usr/lib/crystal/fiber.cr:29:34 in '->' from ???

Called with ./sentry --run-args="-t 1 -v 0 - c 1"

Looks like it's having trouble with SSLv3 then as well. I'll take a look later rather than asking you to try all combinations of things :)

Ended up being a one-line fix: see 0fba601e91b6c02d456c5a0710d445d7dfcebfe0. My guess is that a HTTP::Client will throw errors like seen above when they are reused improperly or being used multiple times without being refreshed. You might take a look to make sure it fixes it on your machine with ./sentry --run-args="-t 1 -v 0 -c 0" and we can close this.

Indeed, 0fba601 ended up solving the issue. Works like a charm now!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arch-btw picture arch-btw  Â·  4Comments

Uffje picture Uffje  Â·  3Comments

tuxayo picture tuxayo  Â·  4Comments

Rb4eogrl picture Rb4eogrl  Â·  3Comments

Jtasiu picture Jtasiu  Â·  3Comments