I am trying to attach an NFS volume to a docker based app but this causes the app to crash and fail. The application runs fine when the volume is not attached, but when I stop the app and attach a volume I cannot start it again.
$ cf bind-service lattice-app lattice-volume -c '{"uid":"1000","gid":"1000"}'
Binding service lattice-volume to app lattice-app in org demo / space demo as demo...
OK
TIP: Use 'cf restage lattice-app' to ensure your env variable changes take effect
$ cf start lattice-app
Starting app lattice-app in org demo / space demo as demo...
0 of 3 instances running, 3 starting
0 of 3 instances running, 3 starting
0 of 3 instances running, 3 starting
0 of 3 instances running, 3 starting
0 of 3 instances running, 3 starting
0 of 3 instances running, 3 starting
0 of 3 instances running, 3 starting
0 of 3 instances running, 1 starting, 2 crashed
FAILED
Start unsuccessful
TIP: use 'cf logs lattice-app --recent' for more information
$ cf logs lattice-app --recent
Connected, dumping recent logs for app lattice-app in org demo / space demo as demo...
2017-07-13T14:48:21.04+0100 [CELL/1] OUT Destroying container
2017-07-13T14:48:21.04+0100 [CELL/1] OUT Successfully destroyed container
2017-07-13T14:48:21.09+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:48:21.10+0100 [CELL/1] OUT Creating container
2017-07-13T14:48:21.12+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"6797fea2-2e66-4bbf-66b3-7638", "index"=>1, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>2, "crash_timestamp"=>1499953700980159051, "version"=>"fd03e786-fae1-4e43-bd85-32df5e4e848e"}
2017-07-13T14:48:21.27+0100 [CELL/0] ERR Failed to create container
2017-07-13T14:48:21.34+0100 [CELL/0] OUT Destroying container
2017-07-13T14:48:21.34+0100 [CELL/0] OUT Successfully destroyed container
2017-07-13T14:48:21.36+0100 [CELL/2] ERR Failed to create container
2017-07-13T14:48:21.40+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:48:21.43+0100 [CELL/2] OUT Destroying container
2017-07-13T14:48:21.43+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"160b2f59-eed6-4f6e-448b-a67e", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>2, "crash_timestamp"=>1499953701286492340, "version"=>"fd03e786-fae1-4e43-bd85-32df5e4e848e"}
2017-07-13T14:48:21.43+0100 [CELL/2] OUT Successfully destroyed container
2017-07-13T14:48:21.44+0100 [CELL/0] OUT Creating container
2017-07-13T14:48:21.47+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:48:21.59+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"2f48ddd8-67ee-49fe-6e54-7e55", "index"=>2, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>2, "crash_timestamp"=>1499953701371752041, "version"=>"fd03e786-fae1-4e43-bd85-32df5e4e848e"}
2017-07-13T14:48:21.61+0100 [CELL/2] OUT Creating container
2017-07-13T14:48:29.36+0100 [CELL/1] ERR Failed to create container
2017-07-13T14:48:29.39+0100 [CELL/1] OUT Destroying container
2017-07-13T14:48:29.39+0100 [CELL/1] OUT Successfully destroyed container
2017-07-13T14:48:29.44+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:48:29.47+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"82f3ecc3-758e-465b-52cf-45c3", "index"=>1, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>3, "crash_timestamp"=>1499953709377010910, "version"=>"fd03e786-fae1-4e43-bd85-32df5e4e848e"}
2017-07-13T14:48:29.70+0100 [CELL/0] ERR Failed to create container
2017-07-13T14:48:29.72+0100 [CELL/0] OUT Destroying container
2017-07-13T14:48:29.73+0100 [CELL/0] OUT Successfully destroyed container
2017-07-13T14:48:29.76+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:48:29.79+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"cc9a8c54-0ae7-4f34-750b-3221", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>3, "crash_timestamp"=>1499953709711415445, "version"=>"fd03e786-fae1-4e43-bd85-32df5e4e848e"}
2017-07-13T14:48:30.05+0100 [CELL/2] ERR Failed to create container
2017-07-13T14:48:30.07+0100 [CELL/2] OUT Destroying container
2017-07-13T14:48:30.07+0100 [CELL/2] OUT Successfully destroyed container
2017-07-13T14:48:30.11+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:48:30.13+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"ef488043-3516-40f8-72cf-b241", "index"=>2, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>3, "crash_timestamp"=>1499953710059562820, "version"=>"fd03e786-fae1-4e43-bd85-32df5e4e848e"}
2017-07-13T14:49:15.82+0100 [CELL/0] OUT Creating container
2017-07-13T14:49:15.83+0100 [CELL/1] OUT Creating container
2017-07-13T14:49:15.86+0100 [CELL/2] OUT Creating container
2017-07-13T14:49:24.18+0100 [CELL/0] ERR Failed to create container
2017-07-13T14:49:24.23+0100 [CELL/0] OUT Destroying container
2017-07-13T14:49:24.23+0100 [CELL/0] OUT Successfully destroyed container
2017-07-13T14:49:24.56+0100 [CELL/2] ERR Failed to create container
2017-07-13T14:49:24.59+0100 [CELL/2] OUT Destroying container
2017-07-13T14:49:24.59+0100 [CELL/2] OUT Successfully destroyed container
2017-07-13T14:49:24.66+0100 [CELL/1] ERR Failed to create container
2017-07-13T14:49:24.67+0100 [API/0] OUT Updated app with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 ({"state"=>"STOPPED"})
2017-07-13T14:49:24.70+0100 [CELL/1] OUT Destroying container
2017-07-13T14:49:24.70+0100 [CELL/1] OUT Successfully destroyed container
2017-07-13T14:50:55.04+0100 [API/0] OUT Updated app with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 ({"state"=>"STARTED"})
2017-07-13T14:50:55.21+0100 [CELL/1] OUT Creating container
2017-07-13T14:50:55.23+0100 [CELL/2] OUT Creating container
2017-07-13T14:50:55.24+0100 [CELL/0] OUT Creating container
2017-07-13T14:51:07.13+0100 [CELL/1] ERR Failed to create container
2017-07-13T14:51:07.19+0100 [CELL/1] OUT Destroying container
2017-07-13T14:51:07.20+0100 [CELL/1] OUT Successfully destroyed container
2017-07-13T14:51:07.23+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:51:07.25+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"a05d42b9-aba3-4539-7e49-39f9", "index"=>1, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>1, "crash_timestamp"=>1499953867139187688, "version"=>"2dbbf32c-eb0a-4102-b3df-a2046f640405"}
2017-07-13T14:51:07.27+0100 [CELL/1] OUT Creating container
2017-07-13T14:51:07.27+0100 [CELL/2] ERR Failed to create container
2017-07-13T14:51:07.30+0100 [CELL/0] ERR Failed to create container
2017-07-13T14:51:07.33+0100 [CELL/2] OUT Destroying container
2017-07-13T14:51:07.34+0100 [CELL/2] OUT Successfully destroyed container
2017-07-13T14:51:07.36+0100 [CELL/0] OUT Destroying container
2017-07-13T14:51:07.37+0100 [CELL/0] OUT Successfully destroyed container
2017-07-13T14:51:07.38+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:51:07.42+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:51:07.42+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"f4c37e52-b715-41a2-7aad-ec6a", "index"=>2, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>1, "crash_timestamp"=>1499953867289139364, "version"=>"2dbbf32c-eb0a-4102-b3df-a2046f640405"}
2017-07-13T14:51:07.43+0100 [CELL/2] OUT Creating container
2017-07-13T14:51:07.45+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"0eb93fdb-e2c3-4778-425f-7fa0", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>1, "crash_timestamp"=>1499953867317046507, "version"=>"2dbbf32c-eb0a-4102-b3df-a2046f640405"}
2017-07-13T14:51:07.45+0100 [CELL/0] OUT Creating container
2017-07-13T14:51:18.37+0100 [CELL/2] ERR Failed to create container
2017-07-13T14:51:18.43+0100 [CELL/2] OUT Destroying container
2017-07-13T14:51:18.43+0100 [CELL/2] OUT Successfully destroyed container
2017-07-13T14:51:18.45+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:51:18.48+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"a52f0e58-4326-4b9b-4e4c-7a53", "index"=>2, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>2, "crash_timestamp"=>1499953878384243087, "version"=>"2dbbf32c-eb0a-4102-b3df-a2046f640405"}
2017-07-13T14:51:18.50+0100 [CELL/2] OUT Creating container
2017-07-13T14:51:18.81+0100 [CELL/1] ERR Failed to create container
2017-07-13T14:51:18.88+0100 [CELL/1] OUT Destroying container
2017-07-13T14:51:18.88+0100 [CELL/1] OUT Successfully destroyed container
2017-07-13T14:51:18.93+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:51:18.95+0100 [CELL/1] OUT Creating container
2017-07-13T14:51:18.97+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"911a85a7-1f8a-476e-57db-1a77", "index"=>1, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>2, "crash_timestamp"=>1499953878823882841, "version"=>"2dbbf32c-eb0a-4102-b3df-a2046f640405"}
2017-07-13T14:51:23.59+0100 [CELL/0] ERR Failed to create container
2017-07-13T14:51:23.66+0100 [CELL/0] OUT Destroying container
2017-07-13T14:51:23.67+0100 [CELL/0] OUT Successfully destroyed container
2017-07-13T14:51:23.72+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:51:23.75+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"d38afb1a-6701-4ad7-6c7d-4f7c", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>2, "crash_timestamp"=>1499953883608024285, "version"=>"2dbbf32c-eb0a-4102-b3df-a2046f640405"}
2017-07-13T14:51:23.77+0100 [CELL/0] OUT Creating container
2017-07-13T14:51:31.00+0100 [CELL/2] ERR Failed to create container
2017-07-13T14:51:31.03+0100 [CELL/2] OUT Destroying container
2017-07-13T14:51:31.03+0100 [CELL/2] OUT Successfully destroyed container
2017-07-13T14:51:31.07+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:51:31.11+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"1ec13499-90b5-482f-56b3-3095", "index"=>2, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>3, "crash_timestamp"=>1499953891012606481, "version"=>"2dbbf32c-eb0a-4102-b3df-a2046f640405"}
2017-07-13T14:51:31.21+0100 [CELL/1] ERR Failed to create container
2017-07-13T14:51:31.24+0100 [CELL/1] OUT Destroying container
2017-07-13T14:51:31.24+0100 [CELL/1] OUT Successfully destroyed container
2017-07-13T14:51:31.28+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:51:31.32+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"e95342f4-cee8-4867-4a9f-a697", "index"=>1, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>3, "crash_timestamp"=>1499953891220437015, "version"=>"2dbbf32c-eb0a-4102-b3df-a2046f640405"}
2017-07-13T14:51:37.26+0100 [CELL/0] ERR Failed to create container
2017-07-13T14:51:37.29+0100 [CELL/0] OUT Destroying container
2017-07-13T14:51:37.30+0100 [CELL/0] OUT Successfully destroyed container
2017-07-13T14:51:37.35+0100 [API/0] OUT Process has crashed with type: "web"
2017-07-13T14:51:37.38+0100 [API/0] OUT App instance exited with guid 788000fa-402d-4e4f-a8f3-ff5085de6636 payload: {"instance"=>"9c6dd52e-5ebc-47ee-4b97-9278", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container", "crash_count"=>3, "crash_timestamp"=>1499953897280095251, "version"=>"2dbbf32c-eb0a-4102-b3df-a2046f640405"}
$ cf unbind-service lattice-app lattice-volume
Unbinding app lattice-app from service lattice-volume in org demo / space demo as demo...
OK
$ cf restart lattice-app
Stopping app lattice-app in org demo / space demo as demo...
OK
Starting app lattice-app in org demo / space demo as demo...
0 of 3 instances running, 3 starting
0 of 3 instances running, 3 starting
3 of 3 instances running
App started
OK
I have tested omitting UID/GID settings which had the same outcome as above in my example and have confirmed that attaching the volume to buildpack based applications works without any issues.