Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VipsJpeg: out of order read at line 0 #65

Closed
arminus opened this issue Mar 20, 2022 · 11 comments
Closed

VipsJpeg: out of order read at line 0 #65

arminus opened this issue Mar 20, 2022 · 11 comments

Comments

@arminus
Copy link

arminus commented 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...

@arminus
Copy link
Author

arminus commented 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.

@alextran1502
Copy link
Contributor

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

@alextran1502
Copy link
Contributor

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.

@arminus
Copy link
Author

arminus commented 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?

@alextran1502
Copy link
Contributor

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
Copy link
Contributor

alextran1502 commented 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.

@arminus
Copy link
Author

arminus commented 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)

@alextran1502
Copy link
Contributor

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.

@arminus
Copy link
Author

arminus commented 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.

@alextran1502
Copy link
Contributor

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

@arminus
Copy link
Author

arminus commented Mar 26, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants