Permission denied @ dir_s_mkdir - /var/www/discourse/public/uploads/default/original/2X

(John Lee) #1


Not sure what happened but this error just happens when I tried to upload attachment (jpg)

Permission denied @ dir_s_mkdir - /var/www/discourse/public/uploads/default/original/2X

Anyone know about this?

Thanks in advance.

(Matt Palmer) #2

Some element of the path leading to that directory is missing a necessary permission. Ensure that the parent directory is writable by UID 1000, and that all the higher-level directory components are traversable (x permission) by UID 1000.

(John Lee) #3


I had fixed it, it was permission on the /shared/* folder.

But then this error came up.

PG::InsufficientPrivilege: ERROR: could not open file “base/32822/45579”: Permission denied

What gives?

(Matt Palmer) #4

Same general principle, except this time you’ve busted the permissions to the PostgreSQL data directory.

(Jay Pfaffman) #5

How did you install discourse?

(John Lee) #6

Normal installation following the guideline to install on Ubuntu.

(Jeff Atwood) #7

Are you sure? I’ve never seen permission errors like that, but then again on Digital Ocean (for example) you generally log in as root to do the install.

(John Lee) #8

It is not suppose to install using root account?

I am not using Digital Ocean but leaseweb.

It was working before but I had to migrate to a different server under the same hosting company.

I had to import backup manually due to some issue with the system in several commits earlier.

Don’t think that’s the cause though.

(John Lee) #9

I tried to upgrade and rebuild

Everything seem to be working again now.