# Paperclip permission denied error

**URL:** <https://www.ruby-forum.com/t/paperclip-permission-denied-error/186265>\
**Category:** Rails\
**Created:** [April 3, 2010, 8:30am UTC](https://www.ruby-forum.com/t/paperclip-permission-denied-error/186265 "2010-04-03T08:30:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [April 3, 2010, 8:30am UTC](https://www.ruby-forum.com/t/paperclip-permission-denied-error/186265/1 "2010-04-03T08:30:45Z")

</div>

I am hoping someone could shed some light on this problem.

I am setting up a new server to host a Rails app and it is almost done.  
The only error I’m getting is permission denied when the Paperclip  
plugin uploads the image and attempts to move it to its final location.  
It can upload to the temp folder without problem and execute the  
ImageMagick commands without a problem.

It is the same folder structure as my old server… Old server apache  
ran as “nobody”. New server I am not sure. From what I can tell it runs  
under “daemon”, but I’ve tried these permissions with no success:

I’ve tried different ownerships and permissions on the folders:  
Ownership: nobody  
Ownership: daemon  
Ownership: root

Folder/File permissions: 755 and 777

Nothing has allowed it to move the uploaded image to the final folder.

I’ve been looking at this took long after a long hard fought battle with  
ImageMagick installation issues.

Thanks for any insight,

Chris

---

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [April 3, 2010, 4:45pm UTC](https://www.ruby-forum.com/t/paperclip-permission-denied-error/186265/2 "2010-04-03T16:45:08Z")

</div>

On Fri, Apr 2, 2010 at 11:30 PM, Chris M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> The only error I’m getting is permission denied when the Paperclip  
> plugin uploads the image and attempts to move it to its final location.  
> It can upload to the temp folder without problem and execute the  
> ImageMagick commands without a problem.
> 
> It is the same folder structure as my old server… Old server apache  
> ran as “nobody”. New server I am not sure.

?! “not sure”? Use `ps` and find out. Then su to that user and try the  
operation manually.

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan

---

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [April 3, 2010, 8:11pm UTC](https://www.ruby-forum.com/t/paperclip-permission-denied-error/186265/3 "2010-04-03T20:11:16Z")

</div>

> ?! “not sure”? Use `ps` and find out. Then su to that user and try the  
> operation manually.
> 
> –  
> Hassan S. ------------------------ removed\_email\_address@domain.invalid  
> twitter: @hassan

I’ve checked the users…

ruby runs under root  
passenger runs under root  
httpd runs under daemon

I’ve had the folder permissions set to 777 and ownership changed to  
daemon and to root and still reports a permission denied error.

I have my folder for temporary upload files owned by daemon and it works  
fine.

I have the production.log file owned by daemon and it can write to that  
file.

But still can’t seem to find the right ownership/permissions to allow  
new folders and files created after upload.

Very odd.

---

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [April 3, 2010, 8:46pm UTC](https://www.ruby-forum.com/t/paperclip-permission-denied-error/186265/4 "2010-04-03T20:46:32Z")

</div>

It is “daemon”. Not sure why previous attempts of giving  
ownership/permission didn’t work, but I backtracked through the folder  
structure (nested quite deep on this Bitnami Rubystack) and made sure  
the entire folder path allowed daemon write permissions.

Finally!!!

Chris
