codekitchen / dinghy

faster, friendlier Docker on OS X
MIT License
2.12k stars 109 forks source link

"Read-only file system" error #189

Open longlostnick opened 8 years ago

longlostnick commented 8 years ago

I'm sorry if this has already been answered somewhere. I looked at the FAQ and didn't see anything that could help me.

Everything was working fine for the past couple weeks or so, but suddenly when I went start everything up I'm running into some mount permissions issues.

This is the error I get when trying to modify a anything inside the container in my mount directory:

root@e17260d4d5d7:/code# touch file
touch: cannot touch 'file': Read-only file system

Here are the current permissions of my volume inside the container:

drwxr-xr-x  29  501 dialout  986 Jun 10 21:49 code

Here's the info from running mount:

192.168.99.1:/Users/nick/Development/upcounsel/uc-docker/code/uc-web on /code type nfs (rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nolock,proto=udp,port=19370,timeo=7,retrans=3,sec=sys,local_lock=all,addr=192.168.99.1)

The odd part is that it has been working fine, and suddenly today it decided to stop working. I'm not sure what happened. The only big thing I did since the last time I was working is install Mac updates and restart my computer.

Thanks!

tschum commented 8 years ago

http://askubuntu.com/questions/197459/how-to-fix-sudo-unable-to-open-read-only-file-system

The filesystem will usually go into read-only while the system is running if there is a filesystem consistency issue. This is specified in fstab as errors=remount-ro and will occur when a FS access fails or an emergency read-only remount is requested via Alt+SysRq+U. You can run:

sudo fsck -Af -M to force a check of all filesystems. As one of the other answers states, looking at dmesg is also very helpful.

codekitchen commented 8 years ago

Are files actually still readable in this state? I'm surprised that NFS could get into a state where reads work but writes fail, unless your Mac's disk truly was failing. Does the problem persist across a dinghy restart and a restart of your Mac?

longlostnick commented 8 years ago

Thanks guys. I think I figured it out.

I was having problems with Rails picking up file changes so I added lookupcache=none to custom_nfs_export_options. Removing that seems to have fixed it.

However now I'm still going to be back to the caching problem, and I'm not sure what to do there. I also don't know why setting lookupcache would have caused a problem in the first place.

Edit: also restarting dingy and even my mac wasn't fixing the problem.

codekitchen commented 7 years ago

Yeah, that might be difficult to answer without digging into unfs internals, unfortunately. Are you still seeing issues with Rails not picking up file changes? Are you using the default asset pipeline?

mqliang commented 7 years ago

I meet this issue also.

  1. dinghy up
    
    ➜  proginn git:(dev) ✗ dinghy up
    Starting the dinghy VM...
    Starting NFS daemon, this will require sudo
    Waiting for NFS daemon...
    Mounting NFS /Users/mqliang
    Starting the FsEvents daemon
    Starting DNS and HTTP proxy
    48df0d75cb8c0f415b8e2dab716de1225d1952ec5d456a0b68f09bdc1658a404
    VM: running
    NFS: running
    FSEV: running
    DNS: running
    PROXY: running

Your environment variables are already set correctly.


2. run my app

➜ proginn git:(dev) ✗ docker-compose -f dev.yml up -d Starting proginn_web Starting proginn_sites ➜ proginn git:(dev) ✗ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 48df0d75cb8c codekitchen/dinghy-http-proxy:2.5 "/app/docker-entry..." 21 seconds ago Up 20 seconds 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 19322/tcp, 0.0.0.0:19322->19322/udp dinghy_http_proxy 9d9cecad4575 proginn_sites "/code/script/ngin..." 32 minutes ago Up Less than a second 0.0.0.0:8002->80/tcp proginn_sites 69d662784236 proginnweb "/code/script/web..." 32 minutes ago Up Less than a second 80/tcp proginn_web


3. docker logs

nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (30: Read-only file system) 2017/07/06 22:16:04 [emerg] 22#0: open() "/var/log/nginx/access.log" failed (30: Read-only file system)

solidevolution commented 6 years ago

Any news here? It's 2018 ;)

codekitchen commented 6 years ago

I'm not sure what news you are looking for, if you are experiencing this and you have more information that could help pin down this issue then we may be able to get some movement on it. https://github.com/codekitchen/dinghy/issues/274 may also be relevant.