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

4.2x Netbox version breaks Django-storage STORAGE_BACKEND #18400

Closed
JHirvi opened this issue Jan 15, 2025 · 2 comments · Fixed by #18401
Closed

4.2x Netbox version breaks Django-storage STORAGE_BACKEND #18400

JHirvi opened this issue Jan 15, 2025 · 2 comments · Fixed by #18401
Assignees
Labels
severity: high Completely breaks certain functions, or substantially degrades performance application-wide status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@JHirvi
Copy link

JHirvi commented Jan 15, 2025

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.2.1

Python Version

3.12

Steps to Reproduce

After upgrading netbox 4.1.7 to 4.2.1 Netbox ignored django storage package for storing media files to S3.

Expected Behavior

Before upgrade all media files were succesfully stored in S3 and no modifications were done in that package or definments in extra.py file.

Observed Behavior

No errors in logs and all new media files are stored now in local storage instead of S3-bucket.

I believe that issue is related to django version upgrade to 5.1.

I found that Django 5.1 does not support DEFAULT_FILE_STORAGE parameter what is still in use in settings.py file.

if STORAGE_BACKEND is not None: DEFAULT_FILE_STORAGE = STORAGE_BACKEND # django-storages if STORAGE_BACKEND.startswith('storages.'):

https://forum.djangoproject.com/t/deprecation-of-default-file-storage-can-we-easen-the-migration/34284

Some discussion related to Django version 5.1 upgrade and backend storage parameters. 
@JHirvi JHirvi added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Jan 15, 2025
@bctiemann bctiemann self-assigned this Jan 15, 2025
@bctiemann bctiemann added status: accepted This issue has been accepted for implementation severity: high Completely breaks certain functions, or substantially degrades performance application-wide and removed status: needs triage This issue is awaiting triage by a maintainer labels Jan 15, 2025
@bctiemann
Copy link
Contributor

@JHirvi the linked PR should fix this; I've tested it as well as I can locally without an S3 setup. Can you verify whether it solves the issue?

@JHirvi
Copy link
Author

JHirvi commented Jan 16, 2025

@bctiemann Tested your PR and seems like it is working now backend accepts django storage package as storage_backend and storage_configs are applied too.

Also media files are stored again in S3 and previosly stored images are working too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: high Completely breaks certain functions, or substantially degrades performance application-wide status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants