User Session logs out very quickly

I know there is a MAX_SESSION_AGE environment value, which, based on the default value, should last a long time. I am the admin of our Metabase instance, and it seems like user sessions are 2-5 minutes long, before asking users to authenticate again (using Google Auth).

Is there something within the Google side that would cause this timeout to be so short? Nothing in the logs indicates there is anything that is logging users out.

Thanks!

Hi @dusty
Your Google session does not change the Metabase session.
Once you login to Metabase (no matter which SSO you are using), then you get a Metabase session, which lasts by default 14 days.

Either you have some weird configuration somewhere, like MAX_SESSION_AGE.
Or you are running multiple instances of Metabase, which are not using the same application database.
Or you have some application database problems, where it is being restored to a previous version constantly (either by a human or some auto-script trying to fix a corruption).
Or you have a bad browser/extension, which is deleting the session.
Or ... some other possibilities.

But without "Diagnostic Info" from Admin > Troubleshooting, and logs, and checking your sessions in core_session table, then it's impossible to know what is going on.

I read that the default is 14 days, but I am setting MAX_SESSION_AGE as an environment variable in the application container as the same default value, just to be safe.

We are running one Metabase instance that uses a single application database.

I am not seeing any error messages in our logs as it relates to database problems.

As far as browsers and extensions, this is happening to me and about 10 employees that I manage this for.

{
"browser-info": {
"language": "en-US",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.14.1+1",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.14.1",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.14.1+1",
"os.name": "Linux",
"os.version": "5.4.188-104.359.amzn2.x86_64",
"user.language": "en",
"user.timezone": "UTC"
},
"metabase-info": {
"databases": [
"postgres"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "13.6"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.2.23"
}
},
"run-mode": "prod",
"version": {
"date": "2022-03-23",
"tag": "v0.42.3",
"branch": "release-x.42.x",
"hash": "33fb268"
},
"settings": {
"report-timezone": null
}
}
}

@dusty
Don't set the environment variable.
Upgrade to a newer release of Metabase: https://github.com/metabase/metabase/releases

I would guess that your Metabase application database (Postgres in your case), but it could also be a bad reverse-proxy doing something it shouldn't to the requests.
https://www.metabase.com/docs/latest/troubleshooting-guide/proxies.html

There's 40k+ installations of Metabase, so if this was a common problem, then we would know about it.

Thanks for the help, I'll remove the environment variable. As far as the latest version, I'm currently at the mercy of theHelm Chart that we have deployed, but I can check to see if we can override that on deployment.

As far as the reverse-proxy, that could be the case. I will talk with our infra team to see if they can troubleshoot from their end.

Thanks again

@dusty So you are using Kubernetes. Contact your infra team to get help from them on how everything is setup. And have them look in all the logs of everything. Sounds like there's a bad setup somewhere.

1 Like