Skip to content

Configuring StorageBackend causes error #393

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

Closed
pimvandenbroek opened this issue Oct 23, 2024 · 1 comment
Closed

Configuring StorageBackend causes error #393

pimvandenbroek opened this issue Oct 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@pimvandenbroek
Copy link

The Helm chart version

netbox-5.0.0-beta.132

Environment Versions

Kubernetes 1.29
GKE

Custom chart values

# Use Google Cloud Storage backend
storageBackend: storages.backends.gcloud.GoogleCloudStorage
# Provide the necessary configuration for GCS
storageConfig:
  GS_BUCKET_NAME: 'your-gcs-bucket-name'
  GS_PROJECT_ID: 'your-google-cloud-project-id'
  GS_CREDENTIALS_JSON: '/path/to/your/credentials.json'  

  # Optional settings for customizing GCS behavior
  GS_DEFAULT_ACL: 'publicRead'  # Set default access control, e.g., 'publicRead' or 'private'
  GS_FILE_OVERWRITE: False      # Set to False if you want to prevent overwriting files

plugins: ["django-storages"]

Current Behavior & Steps to Reproduce

We've added the values above, mounted the credentials json using a secret. The file is mounted properly and found.
However, when booting the following error occurs:

django.core.exceptions.ImproperlyConfigured: Unable to import plugin django-storages: Module not found. Check that the plugin module has been installed within the correct Python environment.

There is no option to install python modules.

Expected Behavior

I would expect that when the values.yaml has an option for storageBackends, which references to django-storages, that the packages is either already installed, either there is an option to install it.
Currently no custom python packages can be installed.

I think using the initContainer would be a great place to install these packages. Either by checking if storageBackend is set, and if so installing django-storages[google/aws/azure], or by adding an option to install custom python packages.
We can offcourse build our own docker image and include the package, but that seems counterintuitive.

NetBox Logs

django.core.exceptions.ImproperlyConfigured: Unable to import plugin django-storages: Module not found. Check that the plugin module has been installed within the correct Python environment.
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (0s / 30s)
django.core.exceptions.ImproperlyConfigured: Unable to import plugin django-storages: Module not found. Check that the plugin module has been installed within the correct Python environment.
@pimvandenbroek pimvandenbroek added the bug Something isn't working label Oct 23, 2024
@LeoColomb
Copy link
Member

Thanks for filing this issue, @pimvandenbroek.
I'm going to close it as a duplicate of #173.
The use case is very relevant, though, and it will probably help to consider correctly the referenced issue.

@LeoColomb LeoColomb closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants