Changed user and group for /var/discourse now 500 errors


(Johnny) #1

Hi,

I just did a mistake, i.e I changed the user & group for /var/discourse directory. Now I am getting 500 Internal server error. Previously it was root:root.

What should I do now?


(Matt Palmer) #2

Change it back to the previous permissions and ownership?


(Johnny) #3

tried but still same error.

did

cd /var/discourse; chown -R root:root ./*

but still the same error.

EDIT: After rebooting the conatiner I get this error:

HTTP request sent, awaiting response... 502 Bad Gateway
2017-04-05 02:14:22 ERROR 502: Bad Gateway.

(Matt Palmer) #4

Oh, you did a recursive chown the first time? You’ve pooched yourself good and proper. Not everything under /var/discourse is supposed to be owned by root; under /var/discourse/shared most of it should be owned by UID 1000, while the pg database and redis data will have different ownership requirements.

If you’re working with scratch data, or have a very recent backup, I’d suggest nuking everything and starting again. Otherwise, setup a separate Discourse instance somewhere else (like on another DO droplet) and compare ownership information on your newly setup instance with your existing one, and try and put things back how they should be. Then do a full rebuild, and see what errors you still get, if any. Play whack-a-mole with those errors until everything is good again.


(Johnny) #5

I don’t have a recent backup. is there a way to get it? I did create backups but did not download.

should i download from > /var/discourse/shared/standalone/backups/default ?

P.S: I don’t need to install docker again? do I?


(Rafael dos Santos Silva) #6

Yes. Download a backup from there to a safe place.

And then remove the entire /var/discourse folder and start over.


(Johnny) #7

How do restore the backup?

When I go to > admin > settings > backups < I uploaded the previous backup. but I cannot click the restore button.


(Robby O'Connor) #8

Click over to site settings and search for restore, tick the checkbox and then it should work.