[BUG] additional IDs returned in DELETE /asset #662

Closed
opened 2026-02-04 21:46:04 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @MichaelBui on GitHub (Feb 5, 2023).

I use DELETE /asset to delete files with 34 IDs but 36 IDs got deleted, together with 36 files:
image

Describe the bug
I sent this request with 34 IDs (done in Postman but convert into curl to paste here):

curl --location --request DELETE 'https://<masked-hostname>/api/asset' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-api-key: <masked-api-key>' \
--data-raw '{
  "ids": [
      	"49b6babc-3bc5-4d00-821f-b3c94746e177",
	"fb94b603-26d5-4196-8de0-c3d964b46a86",
	"35ce3166-142e-462f-8ce5-870c95597286",
	"e3fbd176-9f6f-4022-924c-ea4fbc9d1a08",
	"884e9819-1b47-4496-b91a-5800f264f611",
	"5d5e4255-5d07-401a-a868-7c10a870e3a6",
	"c25fed68-a81c-4abf-862b-9205dc206c5f",
	"380e1baa-a906-48a3-8a93-6a975a971346",
	"efc9a4ba-c3f0-492f-90c5-4d1f2c778bc9",
	"e0866cb1-a78e-41ce-b2b7-7d583cf44cf6",
	"80df50b8-d648-400f-baaa-0e7957d5a265",
	"92552e18-001a-4791-b4c5-31898243e92f",
	"2c0159bf-183e-475d-83c2-f607bd1de19b",
	"30f48320-2bd1-48df-8563-4df298c0710d",
	"8fd4ffb3-0eaa-4e43-a54a-d168d8ea3342",
	"a47c7d6b-f3e1-4988-a66f-48d5eb28b884",
	"05aa2907-2a62-4a8b-85e4-4fcf3146d4da",
	"05d1d27b-98e9-4d09-9b9f-53d3d4cd0743",
	"b23198a1-bdb4-4bf9-925c-5d9c28a03aad",
	"d20200ac-330b-4563-acec-7a1be1873cb8",
	"2587a603-62ce-4542-9ba1-34d649fe4589",
	"6489ed4b-a08e-4941-83ed-233611f30d4e",
	"4fbc8de8-6bdf-4731-a96f-4974c02d94a7",
	"e6f63951-1c96-471d-8b42-f0813b180666",
	"3d54901e-6e99-47d4-a593-21be2aab26f5",
	"172840e0-0333-46f3-ac6e-d832b518126d",
	"3efba685-ffce-428d-adbd-f67b776db970",
	"740e4397-64ac-4c4d-b40d-588ecdbbe4c6",
	"91ab2a9a-8f87-4549-8a2e-34121c410538",
	"e0c6e1bf-d232-4fcf-bfde-51366d33373b",
	"614ca615-94b1-45e7-a8e5-22e2957d300d",
	"8a3406c0-5af0-4a81-b42e-d18b1e5363ab",
	"a72cd5da-aef7-4e75-b434-bfca36a8a928",
	"bfc1613a-0311-4b5e-bf71-3330e67ab8b4"
  ]
}'

and got this response (prettified) with 36 IDs:

[
    {
        "id": "49b6babc-3bc5-4d00-821f-b3c94746e177",
        "status": "SUCCESS"
    },
    {
        "id": "fb94b603-26d5-4196-8de0-c3d964b46a86",
        "status": "SUCCESS"
    },
    {
        "id": "35ce3166-142e-462f-8ce5-870c95597286",
        "status": "SUCCESS"
    },
    {
        "id": "e3fbd176-9f6f-4022-924c-ea4fbc9d1a08",
        "status": "SUCCESS"
    },
    {
        "id": "884e9819-1b47-4496-b91a-5800f264f611",
        "status": "SUCCESS"
    },
    {
        "id": "5d5e4255-5d07-401a-a868-7c10a870e3a6",
        "status": "SUCCESS"
    },
    {
        "id": "c25fed68-a81c-4abf-862b-9205dc206c5f",
        "status": "SUCCESS"
    },
    {
        "id": "380e1baa-a906-48a3-8a93-6a975a971346",
        "status": "SUCCESS"
    },
    {
        "id": "efc9a4ba-c3f0-492f-90c5-4d1f2c778bc9",
        "status": "SUCCESS"
    },
    {
        "id": "e0866cb1-a78e-41ce-b2b7-7d583cf44cf6",
        "status": "SUCCESS"
    },
    {
        "id": "80df50b8-d648-400f-baaa-0e7957d5a265",
        "status": "SUCCESS"
    },
    {
        "id": "92552e18-001a-4791-b4c5-31898243e92f",
        "status": "SUCCESS"
    },
    {
        "id": "2c0159bf-183e-475d-83c2-f607bd1de19b",
        "status": "SUCCESS"
    },
    {
        "id": "30f48320-2bd1-48df-8563-4df298c0710d",
        "status": "SUCCESS"
    },
    {
        "id": "8fd4ffb3-0eaa-4e43-a54a-d168d8ea3342",
        "status": "SUCCESS"
    },
    {
        "id": "a47c7d6b-f3e1-4988-a66f-48d5eb28b884",
        "status": "SUCCESS"
    },
    {
        "id": "05aa2907-2a62-4a8b-85e4-4fcf3146d4da",
        "status": "SUCCESS"
    },
    {
        "id": "05d1d27b-98e9-4d09-9b9f-53d3d4cd0743",
        "status": "SUCCESS"
    },
    {
        "id": "b23198a1-bdb4-4bf9-925c-5d9c28a03aad",
        "status": "SUCCESS"
    },
    {
        "id": "d20200ac-330b-4563-acec-7a1be1873cb8",
        "status": "SUCCESS"
    },
    {
        "id": "2587a603-62ce-4542-9ba1-34d649fe4589",
        "status": "SUCCESS"
    },
    {
        "id": "6489ed4b-a08e-4941-83ed-233611f30d4e",
        "status": "SUCCESS"
    },
    {
        "id": "4fbc8de8-6bdf-4731-a96f-4974c02d94a7",
        "status": "SUCCESS"
    },
    {
        "id": "e6f63951-1c96-471d-8b42-f0813b180666",
        "status": "SUCCESS"
    },
    {
        "id": "3d54901e-6e99-47d4-a593-21be2aab26f5",
        "status": "SUCCESS"
    },
    {
        "id": "172840e0-0333-46f3-ac6e-d832b518126d",
        "status": "SUCCESS"
    },
    {
        "id": "3efba685-ffce-428d-adbd-f67b776db970",
        "status": "SUCCESS"
    },
    {
        "id": "740e4397-64ac-4c4d-b40d-588ecdbbe4c6",
        "status": "SUCCESS"
    },
    {
        "id": "91ab2a9a-8f87-4549-8a2e-34121c410538",
        "status": "SUCCESS"
    },
    {
        "id": "e0c6e1bf-d232-4fcf-bfde-51366d33373b",
        "status": "SUCCESS"
    },
    {
        "id": "614ca615-94b1-45e7-a8e5-22e2957d300d",
        "status": "SUCCESS"
    },
    {
        "id": "8a3406c0-5af0-4a81-b42e-d18b1e5363ab",
        "status": "SUCCESS"
    },
    {
        "id": "a72cd5da-aef7-4e75-b434-bfca36a8a928",
        "status": "SUCCESS"
    },
    {
        "id": "bfc1613a-0311-4b5e-bf71-3330e67ab8b4",
        "status": "SUCCESS"
    },
    {
        "id": "a2e8f35d-a41b-413f-a8ed-e54d01e4cc97",
        "status": "SUCCESS"
    },
    {
        "id": "9735a9b0-6bed-4610-868d-c1a1a6a5d664",
        "status": "SUCCESS"
    }
]

These are 2 IDs returned in the response (bottom) but not in the request:

  • 9735a9b0-6bed-4610-868d-c1a1a6a5d664
  • a2e8f35d-a41b-413f-a8ed-e54d01e4cc97

After that, I tried to query from DB & as I expected, there are no results for these 2 IDs.

It seems not easy to reproduce because I have done many requests (from ~30 to ~600 IDs per request) before that but haven't encountered this issue before and I guess it may not happen to me again.

Not sure if this happen because of some cache or some duplicated hashed value,... but I'm worried that additional files have got deleted unknowingly.

Task List

Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.

  • I have read thoroughly the README setup and installation instructions.
  • I have included my docker-compose file.
  • I have included my redacted .env file.
  • I have included information on my machine, and environment.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

System

  • Phone OS [iOS, Android]: <version>
  • Server Version: v1.42.0
  • Mobile App Version: <version>

Additional context
Add any other context about the problem here.

Originally created by @MichaelBui on GitHub (Feb 5, 2023). <!-- Note: Please search to see if an issue already exists for the bug you encountered. --> I use `DELETE /asset` to delete files with 34 IDs but 36 IDs got deleted, together with 36 files: <img width="317" alt="image" src="https://user-images.githubusercontent.com/1146708/216802828-2a7a667a-cc03-47d0-8a60-1d8a63a40271.png"> **Describe the bug** I sent this request with `34` IDs (done in Postman but convert into curl to paste here): ``` curl --location --request DELETE 'https://<masked-hostname>/api/asset' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-api-key: <masked-api-key>' \ --data-raw '{ "ids": [ "49b6babc-3bc5-4d00-821f-b3c94746e177", "fb94b603-26d5-4196-8de0-c3d964b46a86", "35ce3166-142e-462f-8ce5-870c95597286", "e3fbd176-9f6f-4022-924c-ea4fbc9d1a08", "884e9819-1b47-4496-b91a-5800f264f611", "5d5e4255-5d07-401a-a868-7c10a870e3a6", "c25fed68-a81c-4abf-862b-9205dc206c5f", "380e1baa-a906-48a3-8a93-6a975a971346", "efc9a4ba-c3f0-492f-90c5-4d1f2c778bc9", "e0866cb1-a78e-41ce-b2b7-7d583cf44cf6", "80df50b8-d648-400f-baaa-0e7957d5a265", "92552e18-001a-4791-b4c5-31898243e92f", "2c0159bf-183e-475d-83c2-f607bd1de19b", "30f48320-2bd1-48df-8563-4df298c0710d", "8fd4ffb3-0eaa-4e43-a54a-d168d8ea3342", "a47c7d6b-f3e1-4988-a66f-48d5eb28b884", "05aa2907-2a62-4a8b-85e4-4fcf3146d4da", "05d1d27b-98e9-4d09-9b9f-53d3d4cd0743", "b23198a1-bdb4-4bf9-925c-5d9c28a03aad", "d20200ac-330b-4563-acec-7a1be1873cb8", "2587a603-62ce-4542-9ba1-34d649fe4589", "6489ed4b-a08e-4941-83ed-233611f30d4e", "4fbc8de8-6bdf-4731-a96f-4974c02d94a7", "e6f63951-1c96-471d-8b42-f0813b180666", "3d54901e-6e99-47d4-a593-21be2aab26f5", "172840e0-0333-46f3-ac6e-d832b518126d", "3efba685-ffce-428d-adbd-f67b776db970", "740e4397-64ac-4c4d-b40d-588ecdbbe4c6", "91ab2a9a-8f87-4549-8a2e-34121c410538", "e0c6e1bf-d232-4fcf-bfde-51366d33373b", "614ca615-94b1-45e7-a8e5-22e2957d300d", "8a3406c0-5af0-4a81-b42e-d18b1e5363ab", "a72cd5da-aef7-4e75-b434-bfca36a8a928", "bfc1613a-0311-4b5e-bf71-3330e67ab8b4" ] }' ``` and got this response (prettified) with `36` IDs: ``` [ { "id": "49b6babc-3bc5-4d00-821f-b3c94746e177", "status": "SUCCESS" }, { "id": "fb94b603-26d5-4196-8de0-c3d964b46a86", "status": "SUCCESS" }, { "id": "35ce3166-142e-462f-8ce5-870c95597286", "status": "SUCCESS" }, { "id": "e3fbd176-9f6f-4022-924c-ea4fbc9d1a08", "status": "SUCCESS" }, { "id": "884e9819-1b47-4496-b91a-5800f264f611", "status": "SUCCESS" }, { "id": "5d5e4255-5d07-401a-a868-7c10a870e3a6", "status": "SUCCESS" }, { "id": "c25fed68-a81c-4abf-862b-9205dc206c5f", "status": "SUCCESS" }, { "id": "380e1baa-a906-48a3-8a93-6a975a971346", "status": "SUCCESS" }, { "id": "efc9a4ba-c3f0-492f-90c5-4d1f2c778bc9", "status": "SUCCESS" }, { "id": "e0866cb1-a78e-41ce-b2b7-7d583cf44cf6", "status": "SUCCESS" }, { "id": "80df50b8-d648-400f-baaa-0e7957d5a265", "status": "SUCCESS" }, { "id": "92552e18-001a-4791-b4c5-31898243e92f", "status": "SUCCESS" }, { "id": "2c0159bf-183e-475d-83c2-f607bd1de19b", "status": "SUCCESS" }, { "id": "30f48320-2bd1-48df-8563-4df298c0710d", "status": "SUCCESS" }, { "id": "8fd4ffb3-0eaa-4e43-a54a-d168d8ea3342", "status": "SUCCESS" }, { "id": "a47c7d6b-f3e1-4988-a66f-48d5eb28b884", "status": "SUCCESS" }, { "id": "05aa2907-2a62-4a8b-85e4-4fcf3146d4da", "status": "SUCCESS" }, { "id": "05d1d27b-98e9-4d09-9b9f-53d3d4cd0743", "status": "SUCCESS" }, { "id": "b23198a1-bdb4-4bf9-925c-5d9c28a03aad", "status": "SUCCESS" }, { "id": "d20200ac-330b-4563-acec-7a1be1873cb8", "status": "SUCCESS" }, { "id": "2587a603-62ce-4542-9ba1-34d649fe4589", "status": "SUCCESS" }, { "id": "6489ed4b-a08e-4941-83ed-233611f30d4e", "status": "SUCCESS" }, { "id": "4fbc8de8-6bdf-4731-a96f-4974c02d94a7", "status": "SUCCESS" }, { "id": "e6f63951-1c96-471d-8b42-f0813b180666", "status": "SUCCESS" }, { "id": "3d54901e-6e99-47d4-a593-21be2aab26f5", "status": "SUCCESS" }, { "id": "172840e0-0333-46f3-ac6e-d832b518126d", "status": "SUCCESS" }, { "id": "3efba685-ffce-428d-adbd-f67b776db970", "status": "SUCCESS" }, { "id": "740e4397-64ac-4c4d-b40d-588ecdbbe4c6", "status": "SUCCESS" }, { "id": "91ab2a9a-8f87-4549-8a2e-34121c410538", "status": "SUCCESS" }, { "id": "e0c6e1bf-d232-4fcf-bfde-51366d33373b", "status": "SUCCESS" }, { "id": "614ca615-94b1-45e7-a8e5-22e2957d300d", "status": "SUCCESS" }, { "id": "8a3406c0-5af0-4a81-b42e-d18b1e5363ab", "status": "SUCCESS" }, { "id": "a72cd5da-aef7-4e75-b434-bfca36a8a928", "status": "SUCCESS" }, { "id": "bfc1613a-0311-4b5e-bf71-3330e67ab8b4", "status": "SUCCESS" }, { "id": "a2e8f35d-a41b-413f-a8ed-e54d01e4cc97", "status": "SUCCESS" }, { "id": "9735a9b0-6bed-4610-868d-c1a1a6a5d664", "status": "SUCCESS" } ] ``` These are 2 IDs returned in the response (bottom) but not in the request: - `9735a9b0-6bed-4610-868d-c1a1a6a5d664` - `a2e8f35d-a41b-413f-a8ed-e54d01e4cc97` After that, I tried to query from DB & as I expected, there are no results for these 2 IDs. It seems not easy to reproduce because I have done many requests (from ~30 to ~600 IDs per request) before that but haven't encountered this issue before and I guess it may not happen to me again. Not sure if this happen because of some cache or some duplicated hashed value,... but I'm worried that additional files have got deleted unknowingly. **Task List** *Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.* - [x] I have read thoroughly the README setup and installation instructions. - [ ] I have included my `docker-compose` file. - [ ] I have included my redacted `.env` file. - [x] I have included information on my machine, and environment. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** <img width="1346" alt="image" src="https://user-images.githubusercontent.com/1146708/216802735-d4ab3e30-ad8e-48c1-b1c1-02d55a2d9629.png"> **System** - Phone OS [iOS, Android]: `<version>` - Server Version: `v1.42.0` - Mobile App Version: `<version>` **Additional context** Add any other context about the problem here.
Author
Owner

@MichaelBui commented on GitHub (Feb 5, 2023):

After taking a look at the sync logs, I guess the reason is that those 2 files are live photos so the behavior is expected:
image

Please help to confirm & feel free to close this bug. Hope it helps someone in the future to understand the behavior!

@MichaelBui commented on GitHub (Feb 5, 2023): After taking a look at the sync logs, I guess the reason is that those 2 files are live photos so the behavior is expected: <img width="1281" alt="image" src="https://user-images.githubusercontent.com/1146708/216802989-e015d6ad-ad49-48e4-a1f7-a9e6ee1be2d9.png"> Please help to confirm & feel free to close this bug. Hope it helps someone in the future to understand the behavior!
Author
Owner

@alextran1502 commented on GitHub (Feb 5, 2023):

This is expected, when you delete a live photos asset, the id that should be passed in is the image part, and the moving part will get deleted along with the image portion.

Thank you for the detail report! 😄

@alextran1502 commented on GitHub (Feb 5, 2023): This is expected, when you delete a live photos asset, the id that should be passed in is the image part, and the moving part will get deleted along with the image portion. Thank you for the detail report! 😄
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#662