[beta] index idx_local_asset_checksum already exists #6705

Closed
opened 2026-02-05 12:28:58 +03:00 by OVERLORD · 13 comments
Owner

Originally created by @aaronliu0130 on GitHub (Aug 2, 2025).

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

This happens when I try to use the beta timeline. The migration screen claimed it succeeded.
Image
Image

SqliteException(1): while executing, index idx_local_asset_checksum already exists, SQL logic error (code 1)
Causing statement: CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum), parameters:

The OS that Immich Server is running on

Arch

Version of Immich Server

v1.137.3

Version of Immich Mobile App

v1.137.0 build 212

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

Bare metal; please tell me which dependency version infos are needed.

Your .env content

DB_HOSTNAME=localhost
DB_USERNAME=postgres
DB_PASSWORD=redacted
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=localhost

IMMICH_MEDIA_LOCATION=/var/lib/immich/upload

IMMICH_MACHINE_LEARNING_ENABLED=true

# DISABLE_REVERSE_GEOCODING=false
# REVERSE_GEOCODING_PRECISION=3

IMMICH_MACHINE_LEARNING_URL=http://127.0.0.1:3003

MACHINE_LEARNING_CACHE_FOLDER=/var/lib/immich/.cache

Reproduction steps

  1. Have installation
  2. Try to switch to beta timeline on mobile
  3. Go to the Photos or Library tab

Relevant log output

I couldn't find anything in the journalctl -efu

Additional information

I don't use the docker container because 1. having it running interferes with my Waydroid internet connection; I've tried the relevant troubleshooting steps 2. inertia 3. I maintain the very unofficial immich-server AUR package which is how I run immich

Originally created by @aaronliu0130 on GitHub (Aug 2, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug This happens when I try to use the beta timeline. The migration screen claimed it succeeded. <img width="469" height="1014" alt="Image" src="https://github.com/user-attachments/assets/7b39f967-a2b1-4fe7-a801-06e03a8cace6" /> <img width="469" height="1014" alt="Image" src="https://github.com/user-attachments/assets/0c7890c8-7187-478e-818f-592316e5e148" /> > SqliteException(1): while executing, index idx_local_asset_checksum already exists, SQL logic error (code 1) Causing statement: CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum), parameters: ### The OS that Immich Server is running on Arch ### Version of Immich Server v1.137.3 ### Version of Immich Mobile App v1.137.0 build 212 ### Platform with the issue - [ ] Server - [ ] Web - [x] Mobile ### Your docker-compose.yml content ```YAML Bare metal; please tell me which dependency version infos are needed. ``` ### Your .env content ```Shell DB_HOSTNAME=localhost DB_USERNAME=postgres DB_PASSWORD=redacted DB_DATABASE_NAME=immich REDIS_HOSTNAME=localhost IMMICH_MEDIA_LOCATION=/var/lib/immich/upload IMMICH_MACHINE_LEARNING_ENABLED=true # DISABLE_REVERSE_GEOCODING=false # REVERSE_GEOCODING_PRECISION=3 IMMICH_MACHINE_LEARNING_URL=http://127.0.0.1:3003 MACHINE_LEARNING_CACHE_FOLDER=/var/lib/immich/.cache ``` ### Reproduction steps 1. Have installation 2. Try to switch to beta timeline on mobile 3. Go to the Photos or Library tab ### Relevant log output ```shell I couldn't find anything in the journalctl -efu ``` ### Additional information I don't use the docker container because 1. having it running interferes with my Waydroid internet connection; I've tried the relevant troubleshooting steps 2. inertia 3. I maintain the very unofficial immich-server AUR package which is how I run immich
OVERLORD added the 📱mobilemobile-beta labels 2026-02-05 12:28:58 +03:00
Author
Owner

@alextran1502 commented on GitHub (Aug 2, 2025):

Can you try go to the Beta Stats Page, scroll down and clear the sqlite database then restart the app. Before that can you please export the logs here?

@alextran1502 commented on GitHub (Aug 2, 2025): Can you try go to the Beta Stats Page, scroll down and clear the sqlite database then restart the app. Before that can you please export the logs here?
Author
Owner

@michael01angelo commented on GitHub (Aug 2, 2025):

Disabling the Beta Timeline solved the issue for me.

Here's the log once I turned on the Beta timeline
https://pastebin.com/nGePPcXb

@michael01angelo commented on GitHub (Aug 2, 2025): Disabling the Beta Timeline solved the issue for me. Here's the log once I turned on the Beta timeline https://pastebin.com/nGePPcXb
Author
Owner

@alextran1502 commented on GitHub (Aug 2, 2025):

@shenlong-tanwen did we not drop this index before the library id is added?

@alextran1502 commented on GitHub (Aug 2, 2025): @shenlong-tanwen did we not drop this index before the library id is added?
Author
Owner

@aaronliu0130 commented on GitHub (Aug 2, 2025):

Before that can you please export the logs here?

How do I do that?

@aaronliu0130 commented on GitHub (Aug 2, 2025): > Before that can you please export the logs here? How do I do that?
Author
Owner

@thorsten-hehn commented on GitHub (Aug 3, 2025):

I am pretty sure that I also got this error message yesterday on iOS. It suddenly appeared with server running on 1.136.0, but it remained also after updating to 1.137.3. So I simply removed and re-installed the app, and since then, the app is running smoothly again (with beta timeline activated).

@thorsten-hehn commented on GitHub (Aug 3, 2025): I am pretty sure that I also got this error message yesterday on iOS. It suddenly appeared with server running on 1.136.0, but it remained also after updating to 1.137.3. So I simply removed and re-installed the app, and since then, the app is running smoothly again (with beta timeline activated).
Author
Owner

@aaronliu0130 commented on GitHub (Aug 3, 2025):

Okay, I found the in-app logs.

Immich_log_2025-08-03T10_38_55.887433.log

The stats page doesn't even load:

Image
@aaronliu0130 commented on GitHub (Aug 3, 2025): Okay, I found the in-app logs. [Immich_log_2025-08-03T10_38_55.887433.log](https://github.com/user-attachments/files/21566377/Immich_log_2025-08-03T10_38_55.887433.log) The stats page doesn't even load: <img width="1284" height="2778" alt="Image" src="https://github.com/user-attachments/assets/4cb477fa-2ec5-4dbc-b591-720bbdb1c8d1" />
Author
Owner

@shenlong-tanwen commented on GitHub (Aug 4, 2025):

@shenlong-tanwen did we not drop this index before the library id is added?

The idx_local_asset_checksum is from the first schema. Drift uses the CREATE INDEX ON instead of CREATE IF NOT EXISTS INDEX ON for creating indexes, so if for some reason, the if the Index did already exist in the DB, it will throw the error. We don't create this index manually as part of any migration either.

@shenlong-tanwen commented on GitHub (Aug 4, 2025): > [@shenlong-tanwen](https://github.com/shenlong-tanwen) did we not drop this index before the library id is added? The `idx_local_asset_checksum` is from the first schema. Drift uses the `CREATE INDEX ON` instead of `CREATE IF NOT EXISTS INDEX ON` for creating indexes, so if for some reason, the if the Index did already exist in the DB, it will throw the error. We don't create this index manually as part of any migration either.
Author
Owner

@aaronliu0130 commented on GitHub (Aug 5, 2025):

Would somehow checking what the index contains on the server help with diagnosing the issue? I would go ahead and run the command if I knew what it was.

@aaronliu0130 commented on GitHub (Aug 5, 2025): Would somehow checking what the index contains on the server help with diagnosing the issue? I would go ahead and run the command if I knew what it was.
Author
Owner

@pchresta commented on GitHub (Aug 5, 2025):

I also have this issue:

SqliteException(1): while executing, index idx_remote_asset_owner_checksum already exists, SQL logic error (code 1) Causing statement: CREATE INDEX idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum), parameters:

If i can provide anything to help to resolve this, hit me up :)

@pchresta commented on GitHub (Aug 5, 2025): I also have this issue: `SqliteException(1): while executing, index idx_remote_asset_owner_checksum already exists, SQL logic error (code 1) Causing statement: CREATE INDEX idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum), parameters: ` If i can provide anything to help to resolve this, hit me up :)
Author
Owner

@molnarti commented on GitHub (Aug 5, 2025):

Same issue here on ios. Cannot reset the sqlite db, as the beta page appears empty as already posted above

@molnarti commented on GitHub (Aug 5, 2025): Same issue here on ios. Cannot reset the sqlite db, as the beta page appears empty as already posted above
Author
Owner

@aaronliu0130 commented on GitHub (Aug 31, 2025):

I've fixed after uninstalling and reinstalling; when I encountered this error on a recent version I effectively bricked the app. You can't exit the screen showing the migration error and on restart the app just loads forever.

The migration error screen, 2025-08-25
@aaronliu0130 commented on GitHub (Aug 31, 2025): I've fixed after uninstalling and reinstalling; when I encountered this error on a recent version I effectively bricked the app. You can't exit the screen showing the migration error and on restart the app just loads forever. <img width="1284" height="2778" alt="The migration error screen, 2025-08-25" src="https://github.com/user-attachments/assets/8697f8b6-6e4f-4029-8821-200809149b65" />
Author
Owner

@jrasm91 commented on GitHub (Sep 10, 2025):

@shenlong-tanwen has this issue been fixed?

@jrasm91 commented on GitHub (Sep 10, 2025): @shenlong-tanwen has this issue been fixed?
Author
Owner

@shenlong-tanwen commented on GitHub (Sep 10, 2025):

@shenlong-tanwen has this issue been fixed?

The main issue reported in the issue is fixed in #20728

I think there was something seriously wrong with the initial migration code causing all sorts of issues. The no such column should also not reproduce on fresh installs or on the recent releases.

@shenlong-tanwen commented on GitHub (Sep 10, 2025): > [@shenlong-tanwen](https://github.com/shenlong-tanwen) has this issue been fixed? The main issue reported in the issue is fixed in #20728 I think there was something seriously wrong with the initial migration code causing all sorts of issues. The `no such column` should also not reproduce on fresh installs or on the recent releases.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#6705