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

Error: failed to look up session from cookie #61343

Closed
iBelow opened this issue Jan 12, 2023 · 2 comments
Closed

Error: failed to look up session from cookie #61343

iBelow opened this issue Jan 12, 2023 · 2 comments

Comments

@iBelow
Copy link

iBelow commented Jan 12, 2023

What happened:
after some time grafana logout all users with error

logger=context t=2023-01-12T10:26:49.779072173+03:00 level=warn msg="failed to look up session from cookie" error="user token not found"
logger=context t=2023-01-12T10:26:49.779294689+03:00 level=warn msg="failed to look up session from cookie" error="user token not found"

and

logger=context t=2023-01-12T10:44:31.118535705+03:00 level=warn msg="failed to look up session from cookie" error="database is locked"

but... i havent db, i'm use only some integrations

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:
grafana upgraded from 8.3 to v9.3.2 (21c1d14e91)

Environment:

  • Grafana version: v9.3.2 (21c1d14e91)
  • Data source type & version:
  • OS Grafana is installed on: linux as service (via binary)
  • User OS & Browser: Google chrome 108.0.5359.126
  • Grafana plugins:
  • Others: config is default, not changed manually; using nginx, and all works good on previous version

[auth]


# Login cookie name
;login_cookie_name = grafana_session

# The maximum lifetime (duration) an authenticated user can be inactive before being required to login at next visit. Default is 7 days (7d). This setting should be expressed as a duration, e.g. 5m (minutes),>;login_maximum_inactive_lifetime_duration =

# The maximum lifetime (duration) an authenticated user can be logged in since login time before being required to login. Default is 30 days (30d). This setting should be expressed as a duration, e.g. 5m (min>;login_maximum_lifetime_duration =

# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
;token_rotation_interval_minutes = 10

# Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false
;disable_login_form = false

# Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false
;disable_signout_menu = false

# URL to redirect the user to after sign out
;signout_redirect_url =

# Set to true to attempt login with OAuth automatically, skipping the login screen.
# This setting is ignored if multiple OAuth providers are configured.
;oauth_auto_login = false

# OAuth state max age cookie duration in seconds. Defaults to 600 seconds.
;oauth_state_cookie_max_age = 600

# limit of api_key seconds to live before expiration
;api_key_max_seconds_to_live = -1

# Set to true to enable SigV4 authentication option for HTTP-based datasources.
;sigv4_auth_enabled = false

@iBelow
Copy link
Author

iBelow commented Jan 12, 2023

Fixed:
cd to /var/lib/grafana

migrate to new db
sqlite3 grafana.db '.clone grafana-new.db'
change db to new file
mv grafana.db grafana-old.db
mv grafana-new.db grafana.db

and of couse, permissions:
sudo chown grafana:grafana grafana.db

@iBelow iBelow closed this as completed Jan 12, 2023
@DavidAntliff
Copy link

DavidAntliff commented Feb 23, 2023

This didn't work for me with grafana 9.3.6 on Ubuntu 20.04.5 LTS - I continue to get these "user token not found" errors on two separate servers, viewed in the same browser, although I am tunneling them both to different ports on localhost, so the host name is the same for both.

Although I did the steps above, which was insufficient in my case, then once I ran one instance in a private browser window, the issue went away for both of them. Perhaps it is possible that the two sessions were interfering in the browser in some way, since the only difference between them is the port number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants