I am defeated, please help! "Permission denied - /var/rails/canvas/config/database.yml"

923 views
Skip to first unread message

Jeff LeBoeuf

unread,
Oct 25, 2012, 2:53:51 PM10/25/12
to canvas-l...@googlegroups.com
Alright, so I followed this page down to the letter as best I could:

I paid extremely close attention to every instruction. I triple-checked every little thing that I was doing. Upon finishing I attempted to browse to my install and was greeted with this error:

Ruby (Rack) application could not be started
 
Error message:
  Permission denied - /var/rails/canvas/config/database.yml

Exception class:
  Errno::EACCES

Application root:
  /var/rails/canvas

I just checked at least 10 times (literally) to make sure I had the correct user set up in that file, with correct permissions to the databases, with the correct passwords. It all checks out.

This is a brand new install, just done today, on Ubuntu 12.04.1

I would be extremely grateful for some assistance. 

- Jeff

Jeff LeBoeuf

unread,
Oct 25, 2012, 3:05:28 PM10/25/12
to canvas-l...@googlegroups.com
Note: I even tried adding

PassengerDefaultUser canvasuser

To the passenger.conf file. Still no dice. 

- Jeff 

John Ford

unread,
Oct 25, 2012, 3:23:12 PM10/25/12
to canvas-l...@googlegroups.com
The problem is that passenger process can't open and read the database.yml file.

Have you checked the filesystem permissions of the database.yml file and all of its parent directories?  Is everything owned by canvasuser?


--
 
 
 

Jeff LeBoeuf

unread,
Oct 25, 2012, 3:27:57 PM10/25/12
to canvas-l...@googlegroups.com
I followed very closely the section detailed in https://github.com/instructure/canvas-lms/wiki/Production-Start labeled "Canvas ownership"

I ran the following commands:

sudo chown canvasuser config/*.yml
 sudo chmod 400 config/*.yml

Checking on my server, this is what I see:

 -r-------- 1 canvasuser    administrator   827 Oct 25 13:41 database.yml

My passenger.conf:

<IfModule mod_passenger.c>
  PassengerRoot /usr
  PassengerRuby /usr/bin/ruby
  PassengerDefaultUser canvasuser
</IfModule>

- Jeff

John Ford

unread,
Oct 25, 2012, 3:46:27 PM10/25/12
to canvas-l...@googlegroups.com
File perms look OK.  So either a parent directory has too tight of permissions/ownership or for some reason, the process is not running as canvasuser.

Can you run to confirm that passenger is running as canvasuser?
ps -efw | grep Rack




--
 
 
 

Jeff LeBoeuf

unread,
Oct 25, 2012, 3:52:12 PM10/25/12
to canvas-l...@googlegroups.com
Yikes, looks like something is happening here.

administrator@MOHLMS:/var/rails/canvas$ ps -efw | grep Rack
1000      8032  1402  0 15:49 pts/0    00:00:00 grep --color=auto Rack
administrator@MOHLMS:/var/rails/canvas$

Is there something from the guide I have missed? How can I make sure canvasuser runs what it needs to? As a fun side note, I don't see canvasuser running anything at all.

- Jeff

John Ford

unread,
Oct 25, 2012, 3:58:47 PM10/25/12
to canvas-l...@googlegroups.com
No, that's my fault. That's just the command you just ran :-)

OK, you have to do it the long way.  Run 'passenger-status' and it will list the passenger PIDs.  Then run 'ps -aux | grep <PID>' to get the process info for that process.


--
 
 
 

Jeff LeBoeuf

unread,
Oct 25, 2012, 4:03:34 PM10/25/12
to canvas-l...@googlegroups.com
Ohh boy, now we're getting somewhere...

administrator@MOHLMS:/var/rails/canvas$ passenger-status
*** Cleaning stale folder /tmp/passenger.7765
ERROR: Phusion Passenger doesn't seem to be running.
administrator@MOHLMS:/var/rails/canvas$

I've been going over everything a 3rd and 4th time.. I don't see anything that I've missed.

Jeff LeBoeuf

unread,
Oct 25, 2012, 4:15:03 PM10/25/12
to canvas-l...@googlegroups.com
Oops, also this:

administrator@MOHLMS:/var/rails/canvas$ ps aux | grep 7765
root      7800  0.0  0.0 286048  1864 ?        Sl   15:21   0:00 /usr/lib/phusion_passenger/ApplicationPoolServerExecutable 0 /usr/lib/phusion_passenger/passenger-spawn-server  /usr/bin/ruby  /tmp/passenger.7765
1000      8157  0.0  0.0   9384   924 pts/0    S+   16:13   0:00 grep --color=auto 7765
administrator@MOHLMS:/var/rails/canvas$

So, is root doing something it's not supposed to be doing?

- Jeff

Ron Santos

unread,
Oct 26, 2012, 9:50:10 AM10/26/12
to canvas-l...@googlegroups.com
Hi Jeff,

Yes, that's not a good solution moving forward. Try shutting it down and run 'chmod 400 database.yml' as 'canvasuser' rather than root, and see if that helps. That should work since canvasuser already owns the file.

-Ron

On Fri, Oct 26, 2012 at 6:24 AM, Jeff LeBoeuf <stooz...@gmail.com> wrote:
After applying 777 permissions to all the .yml files, Canvas will finally load.. but that can't be good right? 

On Fri, Oct 26, 2012 at 9:20 AM, Jeff LeBoeuf <stooz...@gmail.com> wrote:
I am able to cat the file successfully. 

After testing 777 permissions to the database file, it now proceeds to have a similar error under all .yml files that the guide instructed to lock down to `canvasuser`


On Thu, Oct 25, 2012 at 11:53 PM, Ron Santos <ron.s...@gmail.com> wrote:
Hi Jeff,

The error 'Errno::EACCES' is a file permission issue, usually. To confirm that the canvasuser can read the database.yml, try to 

su - canvasuser
cat /var/rails/canvas/config/database.yml

If successfully, you can always try to chmod 777 database.yml and see if that helps, just to rule if it's a file permission issue nor not. Have you also tried, recreated the database.yml file?

Hope this helps,
Ron


--
 
 
 




Reply all
Reply to author
Forward
0 new messages