Add placeholder image thumbnail if image loading error #11587

Closed
opened 2025-12-29 21:47:14 +01:00 by adam · 2 comments
Owner

Originally created by @FloRinke on GitHub (Sep 8, 2025).

Originally assigned to: @jnovinger on GitHub.

NetBox Edition

NetBox Community

NetBox Version

v4.4.0

Python Version

3.12

Steps to Reproduce

  1. Have Cache-Redis without disk persistence (in my case: default directory write-protected by Kubernetes)
  2. Attach Image to a suitable object (in my case a location)
  3. Go to tab "Images"

Expected Behavior

See an empty box or an error placeholder ("Thumbnail cannot be generated") and a clickable link to the image resource
Image

Observed Behavior

The image file name is shown as text, no preview, no clickable link
Image

In the DOM it's apparent all Tags related to the Thumbnail are missing:
Image

Originally created by @FloRinke on GitHub (Sep 8, 2025). Originally assigned to: @jnovinger on GitHub. ### NetBox Edition NetBox Community ### NetBox Version v4.4.0 ### Python Version 3.12 ### Steps to Reproduce 1. Have Cache-Redis without disk persistence (in my case: default directory write-protected by Kubernetes) 2. Attach Image to a suitable object (in my case a location) 3. Go to tab "Images" ### Expected Behavior See an empty box or an error placeholder ("Thumbnail cannot be generated") and a clickable link to the image resource <img width="722" height="412" alt="Image" src="https://github.com/user-attachments/assets/9c914ece-6def-4eb7-b345-4a7281dc7380" /> ### Observed Behavior The image file name is shown as text, no preview, no clickable link <img width="725" height="217" alt="Image" src="https://github.com/user-attachments/assets/8d2a95bd-8a11-41df-a901-57e7d6e3cf64" /> In the DOM it's apparent all Tags related to the Thumbnail are missing: <img width="622" height="152" alt="Image" src="https://github.com/user-attachments/assets/8682916b-7232-4c22-a368-d803657d0476" />
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:47:14 +01:00
adam closed this issue 2025-12-29 21:47:15 +01:00
Author
Owner

@FloRinke commented on GitHub (Sep 8, 2025):

In the server log the real issue becomes clear:
redis.exceptions.ResponseError: MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
(But that's not visible to the normal user).
And if you don't know this feature, you also don't know how it's supposed to look like and only see an un-clickable filename.

So I suggest to implement a more graceful handling here. I will try and provide a PR.

@FloRinke commented on GitHub (Sep 8, 2025): In the server log the real issue becomes clear: `redis.exceptions.ResponseError: MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.` (But that's not visible to the normal user). And if you don't know this feature, you also don't know how it's supposed to look like and only see an un-clickable filename. So I suggest to implement a more graceful handling here. I will try and provide a PR.
Author
Owner

@arthanson commented on GitHub (Sep 11, 2025):

Redis is a required component and needs to be configured correctly, that said it would make sense to have a placeholder image if the image cannot be loaded due to some system error.

@arthanson commented on GitHub (Sep 11, 2025): Redis is a required component and needs to be configured correctly, that said it would make sense to have a placeholder image if the image cannot be loaded due to some system error.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11587