After updating to 2.2.2 i can no longer log in

Environment: Running in WSL version: 2.6.1.0 using docker compose in windows server 24H2 Data is stored on a windows storage space with correct password i get "Failed to login", incorrect password i get "Incorrect email or password" When looking at the docker log i see: [Nest] 25 - 11/04/2025, 11:53:10 AM ERROR [Api:ErrorInterceptor~0um7jzkf] Unknown error: PostgresError: column "appVersion" of relation "session" does not exist PostgresError: column "appVersion" of relation "session" does not exist at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
24 Replies
Immich
Immich3w ago
:wave: Hey @Spektor56, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time). 2. :ballot_box_with_check: read applicable release notes. 3. :ballot_box_with_check: reviewed the FAQs for known issues. 4. :ballot_box_with_check: reviewed Github for known issues. 5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy). 6. :ballot_box_with_check: uploaded the relevant information (see below). 7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed. Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
Alex Tran
Alex Tran3w ago
can you execute this query on the database?
ALTER TABLE "session" ADD "appVersion" character varying;
ALTER TABLE "session" ADD "appVersion" character varying;
Spektor56
Spektor56OP3w ago
im in the postgres terminal in docker desktop, how do i run the sql command on the server?
Alex Tran
Alex Tran3w ago
psql --dbname=immich --username=postgres ?
Spektor56
Spektor56OP3w ago
ERROR: column "appVersion" of relation "session" already exists 2025-11-04 17:17:54.704 UTC [63] ERROR: column "appVersion" of relation "session" does not exist at character 59 2025-11-04 17:17:54.704 UTC [63] STATEMENT: insert into "session" ("token", "deviceOS", "deviceType", "appVersion", "userId") values ($1, $2, $3, $4, $5) returning * when i do select * from session it is not showing the column though lol i dont get it immich=# select "appVersion" from "session"; ERROR: column "appVersion" does not exist table_schema | table_name | column_name
--------------+------------+-------------------- public | session | appVersion public | session | createdAt public | session | deviceOS public | session | deviceType public | session | expiresAt public | session | id public | session | isPendingSyncReset public | session | parentId public | session | pinExpiresAt public | session | token public | session | updateId its in the schema but does not exist...
Alex Tran
Alex Tran3w ago
Can you check if you are connecting to the correct database?
Zeus
Zeus3w ago
I also wonder if you could have 2 DBs existing
Spektor56
Spektor56OP3w ago
docker exec -it immich_postgres psql --dbname=immich --username=postgres --command="show data_checksums" data_checksums ---------------- on (1 row) docker exec -it immich_postgres psql --dbname=immich --username=postgres --command="SELECT datname, checksum_failures, checksum_last_failure FROM pg_stat_database WHERE datname IS NOT NULL" datname | checksum_failures | checksum_last_failure -----------+-------------------+----------------------- postgres | 0 | immich | 0 | template1 | 0 | template0 | 0 | (4 rows) docker exec -it immich_postgres pg_amcheck --username=postgres --heapallindexed --parent-check --rootdescend --progress --all --install-missing heap table "immich.pg_catalog.pg_statistic", block 36, offset 8, attribute 26: toast value 944723 not found in toast table heap table "immich.pg_catalog.pg_statistic", block 36, offset 8, attribute 27: toast value 944724 not found in toast table heap table "immich.pg_catalog.pg_statistic", block 36, offset 9, attribute 27: toast value 944725 not found in toast table heap table "immich.pg_catalog.pg_statistic", block 39, offset 9, attribute 27: toast value 928365 not found in toast table heap table "immich.pg_catalog.pg_statistic", block 45, offset 2, attribute 27: toast value 944729 not found in toast table heap table "immich.pg_catalog.pg_statistic", block 58, offset 4, attribute 27: toast value 928366 not found in toast table heap table "immich.pg_catalog.pg_statistic", block 59, offset 3, attribute 27: toast value 944730 not found in toast table heap table "immich.pg_catalog.pg_statistic", block 61, offset 4, attribute 27: toast value 928375 not found in toast table btree index "immich.pg_catalog.pg_statistic_relid_att_inh_index": ERROR: heap tuple (39,6) from table "pg_statistic" lacks matching index tuple within index "pg_statistic_relid_att_inh_index" 1074/1074 relations (100%), 171111/171111 pages (100%)
Spektor56
Spektor56OP3w ago
No description
Spektor56
Spektor56OP3w ago
No description
Spektor56
Spektor56OP3w ago
No description
Alex Tran
Alex Tran3w ago
Can you restart the stack and see what is the error message on the server now?
Spektor56
Spektor56OP3w ago
2025-11-04 21:10:36.764 UTC [62] ERROR: column "appVersion" of relation "session" does not exist at character 59 2025-11-04 21:10:36.764 UTC [62] STATEMENT: insert into "session" ("token", "deviceOS", "deviceType", "appVersion", "userId") values ($1, $2, $3, $4, $5) returning * durationMs: 3.3531800000000658, error: PostgresError: column "appVersion" of relation "session" does not exist at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { severity_local: 'ERROR', severity: 'ERROR', code: '42703', position: '59', file: 'parse_target.c', line: '1075', routine: 'checkInsertTargets' }, sql: 'insert into "session" ("token", "deviceOS", "deviceType", "appVersion", "userId") values ($1, $2, $3, $4, $5) returning *', params: [ '4ufG3j0r0VqDaZnjXzSp8X84RfPk+8TQiA+ltTCkzcM=', 'Windows', 'Chrome', null, '1284d6ae-8731-4d75-858d-b591cbba038b' ] } [Nest] 25 - 11/04/2025, 4:10:36 PM ERROR [Api:ErrorInterceptor~nsr3zrk6] Unknown error: PostgresError: column "appVersion" of relation "session" does not exist PostgresError: column "appVersion" of relation "session" does not exist at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) im just going to try drop column then add back... immich=# ALTER TABLE "session" ADD "appVersion" character varying; ERROR: duplicate key value violates unique constraint "pg_attribute_relid_attnum_index" DETAIL: Key (attrelid, attnum)=(17256, 13) already exists. ugh
Alex Tran
Alex Tran3w ago
Hmmm that is pretty weird, and doesn't make sense
Zeus
Zeus3w ago
Your database seems to have some odd errors While it doesn’t seem to affect the immich database it’s not normal
Spektor56
Spektor56OP3w ago
Is appVersion a new column in this version?
Alex Tran
Alex Tran3w ago
No, it was added in 2.1 I believe
Spektor56
Spektor56OP3w ago
Not sure which version I upgraded from, I know I upgraded to the version when the fix for search scrolling back to the top came out Don't know if I did any incremental upgrades after that one
Alex Tran
Alex Tran3w ago
maybe try to restore from the database dump first and start again from there
Spektor56
Spektor56OP3w ago
I haven't added anything new since originally setting it up so should be fine, where are the db dumps? Found them How do i restore it, each one is 1gb Sorry I'm on my phone at my kids swimming lessons so using my server via remote desktop kinda hard lol Reading the readme, seems like restore is a little scorched earth. I'll see what I can do before doing that :p ok so claude was 1000x more helpful than chatgpt at fixing it: This is a corrupt system catalog issue! The error indicates that PostgreSQL's internal metadata is inconsistent - the column reference exists in the system catalogs but not in the actual table structure. This is a database corruption problem. Here's how to fix it: Option 1: Find and remove the phantom column reference (Safest) sql-- First, find the problematic attribute SELECT attname, attnum, attrelid FROM pg_attribute WHERE attrelid = 17256 AND attnum = 13; -- If it shows a column (likely "appVersion"), delete it from pg_attribute DELETE FROM pg_attribute WHERE attrelid = 17256 AND attnum = 13; -- Now try adding the column again ALTER TABLE "session" ADD "appVersion" character varying;
Zeus
Zeus3w ago
You really shouldn’t need to do that tbh. This is a sign of major issues
Spektor56
Spektor56OP3w ago
I've had multiple power outages in the last month but if postgres is ACID compliant then that shouldn't be an issue I don't ever use postgres for anything so not familiar with it
Zeus
Zeus3w ago
It’s compliant assuming your storage mediums are 100% reliable, which is impossible 😉 This can be seen when a write is issued and a sync returned before the data is truly committed to disk. Cheap SSDs etc And then ofc there’s truly random stuff like bitrot, cosmic rays, non ECC RAM etc

Did you find this page helpful?