1

I started my AWS OpsWorks instance this morning and received an error that it could not access the /srv/www directory. This is strange since everything worked normally yesterday. The instance is running Ubuntu 14.04.3 LTS.

After SSH:ing into the instance, I noticed that I could not even access /srv/www as root.

root@stg-worker1:/srv# ll
total 8
drwxr-xr-x  3 root root 4096 Sep 24 07:17 ./
drwxr-xr-x 23 root root 4096 Sep 24 06:41 ../
drwxrwxrwx  2 root root    0 Sep 24 06:41 www/
root@stg-worker1:/srv# cd www
-bash: cd: www: No such file or directory

Strangely enough the size of www directory is 0 bytes! I then checked the /var/www directory and noticed the same problem there (even though those two directories are not related to each other)

I then made a new test directory in /srv and it worked normally.

root@stg-worker1:/srv# mkdir test
root@stg-worker1:/srv# stat test
  File: ‘test’
  Size: 4096        Blocks: 8          IO Block: 4096   directory
Device: ca01h/51713d    Inode: 164068      Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-09-24 07:19:53.160462520 +0000
Modify: 2015-09-24 07:19:53.160462520 +0000
Change: 2015-09-24 07:19:53.160462520 +0000
 Birth: -

Stat command shows that it is on the correct device ca01h whereas the www directory was on another device

root@stg-worker1:/srv# stat www
  File: ‘www’
  Size: 0           Blocks: 0          IO Block: 1024   directory
Device: 1bh/27d Inode: 8970        Links: 2
Access: (0777/drwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-09-24 06:41:29.128571000 +0000
Modify: 2015-09-24 06:41:29.128571000 +0000
Change: 2015-09-24 06:47:56.392966341 +0000
 Birth: -

I did not make any changes to Opsworks configuration or to any cookbooks.

Any ideas what could cause this problem or how to further investigate?

1 Answer 1

0

Actually there was a change in the cookbook, which caused the OpsWorks setup to fail.

The cookbook was trying to access /srv/www during compilation of the cookbook and it looks like /srv/www is only setup by Opsworks once the cookbook compiles successfully.

1
  • I've also seen a similar behavior if you try to add a disk as a mount point that OpsWorks attempts to work with (e.g. mount a 20G disk to /var/www/ in Ubuntu) and it's up for grabs if it will properly mount on restart.
    – J. Lawson
    Dec 16, 2015 at 0:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .