Media field updating with incorrect random image
Node Version
22.22.2
Package Manager
pnpm
Package Manager Version
10.12.3
Strapi Version
5.49.0
Operating System
Linux (Debian/Ubuntu)
Database
PostgreSQL
Javascript or Typescript
Javascript
Reproduction URL
No response
Bug Description
When selecting certain uploaded image in my media fields, the image in published state contains some other random image from my media library. I am using cloudinary for my uploads. This is an issue that's created in production but not during development. Initially thought it was just a caching issue but the API keeps serving the random image.
Steps to Reproduce
I am finding this very hard to reproduce as it just doesn't happen during development so for that reason I am open to suggestions on how I can provide more valuable information. The fields affected are random, it happened before in another project and we wiped the database clean and re-uploaded after which the issue was gone. I find it highly concerning now that it happened in another project of ours. So in production:
- Change / select new image from media library on a field.
- Save and then publish or directly publish the document.
- Go to published version and see a random image displayed (while draft displays correct one).
Note: The API is also serving the incorrect random image so it's not just a CMS caching issue.
Expected Behavior
- Change / select new image from media library on a field.
- Save and then publish or directly publish the document.
- The new image is set on the field on the published version as well.
Logs
Server side pm2 logs:
1|ottr-portfolio-backend | [2026-07-14 05:54:57.061] http: GET /upload/settings (80 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:54:57.146] http: GET /upload/configuration (157 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:54:57.158] http: GET /upload/files?page=1&sort=updatedAt:DESC&pageSize=10&filters[$and][0][folder][id][$null]=true (160 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:54:57.275] http: GET /upload/files?page=1&sort=createdAt:DESC&pageSize=10&filters[$and][0][folder][id][$null]=true (67 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:54:57.391] http: GET /upload/folders?page=1&sort=createdAt:DESC&pageSize=10&filters[$and][0][parent][id][$null]=true&pagination[pageSize]=-1 (51 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:54:57.512] http: GET /upload/settings (37 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:55:08.748] http: POST /content-manager/collection-types/api::case-study.case-study/lfm4084h08lm7esdocqrx5zt/actions/publish?status=draft (1647 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:55:10.018] http: GET /i18n/ai-localization-jobs/collection-types/api::case-study.case-study/lfm4084h08lm7esdocqrx5zt (1030 ms) 404
1|ottr-portfolio-backend | [2026-07-14 05:55:10.158] http: GET /content-manager/relations/api::case-study.case-study/lfm4084h08lm7esdocqrx5zt/more_cases?status=draft&pageSize=5&page=1 (1259 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:55:10.222] http: GET /content-manager/relations/api::case-study.case-study/lfm4084h08lm7esdocqrx5zt/more_cases?status=published&pageSize=5&page=1 (660 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:55:10.308] http: GET /content-manager/collection-types/api::case-study.case-study/lfm4084h08lm7esdocqrx5zt?status=published (1441 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:55:10.331] http: GET /content-manager/collection-types/api::case-study.case-study/lfm4084h08lm7esdocqrx5zt (1456 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:55:10.348] http: GET /content-manager/collection-types/api::case-study.case-study/lfm4084h08lm7esdocqrx5zt?status=draft (1465 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:55:10.498] http: GET /content-manager/collection-types/api::case-study.case-study/lfm4084h08lm7esdocqrx5zt/actions/countDraftRelations?status=draft (60 ms) 200
1|ottr-portfolio-backend | [2026-07-14 05:55:10.598] http: GET /content-manager/relations/api::case-study.case-study/more_cases?status=draft&id=lfm4084h08lm7esdocqrx5zt&pageSize=10&_q=&page=1 (112 ms) 200Code Snippets
No response
Media
https://github.com/user-attachments/assets/2fe50ed2-9789-48cc-a9df-ba50191070e0
https://github.com/user-attachments/assets/a31c9695-386e-4493-babb-6230553d7918
Additional information
I think this issue might be related to 22748 but that hasn't been resolved either and I could not see any response from the Strapi team.
Confirmation Checklist
- I have checked the existing issues for duplicates.
- I agree to follow this project's Code of Conduct.
Source: strapi/strapi