Page MenuHomePhabricator

Setup Swift Storage for Netbox image (was: netbox won't allow me to upload photos of the rack)
Open, NormalPublic

Description

When attempting to upload a photo of the rear of the ulsfo rack 103.02.22, I received the following error:

<class 'PermissionError'>

[Errno 13] Permission denied: '/srv/deployment/netbox/deploy-cache/revs/1cd4d43dd1bdf32e81af0318f479890cf23e2ee5/src/netbox/media/image-attachments/rack_33_103.02.22_rear.jpg'

This likely needs some puppetization of the directory permissions, or a review if we want to allow uploads to it at all.

Event Timeline

RobH triaged this task as Normal priority.Nov 9 2018, 8:45 PM
RobH created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 9 2018, 8:45 PM
RobH added a comment.Nov 9 2018, 8:46 PM

Not an emergency, so I did NOT go livehacking any permissions changes.

Volans added a comment.Nov 9 2018, 8:56 PM

@RobH yep, known issue, the immediate fix was already scheduled in https://gerrit.wikimedia.org/r/c/operations/puppet/+/463820 but then we decided to go directly in the direction of using swift as a backend for attachments to avoid to setup and rsync between the two netbox hosts. For that I preferred to leave it "broken" on purpose to avoid having then to migrate existing attachments to swift. I just din't had yet time to set it up, I hope in the next week or two to be able set everything up, but please let me know also how much is a blocker so I can prioritize accordingly.

Peachey88 updated the task description. (Show Details)Nov 10 2018, 12:06 AM
crusnov renamed this task from netbox won't allow me to upload photos of the rack to Setup Swift Storage for Netbox image (was: netbox won't allow me to upload photos of the rack).Jun 7 2019, 2:46 PM
crusnov claimed this task.
crusnov added subscribers: fgiunchedi, Volans.

okay so this works, mostly, in labs when manually configured to operate against the deployment-prep Swift cluster. Netbox lets me upload images and shows them associated with the object in question - except that viewing fails because they are served from a URL in the swift cluster that is unavailable. We'll look at this part more next week no doubt.

There is a niggle, though. Netbox does a strange thing in that it imports only parts of configuration.py into the settings module, explicitly selecting them from the configuration module and sanitizing and fixing them, so I had to add a broad import to pull the swift settings also. I'm not sure of the best way to approach this in actual production. We could override the settings.py, or patch it to explicitly support the swift settings in general. Some discussion is needed.

Change 518785 had a related patch set uploaded (by CRusnov; owner: CRusnov):
[operations/software/netbox@master] Add a passthrough configuration system

https://gerrit.wikimedia.org/r/518785

Change 518785 merged by CRusnov:
[operations/software/netbox@master] Add a passthrough configuration system

https://gerrit.wikimedia.org/r/518785

Change 520296 had a related patch set uploaded (by CRusnov; owner: CRusnov):
[operations/puppet@production] netbox: Add parameters and settings for storing things in Swift

https://gerrit.wikimedia.org/r/520296

Mentioned in SAL (#wikimedia-operations) [2019-07-03T06:55:05Z] <godog> depool and roll-restart swift proxy - T209182

Change 520296 merged by CRusnov:
[operations/puppet@production] netbox: Add parameters and settings for storing things in Swift

https://gerrit.wikimedia.org/r/520296