-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permission denied! "cp: cannot create regular file" #12
Comments
Hey @zhiweifang, that's usually related to permissions in the files you cloned from git. Is it possible that you either ran That happens because Docker uses volumes to persist some files, such as downloaded mods and the generated world and its saves. If the user who's executing the Docker command doesn't have write permission on the project folders, you'll have that permission error. |
I changed the access permissions of chmod -R 777 DSTClusterConfig
chmod -R 777 volumes Thanks a lot. |
@mathielo Relevant to this question. Recently my server was having issues. I was able to extract the DSTClusterConfig folder. I rebuild the server, went through the documentation again. And pushed my DSTClusterConfig folder into the dst-dedicated-server folder. Launched the server and everything works fine (as far as I can tell), except for the mods. For some reason I keep getting errors such as:
I also get this error when shutting down which isn't mod related.
I used |
Hey @X-lem! All the issues seems to be the same, permissions in the
Nope, you probably won't have any saves as well. You'll be able to run the server and play, but it won't save the progress (as it's getting permission denied).
☝️ That's werid, because this command shuold fix the ownership problem. What do you see when you go into
Can you confirm that your user/group is actually listed there as the owner of If still unsolved, what OS are you in? |
Thank you @mathielo for taking the time! I appreciate it. I ran the command as instructed. Here is my output on the two folders. I'm currently running Ubuntu, 18.04. The project root is also owned by my user. |
In my case, I think it is the problem of docker configuration. I notice that the docker container is not owned by my user although it is started in my user account by Using
in which I don't know much about |
Damn that's really weird. I never saw different users running the docker processes before 🤔 😕 There could be something really off with the docker installation. @X-lem can you check with I see you have granted I know this might be a bit too much, but could you please describe the steps taken from the beginning? Is this your PC with Ubuntu, or did you get a virtual/hosted machine for it? How was docker installed? I'm actually quite curious to understand how this can happen. I've run this image several different installations of Debian, Ubuntu and MacOS and never faced such problem 😔 If I can find a way to reproduce it then I can look into a "fix" for it, be it changing something in the docker images/setup or in the documentation. |
By the way, if you change permissions to |
@mathielo Took a snapshot of Order of operation I essentially followed the docs when I set the server up. I'll post below exactly what I did. I'm running a EC2 AWS instance for this. Specifically ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20180912 (ami-0bbe6b35405ecebdb)
I created my own superuser.
Then I switched to the user
Followed the Ubuntu guide for installing Docker.
Verified that I had the key with fingerprint. The expected results were printed out.
created docker group
logged out and back in. Ran I think at this point it said I needed to install docker compose. I believe it suggested to run
Reran the Then cloned the git repository
I deleted the DSTClusterConfig folder and replaced it with my own. Ran That's about it for the process. I obviously added my cluster token as well. |
Hey @X-lem thanks for the detailed response, sorry I couldn't get back at you sooner. I can't see any flaw in the steps, they look correct and should work just fine. Not sure if the issue is because stuff was moved (it shoudn't as you did
I guess, then. That should solve the permission issues. On another note, check these tips on dedicated server performance.
It's not advised to use AWS EC2 instances that rely on the "CPU credits" model. This model only works to run applications that have low CPU usage with eventual spikes. The dedicated server uses plenty CPU (specially when there's at least one player connected), so shortly you would exceed your credits and AWS would cap the processing power of your instance. |
@mathielo No worries 😄 I appreciate the help. I'll assign my user to the Ubuntu group as well. If that doesn't work either than 🤷♂️ I don't believe I'm using a credit model in AWS. I do pay a couple bucks a month for it depending upon usage. The model I'm using isn't a free tier so I don't think they cap it (except for when it reaches the t3.small limit which I have not had a problem with yet). Edit: Actually, it doesn't look like there is a Ubuntu group... odd. |
@X-lem it's because you created a user.
Docker has the user You need the following in your compose file:
Do this for both dst_master and dst_caves @mathielo submitting a pull request to update the compose file |
That's not correct. Which user is used to execute any docker / docker-compose commands is completely irrelevant. Docker uses a root daemon process which does everything for you in the end. The user interacting with the docker daemon has no effect on anything. The user which is used inside the container is defined inside the Dockerfile or the process running inside the container. With your docker image this user appears to have UID=1000 and GID=1000. A possible fix could be to add |
cp: cannot stat '.env.example': No such file or directory |
I just got the same problem, and I try to add the information about PUID and PGID in the docker-compoe.yml after check the output of
|
Hi,
I follow the instructions to build a dst-server.
When I start the docker:
docker-compose up -d # without sudo!!
The output is:
Then I attach the docker, I found the following logs:
Any suggestions for this?
The text was updated successfully, but these errors were encountered: