VipsJpeg: out of order read at line 0 #26

Closed
opened 2026-02-04 16:38:48 +03:00 by OVERLORD · 11 comments
Owner

Originally created by @arminus on GitHub (Mar 20, 2022).

Client: v.0.6 Android 8.0 / Samsung A5
Server: Pi4

Getting this for every image that is sent:

immich_server_1  | Error resizing file  [Error: VipsJpeg: Invalid SOS parameters for sequential JPEG
immich_server_1  | VipsJpeg: out of order read at line 0
immich_server_1  | ]

Might be related to [this|https://github.com/lovell/sharp/issues/1578] which correlates with my Samsung device. Maybe add an option failOnError: false like they did?

Also, does this error have any negative effect downstream? It appears as if my files get stored and thumbnails are created...

Originally created by @arminus on GitHub (Mar 20, 2022). Client: v.0.6 Android 8.0 / Samsung A5 Server: Pi4 Getting this for every image that is sent: ``` immich_server_1 | Error resizing file [Error: VipsJpeg: Invalid SOS parameters for sequential JPEG immich_server_1 | VipsJpeg: out of order read at line 0 immich_server_1 | ] ``` Might be related to [this|https://github.com/lovell/sharp/issues/1578] which correlates with my Samsung device. Maybe add an option failOnError: false like they did? Also, does this error have any negative effect downstream? It appears as if my files get stored and thumbnails are created...
Author
Owner

@arminus commented on GitHub (Mar 20, 2022):

Ok, so meanwhile everything was backed up and I observe an issue in the App - for no apparent reason, thumbnails are missing:
Screenshot_20220320-134006

All pictures on that day were shot pretty much in sequence, no idea why there are thumbnails for some and nor for others, all are landscape and I can view those with missing thumbnails in the app.

@arminus commented on GitHub (Mar 20, 2022): Ok, so meanwhile everything was backed up and I observe an issue in the App - for no apparent reason, thumbnails are missing: ![Screenshot_20220320-134006](https://user-images.githubusercontent.com/683680/159162853-e9e832df-3b12-4b61-a8aa-32569c3c7eeb.jpg) All pictures on that day were shot pretty much in sequence, no idea why there are thumbnails for some and nor for others, all are landscape and I can view those with missing thumbnails in the app.
Author
Owner

@alextran1502 commented on GitHub (Mar 20, 2022):

Can you try to sign out and sign back in from your phone?

@alextran1502 commented on GitHub (Mar 20, 2022): Can you try to sign out and sign back in from your phone?
Author
Owner

@alextran1502 commented on GitHub (Mar 20, 2022):

This issue, plus some order issues with sharp I've run into when working kn the app have made me to rethink of a different method to get the thumbnail images by generating the thumbnail from the phone based on the asset's data and send it along with the raw images. I am experimenting with this to see if there is a lot of difference in term on performance and uploading time.

@alextran1502 commented on GitHub (Mar 20, 2022): This issue, plus some order issues with sharp I've run into when working kn the app have made me to rethink of a different method to get the thumbnail images by generating the thumbnail from the phone based on the asset's data and send it along with the raw images. I am experimenting with this to see if there is a lot of difference in term on performance and uploading time.
Author
Owner

@arminus commented on GitHub (Mar 20, 2022):

Can you try to sign out and sign back in from your phone?

doesn't make a difference - should it rescan anything?

@arminus commented on GitHub (Mar 20, 2022): > Can you try to sign out and sign back in from your phone? doesn't make a difference - should it rescan anything?
Author
Owner

@alextran1502 commented on GitHub (Mar 20, 2022):

It would retry to refresh the cache.

However, I am experimenting with getting thumbnail images from the phone. The result is very promising, with the much faster upload speed and cut dependency from Sharp and FFmpeg.

@alextran1502 commented on GitHub (Mar 20, 2022): It would retry to refresh the cache. However, I am experimenting with getting thumbnail images from the phone. The result is very promising, with the much faster upload speed and cut dependency from Sharp and FFmpeg.
Author
Owner

@alextran1502 commented on GitHub (Mar 22, 2022):

@arminus This issue should be fixed in the latest release

If you have access to a Postgres client, you can delete all the rows in the assets table and reupload all the files. If not, you can follow the steps below on the command line to delete all the existing assets info in the database after running docker-compose command.

  1. Access to bash shell of Postgres container
docker exec -it immich_postgres bash
  1. Access to Postgres database with the username specified in your .env file under the key DB_USERNAME. It is postgres for my setup.
psql -U postgres
  1. Connect to the target database, the database name is specified in your .env file under the key DB_DATABASE_NAME. It is immich for my setup
\c immich
  1. Delete all the assets information from the table assets
DELETE FROM assets;

Noe, the upload process should be faster and also should resolve the thumbnail issue.

Let me know how it goes.

@alextran1502 commented on GitHub (Mar 22, 2022): @arminus This issue should be fixed in the [latest release](https://github.com/alextran1502/immich/releases/tag/v1.3.0-dev) If you have access to a Postgres client, you can delete all the rows in the assets table and reupload all the files. If not, you can follow the steps below on the command line to delete all the existing assets info in the database after running `docker-compose` command. 1. Access to bash shell of Postgres container ``` docker exec -it immich_postgres bash ``` 2. Access to Postgres database with the username specified in your `.env` file under the key `DB_USERNAME`. It is `postgres` for my setup. ``` psql -U postgres ``` 3. Connect to the target database, the database name is specified in your `.env` file under the key `DB_DATABASE_NAME`. It is `immich` for my setup ``` \c immich ``` 4. Delete all the assets information from the table `assets` ``` DELETE FROM assets; ``` Noe, the upload process should be faster and also should resolve the thumbnail issue. Let me know how it goes.
Author
Owner

@arminus commented on GitHub (Mar 23, 2022):

Ok, the errors are gone and all thumbnails are getting created.

All in all though it seems less stable. I repeatedly had these messages:

[Nest] 29  - 03/23/2022, 9:32:07 AM   ERROR [createUserAsset] Error Create New Asset QueryFailedError: duplicate key value violates unique constraint "UQ_b599ab0bd9574958acb0b30a90e"
TypeError: Cannot read properties of undefined (reading 'id')
    at /usr/src/app/src/api-v1/asset/asset.controller.ts:62:64
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

after which I had to restart both the container as well as the app for the sync to continue.

Also, the immich_server container permanently eats ~ 15% of my CPU, even if it doesn't do anything. Is that the development watch mode? How can I turn that of? (tried setting production in the .env file, doesn't start in that case)

@arminus commented on GitHub (Mar 23, 2022): Ok, the errors are gone and all thumbnails are getting created. All in all though it seems less stable. I repeatedly had these messages: ``` [Nest] 29 - 03/23/2022, 9:32:07 AM ERROR [createUserAsset] Error Create New Asset QueryFailedError: duplicate key value violates unique constraint "UQ_b599ab0bd9574958acb0b30a90e" TypeError: Cannot read properties of undefined (reading 'id') at /usr/src/app/src/api-v1/asset/asset.controller.ts:62:64 at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5) ``` after which I had to restart both the container as well as the app for the sync to continue. Also, the immich_server container permanently eats ~ 15% of my CPU, even if it doesn't do anything. Is that the development watch mode? How can I turn that of? (tried setting production in the .env file, doesn't start in that case)
Author
Owner

@alextran1502 commented on GitHub (Mar 23, 2022):

Did you delete the assets from the database following the steps in the previous post? This error means that you have existing assets (files) and try to rewrite them into the database with the existing assets' information. I would assume you only deleted the files in the shared folder?

My CPU on standby shows 1.5 to 3 % of usage I am using docker stats to see the usage stats. I have to investigate why it is high on other machines.

@alextran1502 commented on GitHub (Mar 23, 2022): Did you delete the assets from the database following the steps in the previous post? This error means that you have existing assets (files) and try to rewrite them into the database with the existing assets' information. I would assume you only deleted the files in the shared folder? My CPU on standby shows 1.5 to 3 % of usage I am using `docker stats` to see the usage stats. I have to investigate why it is high on other machines.
Author
Owner

@arminus commented on GitHub (Mar 23, 2022):

Of course I deleted the contents from the assets table. I think that at some point during the sync (> 2000 images and videos), something "happend", i.e. it stopped from some reason. Maybe when it tries to restart it produces that error.

@arminus commented on GitHub (Mar 23, 2022): Of course I deleted the contents from the assets table. I think that at some point during the sync (> 2000 images and videos), something "happend", i.e. it stopped from some reason. Maybe when it tries to restart it produces that error.
Author
Owner

@alextran1502 commented on GitHub (Mar 23, 2022):

Thank you for the feedback, let me think about this issue.

@alextran1502 commented on GitHub (Mar 23, 2022): Thank you for the feedback, let me think about this issue.
Author
Owner

@arminus commented on GitHub (Mar 26, 2022):

The original issue is resolved so I think this can be closed. See also #75

@arminus commented on GitHub (Mar 26, 2022): The original issue is resolved so I think this can be closed. See also #75
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#26