invidious icon indicating copy to clipboard operation
invidious copied to clipboard

[Bug] Invalid cookie value (IO::Error) while trying to save settings

Open frknkrc44 opened this issue 3 years ago • 14 comments

I'm using LibreWolf 88.0 AppImage. Also tried with Firefox and Chrome. it's my build and works on ubuntu container.

Title: Invalid cookie value (IO::Error) Date: 2021-04-28T09:35:12Z Route: /preferences?referer=%2Fwatch%3Fv%3DfuOgPU10THA Version: 2021.04.21-bfd02ac @ master

Backtrace

Invalid cookie value (IO::Error)
  from /usr/share/crystal/src/http/cookie.cr:40:7 in 'new:name:value:expires:secure:http_only'
  from src/invidious/routes/preferences.cr:194:41 in 'update'
  from lib/kemal/src/kemal/route.cr:12:9 in '->'
  from /usr/share/crystal/src/primitives.cr:255:3 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:28: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:28:7 in 'call_next'
  from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from src/invidious/helpers/static_file_handler.cr:112:11 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from lib/kemal/src/kemal/init_handler.cr:12:7 in 'process'
  from /usr/share/crystal/src/http/server.cr:498:5 in '->'
  from /usr/share/crystal/src/primitives.cr:255:3 in 'run'
  from ???

frknkrc44 avatar Apr 28 '21 09:04 frknkrc44

I get exactly the same error.

sdfg2 avatar May 07 '21 10:05 sdfg2

@frknkrc44 @sdfg2 Can you please provide a screenshot of the preferences page (or better a browser devtool logs of the request). This would be really helpful :)

SamantazFox avatar May 20 '21 21:05 SamantazFox

@SamantazFox what settings do you want in the screenshot? It does it no matter what preferences I choose.

I had a look in the console and inspector and couldn't find anything you might be interested in, happy to help if you can direct me (Vivaldi).

sdfg2 avatar May 28 '21 20:05 sdfg2

Same problem here on a fresh installation plus host, when setting anything and then confirming. image

Works however, when an account is created and when logged in.

lyn1337 avatar May 28 '21 22:05 lyn1337

@sdfg2 when you are in the inspector, you have a tab called "network". In here, you can see all the requests that the browser sent to a website. Click on the html request to /preferences?referer=..., and copy the contents of the request tab. It will contain the data sent when you pressed "save".

Note: Make sure to open the inspector before pressing "save preferences"!

image

(the sreenshot is from Firefox, as I don't have Vivaldi on this PC, but all browser inspectors are similar)

SamantazFox avatar May 29 '21 16:05 SamantazFox

@SamantazFox here you go

image

sdfg2 avatar May 30 '21 09:05 sdfg2

@sdfg2 Thanks :) However, I can't reproduce the error with my version of Firefox... Will try with Vivavldi later.

@frknkrc44 @lyn1337 @sdfg2 can you please tell more about your setups?

  • is your instance running on bare metal? If yes, what distro are you using (ubuntu, debian, arch, ...)? Or is it running in docker?
  • Do you have a reverse proxy, and if yes, which one (nginx, lighttpd, apache, ...)?
  • Can you also post your server's config.yml(Make sure to remove your database password before posting!!)?

I'd like as many infos as possible to try to reproduce your bug :)

PS: also make sure that your ad- or cookies-blocker is not interfering!

SamantazFox avatar May 30 '21 12:05 SamantazFox

This really isn't helpful but I've encountered this error a few times. A refresh always fixes it though so I've never been able to consistently reproduce it.

syeopite avatar May 30 '21 12:05 syeopite

@SamantazFox

VPS, Arch, nginx 1.19.10. Turned off UO, same behaviour. Cookies set to block third party (so if it's that, I have questions... ;) ) Probably makes no difference, but using postgres 13.2.

feed_threads: 1
db:
  user: kemal
  password: lolnope
  host: localhost
  port: 5432
  dbname: invidious
# alternatively, the database URL can be provided directly - if both are set then the latter takes precedence
# database_url: postgres://kemal:kemal@localhost:5432/invidious
full_refresh: false
registration_enabled: false
login_enabled: false
top_enabled: false
feed_menu: []
host_binding: 10.1.0.1
cookies: CONSENT=YES+
default_user_preferences:
  dark_mode: true
  comments: ["",""]
  local: true
  related_videos: false
  quality: dash

EDIT: Tried refreshing when the error comes up, it asks to confirm resubmission but results in the same error.

EDIT2: I'm the only one using this, and will be the only one using it (it's locked down so hard for outside access), all I wanted was a way to set dash quality to 'best'. I couldn't see how to do that by editing default_user_preferences, which would be my preferred way of doing it.

sdfg2 avatar May 30 '21 18:05 sdfg2

@sdfg2 Thanks for the infos. I've tried with both your config.yml and a vivaldi browser, and I can't manage to reproduce the issue yet. I'll try to reproduce your whole server environment later (I don't have the time to install archlinux atm ^^)

SamantazFox avatar Jun 01 '21 06:06 SamantazFox

@SamantazFox sorry it's been a busy few days. I didn't realise that had been fixed! I've taken that out, same behaviour. And I tested in Firefox as well, same behaviour.

sdfg2 avatar Jun 03 '21 19:06 sdfg2

@sdfg2 is this fixed then?

unixfox avatar Jun 10 '21 14:06 unixfox

@unixfox Not unless there's a release I've missed?

sdfg2 avatar Jun 16 '21 17:06 sdfg2

This issue has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely outdated. If you think this issue is still relevant and applicable, you just have to post a comment and it will be unmarked.

github-actions[bot] avatar Sep 14 '22 02:09 github-actions[bot]