metabase / metabase/metabase

Users defined in config file are logged out on instance startup

Open
#73,591 0 comments 0 reactions 1 assignee Claimed by @bowbahdoe View on GitHub
.Auto triaged .Backend .Run Repro Bot .Team/UXWest Administration/ Difficulty:Easy Priority:P2 Type:Bug
Dominant language
Clojure
Stars
49.3k
Forks
6.8k
Avg merge
1d 13h
Merged PRs (30d)
653

Description

### Describe the bug

Whenever a Metabase instance starts with a config file, it applies all the defined settings to the application database, including users that already exist exactly how they were defined in the config file.

When the instance restarts, the sessions for these users are cleared out, so all these users are immediately logged out. This is annoying during local development or multi-instance environments where instances might come and go at any time.

### To Reproduce

1. Run Metabase using a `config.yml` like so:

```yaml
version: 1
config:
users:
- first_name: Admin
last_name: McAdminface
password: "123123123"
email: admin@example.com
is_superuser: true
```

2. Verify that you can log in as this new user
3. Restart Metabase
4. You are now logged out

Additionally, you can verify that if you restart Metabase after the user was created, but without the config file, you are still logged in after the restart.

### Expected behavior

Never log users out when working with config files

### Logs

N/A

### Information about your Metabase installation

```JSON
{
"browser-info": {
"language": "en-GB",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Safari/605.1.15",
"vendor": "Apple Computer, Inc."
},
"metabase-info": {
"valid-thru": "2028-01-01T12:00:00Z",
"current-user-count": 4,
"application-database": "postgres",
"settings": {
"report-timezone": "America/Argentina/Buenos_Aires"
},
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "17.5 (Debian 17.5-1.pgdg120+1)"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.7.8"
}
},
"databases": [
"postgres",
"bigquery-cloud-sdk",
"h2"
],
"max-users": 100,
"plan-alias": "enterprise-airgap",
"hosting-env": "unknown",
"run-mode": "prod",
"version": {
"date": "2026-04-30",
"tag": "v1.61.0-beta",
"hash": "d60d1a5"
},
"airgap-token": "enabled"
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "21.0.10+7-LTS",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "21.0.10",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "21.0.10+7-LTS",
"os.name": "Linux",
"os.version": "6.19.13-orbstack-gbd1dc07b8cf4",
"user.language": "en",
"user.timezone": "GMT"
}
}
```

### Severity

P2

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.