Thumbnails don't work with S3 storage #11546

Open
opened 2025-12-29 21:46:37 +01:00 by adam · 5 comments
Owner

Originally created by @llamafilm on GitHub (Aug 30, 2025).

Originally assigned to: @arthanson on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.4.0-beta1

Python Version

3.12

Steps to Reproduce

I first opened this as discussion #20113 but after further investigation I'm convinced it's a bug in the sorl-thumbnail library.

With the default storage in S3, thumbnails are never generated or loaded.

Steps to reproduce:

  1. Configure the default storage to be in S3 like this:
STORAGES = {
    "default": {
        "BACKEND": "storages.backends.s3.S3Storage",
        "OPTIONS": {
            'bucket_name': 'mybucket',
            'region_name': 'us-east-1',
            'location': 'storage'
        }
    },
}
  1. Load any image-attachments webpage, i.e. /dcim/locations/12218/image-attachments/.

Expected Behavior

Thumbnails should be generated automatically, written to S3, and displayed in the browser.

Observed Behavior

It just displays the filename with no image.

Image
Originally created by @llamafilm on GitHub (Aug 30, 2025). Originally assigned to: @arthanson on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.4.0-beta1 ### Python Version 3.12 ### Steps to Reproduce I first opened this as discussion #20113 but after further investigation I'm convinced it's a bug in the sorl-thumbnail library. With the default storage in S3, thumbnails are never generated or loaded. Steps to reproduce: 1. Configure the default storage to be in S3 like this: ```py STORAGES = { "default": { "BACKEND": "storages.backends.s3.S3Storage", "OPTIONS": { 'bucket_name': 'mybucket', 'region_name': 'us-east-1', 'location': 'storage' } }, } ``` 2. Load any image-attachments webpage, i.e. `/dcim/locations/12218/image-attachments/`. ### Expected Behavior Thumbnails should be generated automatically, written to S3, and displayed in the browser. ### Observed Behavior It just displays the filename with no image. <img width="1202" height="257" alt="Image" src="https://github.com/user-attachments/assets/d71ac74b-96dd-426a-8955-981f00e2cd15" />
adam added the type: bugstatus: acceptednetboxseverity: low labels 2025-12-29 21:46:37 +01:00
Author
Owner

@llamafilm commented on GitHub (Aug 30, 2025):

I think there are 2 issues here. The first is fixed here but that hasn't made it into a release version yet, so Netbox doesn't have it.

The other is discussed here and here, and it seems to be fixed by this PR. I just pip installed that git branch in my Netbox test instance and thumbnails started working, without any changes to configuration.py.

@llamafilm commented on GitHub (Aug 30, 2025): I think there are 2 issues here. The first is fixed [here](https://github.com/jazzband/sorl-thumbnail/commit/b348c63d7a148ec3fec2b8b820b1c621570a5fb4) but that hasn't made it into a release version yet, so Netbox doesn't have it. The other is discussed [here](https://github.com/jazzband/sorl-thumbnail/issues/729) and [here](https://github.com/jazzband/sorl-thumbnail/issues/748), and it seems to be fixed by [this PR](https://github.com/jazzband/sorl-thumbnail/pull/780). I just pip installed that git branch in my Netbox test instance and thumbnails started working, without any changes to configuration.py.
Author
Owner

@arthanson commented on GitHub (Oct 14, 2025):

Marking as blocked by #748 in sorl-thumbnail. sorl is just used in one place in NetBox (image attachments) so would be fairly easy to replace, however it looks like the best other maintained library that is close is easy-thumbnails as switching to it would probably just be switching on set of issues to another.

On the sorl side there is an issue with imagemagick and tests (#781), if that can be resolved then a new release can probably be pushed through. Trying to help over there to get a release made as there are already fixes that seem to address this issue.

@arthanson commented on GitHub (Oct 14, 2025): Marking as blocked by [#748](https://github.com/jazzband/sorl-thumbnail/pull/780) in sorl-thumbnail. sorl is just used in one place in NetBox (image attachments) so would be fairly easy to replace, however it looks like the best other maintained library that is close is easy-thumbnails as switching to it would probably just be switching on set of issues to another. On the sorl side there is an issue with imagemagick and tests ([#781](https://github.com/jazzband/sorl-thumbnail/pull/781)), if that can be resolved then a new release can probably be pushed through. Trying to help over there to get a release made as there are already fixes that seem to address this issue.
Author
Owner

@jeremystretch commented on GitHub (Nov 25, 2025):

sorl-thumbnail v13.0.0 has been released. This should be revisited to see what (if any) work is needed in NetBox at this stage.

@jeremystretch commented on GitHub (Nov 25, 2025): sorl-thumbnail v13.0.0 has been [released](https://github.com/jazzband/sorl-thumbnail/releases/tag/13.0.0). This should be revisited to see what (if any) work is needed in NetBox at this stage.
Author
Owner

@llamafilm commented on GitHub (Dec 1, 2025):

I've been running for the last 2 weeks with sorl-thumbnail.git@92f1734 and it seems fine. I think the only change to Netbox will be requirements.txt but we are still waiting for it to be published to pypi.

@llamafilm commented on GitHub (Dec 1, 2025): I've been running for the last 2 weeks with `sorl-thumbnail.git@92f1734` and it seems fine. I think the only change to Netbox will be requirements.txt but we are still waiting for it to be published to pypi.
Author
Owner

@arthanson commented on GitHub (Dec 1, 2025):

Marking this as still blocked as sorl-thumbnail has not published to pypi.

@arthanson commented on GitHub (Dec 1, 2025): Marking this as still blocked as sorl-thumbnail has not published to pypi.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11546