[BUG] Data inconsistencies with failed uploads #879

Closed
opened 2026-02-04 23:15:47 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @uhthomas on GitHub (May 23, 2023).

The bug

Following from #2531, I noticed that the number of photos is > 0, even though the upload failed.

image

The OS that Immich Server is running on

Kubernetes

Version of Immich Server

1.57.1

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

Upload a file where the upload fails.

Additional information

[Nest] 1  - 05/23/2023, 11:01:02 AM   ERROR [ExceptionsHandler] ERR Error running script (call to 8f55ae4a3be429c6d38c5d5db3e80edf89197b64): @user_script:56: script tried accessing undeclared key
ReplyError: ERR Error running script (call to 8f55ae4a3be429c6d38c5d5db3e80edf89197b64): @user_script:56: script tried accessing undeclared key
    at parseError (/usr/src/app/node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (/usr/src/app/node_modules/redis-parser/lib/parser.js:302:14)
[Nest] 1  - 05/23/2023, 11:01:36 AM   ERROR [ExceptionsHandler] ERR Error running script (call to 8f55ae4a3be429c6d38c5d5db3e80edf89197b64): @user_script:56: script tried accessing undeclared key
ReplyError: ERR Error running script (call to 8f55ae4a3be429c6d38c5d5db3e80edf89197b64): @user_script:56: script tried accessing undeclared key
    at parseError (/usr/src/app/node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (/usr/src/app/node_modules/redis-parser/lib/parser.js:302:14)
Originally created by @uhthomas on GitHub (May 23, 2023). ### The bug Following from #2531, I noticed that the number of photos is > 0, even though the upload failed. ![image](https://github.com/immich-app/immich/assets/9749173/1dbbd80b-aa8d-49fe-bf5b-b042dadf2320) ### The OS that Immich Server is running on Kubernetes ### Version of Immich Server 1.57.1 ### Version of Immich Mobile App N/A ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML N/A ``` ### Your .env content ```Shell N/A ``` ### Reproduction steps ```bash Upload a file where the upload fails. ``` ### Additional information ``` [Nest] 1 - 05/23/2023, 11:01:02 AM ERROR [ExceptionsHandler] ERR Error running script (call to 8f55ae4a3be429c6d38c5d5db3e80edf89197b64): @user_script:56: script tried accessing undeclared key ReplyError: ERR Error running script (call to 8f55ae4a3be429c6d38c5d5db3e80edf89197b64): @user_script:56: script tried accessing undeclared key at parseError (/usr/src/app/node_modules/redis-parser/lib/parser.js:179:12) at parseType (/usr/src/app/node_modules/redis-parser/lib/parser.js:302:14) [Nest] 1 - 05/23/2023, 11:01:36 AM ERROR [ExceptionsHandler] ERR Error running script (call to 8f55ae4a3be429c6d38c5d5db3e80edf89197b64): @user_script:56: script tried accessing undeclared key ReplyError: ERR Error running script (call to 8f55ae4a3be429c6d38c5d5db3e80edf89197b64): @user_script:56: script tried accessing undeclared key at parseError (/usr/src/app/node_modules/redis-parser/lib/parser.js:179:12) at parseType (/usr/src/app/node_modules/redis-parser/lib/parser.js:302:14) ```
Author
Owner

@samip5 commented on GitHub (May 23, 2023):

I think this is the result of your broken redis config.

Related to

@samip5 commented on GitHub (May 23, 2023): I think this is the result of your broken redis config. Related to - #2548
Author
Owner

@uhthomas commented on GitHub (May 23, 2023):

I think this is the result of your broken redis config.

Possibly? Though the issue still remains that immich then had inconsistent data. Nothing had been uploaded, and yet 2 photos were reported to be uploaded.

@uhthomas commented on GitHub (May 23, 2023): > I think this is the result of your broken redis config. Possibly? Though the issue still remains that immich then had inconsistent data. Nothing had been uploaded, and yet 2 photos were reported to be uploaded.
Author
Owner

@samip5 commented on GitHub (May 24, 2023):

Yeah, but error handling around those edge cases is not the greatest to begin with.

@samip5 commented on GitHub (May 24, 2023): Yeah, but error handling around those edge cases is not the greatest to begin with.
Author
Owner

@uhthomas commented on GitHub (May 24, 2023):

Makes sense, how can we improve error handling?

At this point in time I don't believe immich-server was even connected to redis, I could be wrong. I think I had TypeSense disabled and so immich started fine.

I think it's fair to suggest an upload should be rolled back if it fails to then push jobs into redis.

@uhthomas commented on GitHub (May 24, 2023): Makes sense, how can we improve error handling? At this point in time I don't believe immich-server was even connected to redis, I could be wrong. I think I had TypeSense disabled and so immich started fine. I think it's fair to suggest an upload should be rolled back if it fails to then push jobs into redis.
Author
Owner

@jrasm91 commented on GitHub (May 24, 2023):

If the admin screens shows two images, there are two asset records in the database. Not sure what else to say here. We can track incorrect notification in the other bug. Unless there are not two records in the database this is functioning as designed.

If you don't see any photos on the website, it's because they don't have thumbnails yet, which you won't have until you fix your redis connection. Again, working as designed here.

@jrasm91 commented on GitHub (May 24, 2023): If the admin screens shows two images, there are two asset records in the database. Not sure what else to say here. We can track incorrect notification in the other bug. Unless there are not two records in the database this is functioning as designed. If you don't see any photos on the website, it's because they don't have thumbnails yet, which you won't have until you fix your redis connection. Again, working as designed here.
Author
Owner

@uhthomas commented on GitHub (May 24, 2023):

If the admin screens shows two images, there are two asset records in the database. Not sure what else to say here. We can track incorrect notification in the other bug. Unless there are not two records in the database this is functioning as designed.

If you don't see any photos on the website, it's because they don't have thumbnails yet, which you won't have until you fix your redis connection. Again, working as designed here.

Per https://github.com/immich-app/immich/issues/2531, I believe the uploads failed? Is that actually untrue? I'm feeling a bit confused now.

@uhthomas commented on GitHub (May 24, 2023): > If the admin screens shows two images, there are two asset records in the database. Not sure what else to say here. We can track incorrect notification in the other bug. Unless there are not two records in the database this is functioning as designed. > > If you don't see any photos on the website, it's because they don't have thumbnails yet, which you won't have until you fix your redis connection. Again, working as designed here. Per https://github.com/immich-app/immich/issues/2531, I believe the uploads failed? Is that actually untrue? I'm feeling a bit confused now.
Author
Owner

@bo0tzz commented on GitHub (May 24, 2023):

It seems like that upload succeeded insofar as getting the asset into immich, but then returned an error when queueing the job to process it. The details of how to handle that can be covered in the other issue.

@bo0tzz commented on GitHub (May 24, 2023): It seems like that upload succeeded insofar as getting the asset into immich, but then returned an error when queueing the job to process it. The details of how to handle that can be covered in the other issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#879