immich-go icon indicating copy to clipboard operation
immich-go copied to clipboard

How does "asset upgraded" work?

Open clnhlzmn opened this issue 9 months ago • 10 comments

I think I like the idea of immich-go "upgrading" assets on the server when I upload, but it's not clear to me exactly how that works.

Here is my workflow:

  1. Export a jpeg (or many) from darktable to an "exports" directory.
  2. Run a script that calls immich-go upload from-folder /exports ....
  3. The script then, on success of immich-go, will remove the assets from the exports directory.
  4. Sometimes I'll go back into darktable and make a "duplicate" of an old image, change some settings and re-export an old photo.
  5. Usually I want to replace the old export on the immich server with the new (presumably better) export. It seems like immich-go attempts to do this, but it's not clear to me if it's working correctly.
  6. Run the script again. In some cases I have seen the "server's asset upgraded .." output from immich-go, but in other cases I have seen "server has a better asset".
  7. Then if I make a third export and run the script a third time I see "server's asset upgraded", but the export in my timeline hasn't changed but the trashed asset has changed..?

So my questions are

  1. What does "server has a better asset" mean and why would I see that when uploading an image with the same name and date (certainly immich-go isn't deciding that the edits I made to the new export are not as good as the edits already on the server..).
  2. Why would immich-go replace an asset in the trash? On that note, why would "replacing" an asset involve the trash at all?

I have tried this with and without --overwrite and I wasn't convinced either way was working correctly. I know that's not very helpful but I will keep tinkering to see if I can make some sense of it.

clnhlzmn avatar Jun 02 '25 16:06 clnhlzmn

The upgrade function intention if to replace the compressed version of a photo found in a google takeout with the full size take by the camera. So better is larger...

This doesn't fit well with your workflow, where better is the last edited photo. The --overwrite option just force the replacement of server photo with the one in your input.

simulot avatar Jun 02 '25 17:06 simulot

Ok that makes sense thanks!

However, using --overwrite I'm seeing the assets being replaced in the trash, not in the main timeline. I'm wondering now if that's why our was somehow related to me uploading the "same" image without the --overwrite option first..

I'll keep experimenting and let you know if there is really an issue here.

clnhlzmn avatar Jun 02 '25 17:06 clnhlzmn

I just confirmed that this is weird. Here's what I did:

  1. Create a new export from DT (let's say the filename is A.jpg)
  2. Upload with immich-go upload from-folder --overwrite. Here I see "uploaded" as expected.
  3. That works, the file is on the server
  4. Go back to DT, create a new export of A.jpg (filename remains the same)
  5. Upload again with the same command. Here I see "server's asset replaced" as expected.
  6. This also works as expected, the new edit of A.jpg appears in my timeline, and the old version is no longer in the timeline (it seems the old version is going to the trash).
  7. Now I go back to DT and make a third export of A.jpg.
  8. Upload again the same way. Here I see "server's asset replaced" as expected.
  9. Go to immich and the timeline shows the second upload, not the third as expected.
  10. I can go to the trash and see two versions of A.jpg: the first and third uploads. It seems like immich-go is confused by the second upload moving the asset to the trash so on the third upload it is not replacing the main asset but is instead just adding it to the trash (or something like that?)

clnhlzmn avatar Jun 02 '25 17:06 clnhlzmn

Related question: is it possible to completely disable this feature? Can I have immich-go just take the files it finds and give them to the upload API and let the immich server deal with duplicates (if any)? That would match the behavior of immich-cli (I think) and that would be acceptable for me for now, but I really like the way immich-go is a single executable.

However just re-stating I do like the idea of "replacing" an asset because that makes it easy for me to make edits to old raw files, re-upload the exports, and have them seamlessly replaced which ideally would preserve their membership in any albums and things like that. If I just force uploads for new edits then I'll have to go manually re-add those exports to any albums they may be in.

clnhlzmn avatar Jun 02 '25 19:06 clnhlzmn

Maybe you are fighting against the immich's cache?

simulot avatar Jun 04 '25 09:06 simulot

Hmm I'm not sure what you mean. The only cache I see referenced in the immich docs is for machine learning and I'm not sure that matters here.

clnhlzmn avatar Jun 04 '25 12:06 clnhlzmn

The web page isn't dynamically updated after an upload. Press Ctrl+R on the home page to force a refresh of the page.

simulot avatar Jun 04 '25 16:06 simulot

oooh I gotcha.. I'll try again and see if that matters

clnhlzmn avatar Jun 04 '25 16:06 clnhlzmn

No I just confirmed refreshing the page, even clearing all site data and refreshing, doesn't change anything. The sequence of

  1. "uploaded"
  2. "server's asset upgraded"
  3. "server's asset upgraded"

results in the third step (the second "upgrade") happening on the trashed asset, not the main version.

Here are the logs from those three steps when I just tried this:

Step 1:

2025-06-04 13:24:12 INF immich-go version:0.26.3,  commit:9b96a3d50e12471ca3dcc3e7d65db4f741eaa428, date:2025-05-24T18:32:16Z
2025-06-04 13:24:12 INF Running environment: architecture=amd64 os=linux
2025-06-04 13:24:12 INF Command: immich-go upload from-folder
2025-06-04 13:24:12 INF Flags:
2025-06-04 13:24:12 INF  --admin-api-key=
2025-06-04 13:24:12 INF  --album-path-joiner= / 
2025-06-04 13:24:12 INF  --album-picasa=false
2025-06-04 13:24:12 INF  --api-key=************************************7Dnc
2025-06-04 13:24:12 INF  --api-trace=false
2025-06-04 13:24:12 INF  --ban-file='@eaDir/', '@__thumb/', 'SYNOFILE_THUMB_*.*', 'Lightroom Catalog/', 'thumbnails/', '.DS_Store/', '/._*', '.photostructure/'
2025-06-04 13:24:12 INF  --client-timeout=20m0s
2025-06-04 13:24:12 INF  --date-from-name=true
2025-06-04 13:24:12 INF  --date-range=unset
2025-06-04 13:24:12 INF  --device-uuid=663bbbed58f2
2025-06-04 13:24:12 INF  --dry-run=false
2025-06-04 13:24:12 INF  --exclude-extensions=
2025-06-04 13:24:12 INF  --folder-as-album=NONE
2025-06-04 13:24:12 INF  --folder-as-tags=false
2025-06-04 13:24:12 INF  --help=false
2025-06-04 13:24:12 INF  --ignore-sidecar-files=false
2025-06-04 13:24:12 INF  --include-extensions=
2025-06-04 13:24:12 INF  --include-type=
2025-06-04 13:24:12 INF  --into-album=
2025-06-04 13:24:12 INF  --log-file=/config/.cache/immich-go/immich-go_2025-06-04_13-24-12.log
2025-06-04 13:24:12 INF  --log-level=INFO
2025-06-04 13:24:12 INF  --log-type=text
2025-06-04 13:24:12 INF  --manage-burst=NoStack
2025-06-04 13:24:12 INF  --manage-epson-fastfoto=false
2025-06-04 13:24:12 INF  --manage-heic-jpeg=NoStack
2025-06-04 13:24:12 INF  --manage-raw-jpeg=NoStack
2025-06-04 13:24:12 INF  --no-ui=true
2025-06-04 13:24:12 INF  --on-server-errors=stop
2025-06-04 13:24:12 INF  --overwrite=true
2025-06-04 13:24:12 INF  --pause-immich-jobs=false
2025-06-04 13:24:12 INF  --recursive=true
2025-06-04 13:24:12 INF  --server=<server>
2025-06-04 13:24:12 INF  --session-tag=false
2025-06-04 13:24:12 INF  --skip-verify-ssl=false
2025-06-04 13:24:12 INF  --tag=[]
2025-06-04 13:24:12 INF  --time-zone=
2025-06-04 13:24:12 INF Arguments:
2025-06-04 13:24:12 INF   "/tmp/tmp.FkoYXMBCAG"
2025-06-04 13:24:12 INF Connection to the server <server>
2025-06-04 13:24:16 INF Server status: OK
2025-06-04 13:24:16 INF Server information: version=v1.134.0
2025-06-04 13:24:16 INF Connected, user: <user>, ID: 5b82ea20-cd5c-4f62-ba07-cef86e2ac937
2025-06-04 13:24:16 INF scanned image file file=tmp.FkoYXMBCAG:20250601-200720.jpg
2025-06-04 13:24:25 INF Assets on the server: 28724
2025-06-04 13:26:21 INF got album from the server <albums>
2025-06-04 13:24:26 INF uploaded file=tmp.FkoYXMBCAG:20250601-200720.jpg
2025-06-04 13:24:26 INF 
2025-06-04 13:24:26 INF Input analysis:
2025-06-04 13:24:26 INF ---------------
2025-06-04 13:24:26 INF scanned image file                      :       1
2025-06-04 13:24:26 INF scanned video file                      :       0
2025-06-04 13:24:26 INF scanned sidecar file                    :       0
2025-06-04 13:24:26 INF discarded file                          :       0
2025-06-04 13:24:26 INF unsupported file                        :       0
2025-06-04 13:24:26 INF file duplicated in the input            :       0
2025-06-04 13:24:26 INF associated metadata file                :       0
2025-06-04 13:24:26 INF missing associated metadata file        :       0
2025-06-04 13:24:26 INF 
2025-06-04 13:24:26 INF Uploading:
2025-06-04 13:24:26 INF ----------
2025-06-04 13:24:26 INF uploaded                                :       1
2025-06-04 13:24:26 INF upload error                            :       0
2025-06-04 13:24:26 INF file not selected                       :       0
2025-06-04 13:24:26 INF server's asset upgraded with the input  :       0
2025-06-04 13:24:26 INF server has same asset                   :       0
2025-06-04 13:24:26 INF server has a better asset               :       0
2025-06-04 13:24:26 INF 
2025-06-04 13:24:26 INF Check the log file: /config/.cache/immich-go/immich-go_2025-06-04_13-24-12.log

Step 2:

2025-06-04 13:26:08 INF immich-go version:0.26.3,  commit:9b96a3d50e12471ca3dcc3e7d65db4f741eaa428, date:2025-05-24T18:32:16Z
2025-06-04 13:26:08 INF Running environment: architecture=amd64 os=linux
2025-06-04 13:26:08 INF Command: immich-go upload from-folder
2025-06-04 13:26:08 INF Flags:
2025-06-04 13:26:08 INF  --admin-api-key=
2025-06-04 13:26:08 INF  --album-path-joiner= / 
2025-06-04 13:26:08 INF  --album-picasa=false
2025-06-04 13:26:08 INF  --api-key=************************************7Dnc
2025-06-04 13:26:08 INF  --api-trace=false
2025-06-04 13:26:08 INF  --ban-file='@eaDir/', '@__thumb/', 'SYNOFILE_THUMB_*.*', 'Lightroom Catalog/', 'thumbnails/', '.DS_Store/', '/._*', '.photostructure/'
2025-06-04 13:26:08 INF  --client-timeout=20m0s
2025-06-04 13:26:08 INF  --date-from-name=true
2025-06-04 13:26:08 INF  --date-range=unset
2025-06-04 13:26:08 INF  --device-uuid=663bbbed58f2
2025-06-04 13:26:08 INF  --dry-run=false
2025-06-04 13:26:08 INF  --exclude-extensions=
2025-06-04 13:26:08 INF  --folder-as-album=NONE
2025-06-04 13:26:08 INF  --folder-as-tags=false
2025-06-04 13:26:08 INF  --help=false
2025-06-04 13:26:08 INF  --ignore-sidecar-files=false
2025-06-04 13:26:08 INF  --include-extensions=
2025-06-04 13:26:08 INF  --include-type=
2025-06-04 13:26:08 INF  --into-album=
2025-06-04 13:26:08 INF  --log-file=/config/.cache/immich-go/immich-go_2025-06-04_13-26-08.log
2025-06-04 13:26:08 INF  --log-level=INFO
2025-06-04 13:26:08 INF  --log-type=text
2025-06-04 13:26:08 INF  --manage-burst=NoStack
2025-06-04 13:26:08 INF  --manage-epson-fastfoto=false
2025-06-04 13:26:08 INF  --manage-heic-jpeg=NoStack
2025-06-04 13:26:08 INF  --manage-raw-jpeg=NoStack
2025-06-04 13:26:08 INF  --no-ui=true
2025-06-04 13:26:08 INF  --on-server-errors=stop
2025-06-04 13:26:08 INF  --overwrite=true
2025-06-04 13:26:08 INF  --pause-immich-jobs=false
2025-06-04 13:26:08 INF  --recursive=true
2025-06-04 13:26:08 INF  --server=<server>
2025-06-04 13:26:08 INF  --session-tag=false
2025-06-04 13:26:08 INF  --skip-verify-ssl=false
2025-06-04 13:26:08 INF  --tag=[]
2025-06-04 13:26:08 INF  --time-zone=
2025-06-04 13:26:08 INF Arguments:
2025-06-04 13:26:08 INF   "/tmp/tmp.69Dr2Kvmvj"
2025-06-04 13:26:08 INF Connection to the server <server>
2025-06-04 13:26:12 INF Server status: OK
2025-06-04 13:26:12 INF Server information: version=v1.134.0
2025-06-04 13:26:12 INF Connected, user: <user>, ID: 5b82ea20-cd5c-4f62-ba07-cef86e2ac937
2025-06-04 13:26:12 INF scanned image file file=tmp.69Dr2Kvmvj:20250601-200720.jpg
2025-06-04 13:26:21 INF Assets on the server: 28725
2025-06-04 13:26:21 INF got album from the server <albums>
2025-06-04 13:26:21 INF server's asset upgraded with the input file=tmp.69Dr2Kvmvj:20250601-200720.jpg
2025-06-04 13:26:21 INF 
2025-06-04 13:26:21 INF Input analysis:
2025-06-04 13:26:21 INF ---------------
2025-06-04 13:26:21 INF scanned image file                      :       1
2025-06-04 13:26:21 INF scanned video file                      :       0
2025-06-04 13:26:21 INF scanned sidecar file                    :       0
2025-06-04 13:26:21 INF discarded file                          :       0
2025-06-04 13:26:21 INF unsupported file                        :       0
2025-06-04 13:26:21 INF file duplicated in the input            :       0
2025-06-04 13:26:21 INF associated metadata file                :       0
2025-06-04 13:26:21 INF missing associated metadata file        :       0
2025-06-04 13:26:21 INF 
2025-06-04 13:26:21 INF Uploading:
2025-06-04 13:26:21 INF ----------
2025-06-04 13:26:21 INF uploaded                                :       0
2025-06-04 13:26:21 INF upload error                            :       0
2025-06-04 13:26:21 INF file not selected                       :       0
2025-06-04 13:26:21 INF server's asset upgraded with the input  :       1
2025-06-04 13:26:21 INF server has same asset                   :       0
2025-06-04 13:26:21 INF server has a better asset               :       0
2025-06-04 13:26:21 INF 
2025-06-04 13:26:21 INF Check the log file: /config/.cache/immich-go/immich-go_2025-06-04_13-26-08.log

Step 3:

2025-06-04 13:26:49 INF immich-go version:0.26.3,  commit:9b96a3d50e12471ca3dcc3e7d65db4f741eaa428, date:2025-05-24T18:32:16Z
2025-06-04 13:26:49 INF Running environment: architecture=amd64 os=linux
2025-06-04 13:26:49 INF Command: immich-go upload from-folder
2025-06-04 13:26:49 INF Flags:
2025-06-04 13:26:49 INF  --admin-api-key=
2025-06-04 13:26:49 INF  --album-path-joiner= / 
2025-06-04 13:26:49 INF  --album-picasa=false
2025-06-04 13:26:49 INF  --api-key=************************************7Dnc
2025-06-04 13:26:49 INF  --api-trace=false
2025-06-04 13:26:49 INF  --ban-file='@eaDir/', '@__thumb/', 'SYNOFILE_THUMB_*.*', 'Lightroom Catalog/', 'thumbnails/', '.DS_Store/', '/._*', '.photostructure/'
2025-06-04 13:26:49 INF  --client-timeout=20m0s
2025-06-04 13:26:49 INF  --date-from-name=true
2025-06-04 13:26:49 INF  --date-range=unset
2025-06-04 13:26:49 INF  --device-uuid=663bbbed58f2
2025-06-04 13:26:49 INF  --dry-run=false
2025-06-04 13:26:49 INF  --exclude-extensions=
2025-06-04 13:26:49 INF  --folder-as-album=NONE
2025-06-04 13:26:49 INF  --folder-as-tags=false
2025-06-04 13:26:49 INF  --help=false
2025-06-04 13:26:49 INF  --ignore-sidecar-files=false
2025-06-04 13:26:49 INF  --include-extensions=
2025-06-04 13:26:49 INF  --include-type=
2025-06-04 13:26:49 INF  --into-album=
2025-06-04 13:26:49 INF  --log-file=/config/.cache/immich-go/immich-go_2025-06-04_13-26-49.log
2025-06-04 13:26:49 INF  --log-level=INFO
2025-06-04 13:26:49 INF  --log-type=text
2025-06-04 13:26:49 INF  --manage-burst=NoStack
2025-06-04 13:26:49 INF  --manage-epson-fastfoto=false
2025-06-04 13:26:49 INF  --manage-heic-jpeg=NoStack
2025-06-04 13:26:49 INF  --manage-raw-jpeg=NoStack
2025-06-04 13:26:49 INF  --no-ui=true
2025-06-04 13:26:49 INF  --on-server-errors=stop
2025-06-04 13:26:49 INF  --overwrite=true
2025-06-04 13:26:49 INF  --pause-immich-jobs=false
2025-06-04 13:26:49 INF  --recursive=true
2025-06-04 13:26:49 INF  --server=<server>
2025-06-04 13:26:49 INF  --session-tag=false
2025-06-04 13:26:49 INF  --skip-verify-ssl=false
2025-06-04 13:26:49 INF  --tag=[]
2025-06-04 13:26:49 INF  --time-zone=
2025-06-04 13:26:49 INF Arguments:
2025-06-04 13:26:49 INF   "/tmp/tmp.sSvgr9H8aL"
2025-06-04 13:26:49 INF Connection to the server <server>
2025-06-04 13:26:54 INF Server status: OK
2025-06-04 13:26:54 INF Server information: version=v1.134.0
2025-06-04 13:26:54 INF Connected, user: <user>, ID: 5b82ea20-cd5c-4f62-ba07-cef86e2ac937
2025-06-04 13:26:54 INF scanned image file file=tmp.sSvgr9H8aL:20250601-200720.jpg
2025-06-04 13:27:03 INF Assets on the server: 28726
2025-06-04 13:27:03 INF got album from the server <albums>
2025-06-04 13:27:03 INF server's asset upgraded with the input file=tmp.sSvgr9H8aL:20250601-200720.jpg
2025-06-04 13:27:03 INF 
2025-06-04 13:27:03 INF Input analysis:
2025-06-04 13:27:03 INF ---------------
2025-06-04 13:27:03 INF scanned image file                      :       1
2025-06-04 13:27:03 INF scanned video file                      :       0
2025-06-04 13:27:03 INF scanned sidecar file                    :       0
2025-06-04 13:27:03 INF discarded file                          :       0
2025-06-04 13:27:03 INF unsupported file                        :       0
2025-06-04 13:27:03 INF file duplicated in the input            :       0
2025-06-04 13:27:03 INF associated metadata file                :       0
2025-06-04 13:27:03 INF missing associated metadata file        :       0
2025-06-04 13:27:03 INF 
2025-06-04 13:27:03 INF Uploading:
2025-06-04 13:27:03 INF ----------
2025-06-04 13:27:03 INF uploaded                                :       0
2025-06-04 13:27:03 INF upload error                            :       0
2025-06-04 13:27:03 INF file not selected                       :       0
2025-06-04 13:27:03 INF server's asset upgraded with the input  :       1
2025-06-04 13:27:03 INF server has same asset                   :       0
2025-06-04 13:27:03 INF server has a better asset               :       0
2025-06-04 13:27:03 INF 
2025-06-04 13:27:03 INF Check the log file: /config/.cache/immich-go/immich-go_2025-06-04_13-26-49.log

clnhlzmn avatar Jun 04 '25 17:06 clnhlzmn

Could you turn on the --api-trace and share the log?

simulot avatar Jun 04 '25 19:06 simulot