registerguard / ap_wfm

AP WebFeeds Manager parser
1 stars 0 forks source link

Still having group write permission issues on /tmp/cbs3cache #17

Closed jheasly closed 10 years ago

jheasly commented 10 years ago

Still getting these image directory permissions issues on projects.registerguard.com/tmp/cbs3cache on server restart. Have to get with @dhpennell to stomp this for good.

Traceback (most recent call last):
  File "./WFA/processFeed.py", line 527, in <module>
    main()
  File "./WFA/processFeed.py", line 509, in main
    im.image.save(file_name, File(img_temp))
  File "/usr/lib/python2.7/dist-packages/django/db/models/fields/files.py", line 92, in save
    self.name = self.storage.save(name, content)
  File "/usr/lib/python2.7/dist-packages/django/core/files/storage.py", line 49, in save
    name = self._save(name, content)
  File "/usr/local/lib/python2.7/dist-packages/cuddlybuddly/storage/s3/storage.py", line 200, in _save
    self._put_file(name, content)
  File "/usr/local/lib/python2.7/dist-packages/cuddlybuddly/storage/s3/storage.py", line 113, in _put_file
    self.cache.save(name, 0, 0)
  File "/usr/local/lib/python2.7/dist-packages/cuddlybuddly/storage/s3/cache.py", line 90, in save
    file = open(self._path(name), 'w')
IOError: [Errno 13] Permission denied: '/tmp/cbs3cache/308a8979289036df2825e63e9fb44bc8'

I've fixed the permissions, but on next server restart the directory permissions on /cbs3cache will revert to

$ drwxr-xr-x 2 www-data www-data 2646016 Jun 14 20:39 cbs3cache

and permissions need to be

drwxrwxr-x 2 www-data www-data 2646016 Jun 14 20:39 cbs3cache

Doing

$ sudo chmod g+w /tmp/cbs3cache/

fixes it.

When this permissions change happens, we get no photos on the ap_wfm pages.

jheasly commented 10 years ago

When I tried to duplicate the issue with straight Python, the new test directory was getting created with group write permission, so I don't know what the deal is.

So David added sudo chmod g+w /tmp/cbs3cache/ to the ubuntu cron. Runs once a day at 10 p.m. A hack, but it shouldn't be an issue anymore.