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=DeleteAsset, 400 Bad Request on latest RC v0.23.0-RC3 #570

Open
RollPitchYall opened this issue Dec 19, 2024 · 28 comments
Open

error=DeleteAsset, 400 Bad Request on latest RC v0.23.0-RC3 #570

RollPitchYall opened this issue Dec 19, 2024 · 28 comments
Assignees

Comments

@RollPitchYall
Copy link

when using the latest release candidate "@simulot simulot
v0.23.0-RC3
cbba865
immich-go v0.23.0-RC3 πŸ—οΈ user feedback included πŸ—οΈ

I get the following error after some time of uploading. Interestingly although the stream of data about upload progress stops in cmd, when canceled and resumed, it seems like it makes a bit of extra progress after an error, but my servers network usage shows as stopping shortly after the error occurs. When restarted the error does not occur on the same asset, but reoccurs later
2024-12-18 14:53:24 ERR error error=DeleteAsset, DELETE, http://192.168.1.10:30041/api/assets, 400 Bad Request

Im running Windows, immich version v1.122.2 in docker on truenas scale
my command:
.\immich-go upload from-google-photos --server=http://192.168.1.10:30041 --api-key=redactedI .\takeout-20241216T005834Z --dry-run=true

Log file:
https://share.archibald.top/s/rQG8KoPSuXTTecn8MDNEUPIUOIPgFvz3
this link expires in one week

image

@houruomu
Copy link

second this. I face the same issue.

@yusukeoshiro
Copy link

same here

@yusukeoshiro
Copy link

yusukeoshiro commented Dec 23, 2024

Let me just add a bit more to replicate the issue.
I think the issue to DeleteAsset occurs when there are are more than 1 users.
In my case, I've uploaded my Google Photos images and then I tried to upload my wife's images using different API key.
The server rightfully denies my wife's request to delete my asset.
It looks like immich-go didn't handle the error correctly?
Users probably expect immich-go to ignore this error and continue with next assets and leave it up to them to dedupe the images themselves.

edit.
I realized same thing happens even when the asset is owned by me.

edit.
I tried with latest stable release 0.22.1 and it worked OK.

./immich-go -server=http://192.168.86.124:2283 -key=REDACTED upload -create-albums -google-photos /mnt/pool-01/photos/Takeout/

@simulot
Copy link
Owner

simulot commented Dec 24, 2024

Thank for your report!

The RC code is a complete refactoring... So it's difficult to compare it with the latest release.

I need a way to trigger the problem on my dev system.

@bedpan
Copy link

bedpan commented Jan 1, 2025

Just setting up Immich for the first time. Got server running. Manually imported a few photos. Grabbed RC3 of Immich-go as its looking like its near release may as well go for it. I got the same error as above.

Went back to 22.1 and appears to be working. Very slow.. But that is likely a setup issue. More troubleshooting (but unrelated).

@simulot
Copy link
Owner

simulot commented Jan 1, 2025

The problem isn't systematic. So far I haven't found a way to narrow down the problem.
Run the program with the flag -api-trace and share the logs if this happens again

@bedpan
Copy link

bedpan commented Jan 1, 2025

The problem isn't systematic. So far I haven't found a way to narrow down the problem. Run the program with the flag -api-trace and share the logs if this happens again

I am mid import on 22.1. Once it is done I will spin up a new instance and try again with RC3 as suggested.

@simulot
Copy link
Owner

simulot commented Jan 1, 2025

I have released a version rc5....

@bedpan
Copy link

bedpan commented Jan 2, 2025

I have released a version rc5....

Re-ran RC3 that I had the error with to confirm it was still and issue.. Error occurred as above.

Ran RC5 and it appears to resolve the issue (its not done the import yet but well past what RC3 would make it to). If I notice anything overnight as it runs I will update.

@simulot
Copy link
Owner

simulot commented Jan 2, 2025

Delete asset fails from times to times.
I'm using delete asset to replace immich photo version by a better version coming from the input. Since I wrote this code, a new API call has been added: replaceAsset

It would simplify my code... Let see how it goes.

@bedpan
Copy link

bedpan commented Jan 2, 2025

et to replace immich photo version by a better version coming from the input. Since I wrote this code, a new API call has been added: replaceAsset

It did fail.

running again with api-trace

edit - deleted the screen shot. noticed it had Lat/Long in it.

@simulot
Copy link
Owner

simulot commented Jan 2, 2025

This drives me nuts
Would you give a try to the very last build?

@bedpan
Copy link

bedpan commented Jan 2, 2025

This drives me nuts Would you give a try to the very last build?

No problem at all. I am out most of today but will poke where I can.
It's running the api-trace now I don't imagine that will take long.

@bedpan
Copy link

bedpan commented Jan 2, 2025

This drives me nuts Would you give a try to the very last build?

What the api-trace do? Its further now then I have seen it with the two versions of the RC that I have run. Still a long ways to go though. (5% on uploading)

@simulot
Copy link
Owner

simulot commented Jan 2, 2025

the API-TRACE creates a file with all call to the server, with exact parameters and server response. This give more context to the error.

@bedpan
Copy link

bedpan commented Jan 2, 2025

the API-TRACE creates a file with all call to the server, with exact parameters and server response. This give more context to the error.

Got ya. Well.. Still running. 6% now. Out for the day so likely tomorrow before I can advise much.

@bedpan
Copy link

bedpan commented Jan 3, 2025

Wellllll... RC5 failed first go round, then went all the way once I put in the API-TRACE.

I should be around the computer a bunch tomorrow if there is any testing I can do for you.

the API-TRACE creates a file with all call to the server, with exact parameters and server response. This give more context to the error.

@bedpan
Copy link

bedpan commented Jan 3, 2025

just ran again and had the error with api-trace on.. Where is the file written to on Windows? I don't see it in Appdata or the folder with the logs.

Screenshot 2025-01-02 215057

@simulot
Copy link
Owner

simulot commented Jan 3, 2025

Just press enter at the end. The full path is printed on the screen.
You can find log files here:

Linux $HOME/.cache/immich-go/immich-go_YYYY-MM-DD_HH-MI-SS.log
Windows %LocalAppData%\immich-go\immich-go_YYYY-MM-DD_HH-MI-SS.log
macOS $HOME/Library/Caches/immich-go/immich-go_YYYY-MM-DD_HH-MI-SS.log

@bedpan
Copy link

bedpan commented Jan 3, 2025

Whats the best way to get you this 200mb file in a no public setting? I would rather not share the GPS data.

Just press enter at the end. The full path is printed on the screen. You can find log files here:


@bedpan
Copy link

bedpan commented Jan 3, 2025

I went through and manually carved out the GPS fixes... See attached.
immich-go_2025-01-02_21-52-43-edit.zip

Also note.. If its of benefit we could arrange a remote desktop session for you..

Just press enter at the end. The full path is printed on the screen. You can find log files here:

@simulot
Copy link
Owner

simulot commented Jan 3, 2025

Still not the API trace: πŸ˜„

2025-01-02 21:52:43 INF  --api-trace=false

But I think the BAD request comes when you have a version of an image already on the server, but in lower quality than the one just updated.

I'm trying the replicate this exact case.

Also note.. If its of benefit we could arrange a remote desktop session for you.

why not? I'll contact if I need more information

@bedpan
Copy link

bedpan commented Jan 3, 2025

Thought I had it enabled...

immich-go-rc5.exe --server=http://192.168.1.3:8080 --manage-burst StackKeepRaw --manage-raw-jpeg KeepRaw -k --api-trace -k hwK74RR3JhED1PDG7G7o3cnwidsmlfWIEYmp5tI7I upload from-google-photos ./takeout-**.zip

I have tried a bunch of variations of it but cannot get it to enable api-trace

-k --api-trace
-k --api-trace=True
-k --api-trace True

Sorry I am struggling a bit with the syntax of command...

edit

Got it working.. Thought I needed the -k in there.. I don't.. MB

Still not the API trace: πŸ˜„

2025-01-02 21:52:43 INF  --api-trace=false

But I think the BAD request comes when you have a version of an image already on the server, but in lower quality than the one just updated.

I'm trying the replicate this exact case.

Also note.. If its of benefit we could arrange a remote desktop session for you.

why not? I'll contact if I need more information

@bedpan
Copy link

bedpan commented Jan 4, 2025

With much fan fair I figured it out :-)
immich-go_2025-01-03_16-31-37-edit.zip

Might I recommend that the logs and api-trace be sanitized for this purpose. Manually removing and lat/long from each proved to be a fair bit of work for my feeble brain. Regex and all to delete stuff.. It hurts now!

Side note thanks for your work. I have what I need but don't mind helping out to track this down.

Still not the API trace: πŸ˜„

@bedpan
Copy link

bedpan commented Jan 4, 2025

Also getting some bad stack errors as well.. Might be worth another thread?

2025-01-03 21:16:46 INF Stacked file=takeout-02:Takeout/Google Photos/Family & friends(1)/IMG_20140725_162011-edited(2).jpg
2025-01-03 21:16:46 INF Stacked file=takeout-02:Takeout/Google Photos/Family & friends(1)/IMG_20140725_162011-edited.jpg
2025-01-03 21:16:46 INF Stacked file=takeout-02:Takeout/Google Photos/Family & friends(1)/IMG_20140725_162011-edited(1).jpg
2025-01-03 21:16:46 ERR Can't create stack error=createStack, POST, http://192.168.1.3:8080/api/stacks, 400 Bad Request
Bad Request

api
2025-01-03T21:16:46-05:00 QUERY 273002 AddAssetToAlbum PUT http://192.168.1.3:8080/api/albums/d586e5bd-a851-4bd9-97f7-6b40bfa1897e/assets
Accept [application/json]
Content-Type [application/json]
X-Api-Key redacted
-- request JSON Body --
{
"ids": [
"e08142b2-1503-49c8-9eda-6c1b4fb3af92"
]
}
-- request body end --

2025-01-03T21:16:46-05:00 RESPONSE 273002 AddAssetToAlbum PUT http://192.168.1.3:8080/api/albums/d586e5bd-a851-4bd9-97f7-6b40bfa1897e/assets
Status: 200 OK
-- response body --
[
{
"id": "e08142b2-1503-49c8-9eda-6c1b4fb3af92",
"success": false,
"error": "duplicate"
}
]
-- response body end --

2025-01-03T21:16:46-05:00 QUERY 273003 DeleteAsset DELETE http://192.168.1.3:8080/api/assets
Content-Type [application/json]
X-Api-Key redacted
-- request JSON Body --
{
"force": true,
"ids": [
"77c49975-ad5b-46eb-908e-a3f8d3f0c4f2"
]
}
-- request body end --

2025-01-03T21:16:46-05:00 QUERY 273004 createStack POST http://192.168.1.3:8080/api/stacks
Accept [application/json]
Content-Type [application/json]
X-Api-Key redacted
-- request JSON Body --
{
"assetIds": [
"81980d3e-9b6e-4c64-970d-6a4de540e1dd",
"77c49975-ad5b-46eb-908e-a3f8d3f0c4f2",
"e08142b2-1503-49c8-9eda-6c1b4fb3af92"
]
}
-- request body end --

@simulot
Copy link
Owner

simulot commented Jan 4, 2025

A big thank you! πŸ‘πŸΌ

A few comments:

  1. big takeout!
  2. the "bad request" responses aren't logged 😱
  3. Immich-go has stopped before having processed all the content, after a Bad Request, but why this one?
  4. The takeout contents lot of duplicates!
  5. The mix of album and stacked photo can be the problem

We can continue the discussion on discord @simulot

@simulot simulot self-assigned this Jan 4, 2025
@RollPitchYall
Copy link
Author

I was away from my server for the holidays and wasn't able to troubleshoot with you, but I just ran the same command on the original files that I submitted the issue about and now everything works!
I also just uploaded an Amazon Photos export using the upload from-folder syntax and everything worked seamlessly there! I kept getting the warning for png files that their metadata cant be read but I'm assuming normal.

image

@simulot
Copy link
Owner

simulot commented Jan 9, 2025

Thanks for this report. Glad to see it is working.

How the amazon photo export is? I'm wondering if information in the export that worth the effort to make a special import?

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

5 participants