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

error in heic-convert-worker causes uploads to stall out #3277

Open
kung-foo opened this issue Sep 15, 2024 · 3 comments
Open

error in heic-convert-worker causes uploads to stall out #3277

kung-foo opened this issue Sep 15, 2024 · 3 comments
Labels
- photos Relates to the Ente Photos --desktop Plaftorm is desktop

Comments

@kung-foo
Copy link

kung-foo commented Sep 15, 2024

Description

When uploading a batch of images (via Google Takeout), there appears to be a error converting some of the files. This causes all four workers to stall until the app is restarted.

image

[2024-09-15T19:42:18+02:00] [rndr] [info] Uploading IMG_5375(1).HEIC^M
[2024-09-15T19:42:18+02:00] [rndr] [info] Uploaded IMG_5377(1).heic with result 6 (UPLOADED)^M
[2024-09-15T19:42:18+02:00] [rndr] [info] Uploading IMG_5375.HEIC^M
[2024-09-15T19:42:20+02:00] [rndr] [info] Uploaded IMG_5377.HEIC with result 6 (UPLOADED)^M
[2024-09-15T19:42:20+02:00] [rndr] [info] Uploading IMG_5374(1).HEIC^M
[2024-09-15T19:42:21+02:00] [rndr] [info] Uploaded IMG_5376.HEIC with result 6 (UPLOADED)^M
[2024-09-15T19:42:22+02:00] [rndr] [info] Uploading IMG_5374.HEIC^M
[2024-09-15T19:42:23+02:00] [rndr] [error] Got error event from worker: {"event":{"isTrusted":true},"name":"heic-convert-worker"}^M
[2024-09-15T19:42:23+02:00] [rndr] [error] Unhandled error^M
[2024-09-15T19:42:46+02:00] [rndr] [info] Syncing location entities localEntitiesCount: 2^M
[2024-09-15T19:42:46+02:00] [rndr] [info] Syncing location entities syncTime: 1726326171046405^M
[2024-09-15T19:42:48+02:00] [rndr] [info] Uploaded IMG_5375(1).HEIC with result 6 (UPLOADED)^M
[2024-09-15T19:42:49+02:00] [rndr] [info] Uploading IMG_5373(1).HEIC^M
[2024-09-15T19:42:49+02:00] [rndr] [info] Uploaded IMG_5375.HEIC with result 6 (UPLOADED)^M
[2024-09-15T19:42:50+02:00] [rndr] [info] Uploading IMG_5373.HEIC^M
[2024-09-15T19:42:50+02:00] [rndr] [error] Got error event from worker: {"event":{"isTrusted":true},"name":"heic-convert-worker"}^M
[2024-09-15T19:42:50+02:00] [rndr] [error] Unhandled error^M
[2024-09-15T19:42:51+02:00] [rndr] [error] Got error event from worker: {"event":{"isTrusted":true},"name":"heic-convert-worker"}^M
[2024-09-15T19:42:51+02:00] [rndr] [error] Unhandled error^M
[2024-09-15T19:42:51+02:00] [rndr] [info] Uploaded IMG_5374(1).HEIC with result 6 (UPLOADED)^M
[2024-09-15T19:42:51+02:00] [rndr] [info] Uploading IMG_5372(1).HEIC^M
[2024-09-15T19:42:52+02:00] [rndr] [error] Got error event from worker: {"event":{"isTrusted":true},"name":"heic-convert-worker"}^M
[2024-09-15T19:42:52+02:00] [rndr] [error] Unhandled error^M
[2024-09-15T19:47:34+02:00] [rndr] [info] Syncing location entities localEntitiesCount: 2^M
[2024-09-15T19:47:34+02:00] [rndr] [info] Syncing location entities syncTime: 1726326171046405^M

console log:

_app-30c7e828c1ed2a2c.js:24 [error] Got error event from worker: {"event":{"isTrusted":true},"name":"heic-convert-worker"}
g @ _app-30c7e828c1ed2a2c.js:24
_app-30c7e828c1ed2a2c.js:24 [error] Unhandled error
g @ _app-30c7e828c1ed2a2c.js:24
c87b801d.41d2403723d3f507.js:1 Aborted()
d @ c87b801d.41d2403723d3f507.js:1
c87b801d.41d2403723d3f507.js:1 Uncaught RuntimeError: Aborted(). Build with -sASSERTIONS for more info.
    at d (c87b801d.41d2403723d3f507.js:1:3213)
    at t (c87b801d.41d2403723d3f507.js:24:350)
    at 00318632:0x1f79
    at 00318632:0x2794
    at 00318632:0x831ab
    at 00318632:0x14eba
    at 00318632:0x3c0fc
    at 00318632:0x9571a
    at 00318632:0x95b2d
    at Object.heif_js_decode_image2 (eval at Ia (c87b801d.41d2403723d3f507.js:3:36482), <anonymous>:10:10)
_app-30c7e828c1ed2a2c.js:24 [error] Got error event from worker: {"event":{"isTrusted":true},"name":"heic-convert-worker"}
g @ _app-30c7e828c1ed2a2c.js:24
c87b801d.41d2403723d3f507.js:1 Uncaught RuntimeError: Aborted(). Build with -sASSERTIONS for more info.
    at d (c87b801d.41d2403723d3f507.js:1:3213)
    at t (c87b801d.41d2403723d3f507.js:24:350)
    at 00318632:0x1f79
    at 00318632:0x2794
    at 00318632:0x1e47b
    at 00318632:0x3c05b
    at 00318632:0x9571a
    at 00318632:0x95b2d
    at Object.heif_js_decode_image2 (eval at Ia (c87b801d.41d2403723d3f507.js:3:36482), <anonymous>:10:10)
    at gA.<anonymous> (c87b801d.41d2403723d3f507.js:24:14439)
_app-30c7e828c1ed2a2c.js:24 [error] Unhandled error
g @ _app-30c7e828c1ed2a2c.js:24
c87b801d.41d2403723d3f507.js:1 Aborted()
d @ c87b801d.41d2403723d3f507.js:1
_app-30c7e828c1ed2a2c.js:24 [error] Got error event from worker: {"event":{"isTrusted":true},"name":"heic-convert-worker"}
g @ _app-30c7e828c1ed2a2c.js:24
c87b801d.41d2403723d3f507.js:1 Uncaught RuntimeError: Aborted(). Build with -sASSERTIONS for more info.
    at d (c87b801d.41d2403723d3f507.js:1:3213)
    at t (c87b801d.41d2403723d3f507.js:24:350)
    at 00318632:0x1f79
    at 00318632:0x2794
    at 00318632:0x1a988
    at 00318632:0x3c05b
    at 00318632:0x9571a
    at 00318632:0x95b2d
    at Object.heif_js_decode_image2 (eval at Ia (c87b801d.41d2403723d3f507.js:3:36482), <anonymous>:10:10)
    at gA.<anonymous> (c87b801d.41d2403723d3f507.js:24:14439)

Version

v1.7.4

What product are you using?

Ente Photos

What platform are you using?

Mobile - iOS, Desktop - Windows

@mnvr mnvr added --desktop Plaftorm is desktop - photos Relates to the Ente Photos and removed triage labels Sep 17, 2024
@mnvr
Copy link
Member

mnvr commented Sep 17, 2024

Thank you for the details. If possible, it would be great if you could send a sample to support@ente.io so that we can try to reproduce this.

There are two issues here:

  1. The particular files not being decoded by the HEIC conversion library (we use libheif).
  2. The workers stalling.

Normally errors in the worker in be caught, and the app will move forward without a thumbnail, but for these files it looks like libheif is hitting an unrecoverable assert that comlink cannot catch.

@kung-foo
Copy link
Author

Hi @mnvr, I'll send a sample and reference this issue. This doesn't seem to be a "rare" incident though. I'm in the process of doing a Google Takeout with ~165000 photos, and the desktop app makes it about 1000 photos before hanging. This necessitates an app restart and it continues on (not sure if it skips the file, or if it randomizes the input list). Note: the files open just fine in xviewer on Linux.

@mnvr
Copy link
Member

mnvr commented Sep 17, 2024

Thank you for the samples. There does not seem to be anything specific to these files, we were able to import them just fine on both Ente Photos Windows and macOS (on macOS we have an alternative non-libheif conversion method, and that also worked for these files, thus it's nothing in those sample files). So I'm not sure what's going on.

Meanwhile, as a workaround, you could either (a) complete your upload sans the HEICs, then later upload them from the web/mobile app, or (b) just try the entire upload via the web or mobile app. The web app might also hit the same scenario, since the line of code which triggers the web worker for the HEIC conversion is the same for the Windows desktop and web apps, but it is also possible that the web app might work because of the difference in the browser runtime vs the Electron app runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- photos Relates to the Ente Photos --desktop Plaftorm is desktop
Projects
None yet
Development

No branches or pull requests

2 participants