Unable to mount locationConfig.json with docker run
When trying to run the documentation command to use multiple backends (and mounting a custom locationConfig.json from host) with a container started with docker run :
docker run -d --name s3server -p 8000:8000 -e S3DATA=multiple -v ~/.aws/credentials:/root/.aws/credentials -v $(pwd)/locationConfig.json:/usr/src/app/locationConfig.json -e SCALITY_ACCESS_KEY_ID=accessKey1 -e SCALITY_SECRET_ACCESS_KEY=verySecretKey1 scality/s3server
it starts the container, which then exits on:
$ docker logs s3server
mv: cannot move 'locationConfig.json.tmp' to 'locationConfig.json': Device or resource busy
This issue cannot be replicated on earlier versions of the docker image. The main difference found is the entrypoint; when inspecting the image on older versions, we get:
"Path": "npm",
"Args": [
"start"
],
while on newer images, docker inspect gives:
"Path": "/usr/src/app/docker-entrypoint.sh",
"Args": [
"npm",
"start"
],
This change was probably due to Zenko?
The assumption here is that we try to mv a file that is being mounted/written at the same time, hence the conflict. We can start s3server without mounting the locationConfig.json file from host, and then use docker exec to edit the locationConfig.json inside the container (and then restart it to refresh)... Any ideas on how to fix the binding mechanism? @electrachong and @bennettbuchanan investigated this bug too, and replicated it on their machines, so they might have more to add to this issue.
I just pushed a new image to docker hub so any pulls of latest should be fixed.
I believe this very same problem happens with config.json, If I try to mount config.json in my container I get: mv: can't rename 'config.json.tmp': Resource busy
@gustavo-rios, the config.json issue should be fixed with this: https://github.com/scality/S3/pull/866
New docker image just pushed. Let me know if you are still having a problem. Thanks!
I am still having this problem with the latest image
mv: cannot move 'config.json.tmp' to 'config.json': Device or resource busy
Hi @s-block , can you please try with the new S3 image. Thanks 👍
We get this message when we change the log level to trace.
Log level has been modified to trace
mv: cannot move 'config.json.tmp' to 'config.json': Device or resource busy
We're switching to trace because on a couple of our ubuntu machines it is taking a long time for the service to get up and running. Like over a minute:
s3server_1 | {"name":"MetadataFileClient","time":1534187141142,"level":"info","message":"connecting to metadata service at http://localhost:9990/MDFile/metadata","hostname":"1e59fdee1225","pid":56}
s3server_1 | {"name":"S3","time":1534187141155,"level":"warn","message":"scality kms unavailable. Using file kms backend unless mem specified.","hostname":"1e59fdee1225","pid":56}
s3server_1 | {"name":"S3","time":1534187141203,"workerId":1,"workerPid":104,"level":"info","message":"new worker forked","hostname":"1e59fdee1225","pid":56}
s3server_1 | {"name":"MetadataFileServer","time":1534187141316,"level":"info","message":"creating metadata service at /MDFile/metadata","hostname":"1e59fdee1225","pid":94}
s3server_1 | {"name":"MetadataFileServer","time":1534187141320,"level":"info","message":"creating record log service at /MDFile/recordLog","hostname":"1e59fdee1225","pid":94}
s3server_1 | {"name":"MetadataFileServer","time":1534187141321,"level":"info","message":"starting metadata file backend server","hostname":"1e59fdee1225","pid":94}
s3server_1 | {"name":"DataFileStore","time":1534187141334,"level":"info","message":"pre-creating 3511 subdirs...","hostname":"1e59fdee1225","pid":87}
s3server_1 | {"name":"MetadataFileServer","time":1534187141441,"level":"info","message":"This deployment's identifier is f7012ca7-6bfb-4b9b-9bc3-a207c083f32c","hostname":"1e59fdee1225","pid":94}
s3server_1 | {"name":"MetadataFileClient","time":1534187141917,"level":"info","message":"connecting to metadata service at http://localhost:9990/MDFile/metadata","hostname":"1e59fdee1225","pid":104}
s3server_1 | {"name":"S3","time":1534187141929,"level":"warn","message":"scality kms unavailable. Using file kms backend unless mem specified.","hostname":"1e59fdee1225","pid":104}
s3server_1 | {"name":"S3","time":1534187141966,"https":false,"level":"info","message":"Http server configuration","hostname":"1e59fdee1225","pid":104}
s3server_1 | {"name":"S3","time":1534187141972,"address":"::","port":4572,"pid":104,"level":"info","message":"server started","hostname":"1e59fdee1225"}
s3server_1 | {"name":"DataFileStore","time":1534187208629,"level":"info","message":"data file store init complete, go forth and store data.","hostname":"1e59fdee1225","pid":87}
s3server_1 | {"name":"DataFileRESTServer","time":1534187208630,"method":"arsenal.network.Server.start","port":9991,"level":"info","message":"starting Server under http","hostname":"1e59fdee1225","pid":87}
s3server_1 | {"name":"DataFileRESTServer","time":1534187208632,"method":"arsenal.network.Server._onListening","address":{"address":"127.0.0.1","family":"IPv4","port":9991},"level":"info","message":"Server is listening","hostname":"1e59fdee1225","pid":87}
Also, even if we don't use a custom config.json, the service takes a while to start up, but the mv: cannot move 'config.json.tmp' to 'config.json': Device or resource busy error goes away.