azukaar / Cosmos-Server

☁️ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication, anti-DDOS, anti-bot)
https://cosmos-cloud.io
Other
3.65k stars 130 forks source link

[BUG]: Error while starting container: mkdir /var/lib/cosmos: read-only file system #252

Closed alelom closed 6 months ago

alelom commented 6 months ago

What happened?

Ubuntu server 24. When running the one-liner installer:

docker run -d --network host  --privileged --name cosmos-server -h cosmos-server --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /:/mnt/host -v /var/lib/cosmos:/config azukaar/cosmos-server:latest

I get:

docker: Error response from daemon: error while creating mount source path '/var/lib/cosmos': mkdir /var/lib/cosmos: read-only file system.

The container is started, but I cannot connect to Cosmos-cloud.

Some users report elsewhere that this can be worked around using docker compose. I can confirm that the workaround works for me too. It consists in changing the config filepath in the yaml file.

I still wonder why the workaround is required and why the one-liner fails.

What should have happened?

The error should not appear.

How to reproduce the bug?

  1. Run the docker one-liner install as instructed by the Get Started
  2. The error appears

Relevant log output

No response

Other details

No response

System details

azukaar commented 6 months ago

are you

If yes then that might be the root of the issue, either way the one liner itself obviously work in a "normal" environment, that would be insane otherwise, You might want to check:

If you can't pin the issue, try to install into a different directory by changing the bind directory in the command

alelom commented 5 months ago

I just wanted to report what was the actual issue.

The issue is with the Docker installation that comes shipped with Ubuntu. You need to uninstall it and then follow the official Docker installation instructions. See this: https://stackoverflow.com/questions/52526219/docker-mkdir-read-only-file-system#comment106888743_52566470

After doing that, I was able to install Cosmos without trouble using the single liner.

I came back to this because I also was experiencing other issues with Docker on my Ubuntu server, I suspect the source was the same.

Maybe worth pointing this out in the installation instructions given that this can be a common hiccup for Ubuntu users (others have reported it on Reddit and Discord).

azukaar commented 5 months ago

You mean there was a pre-installed Docker on your ubuntu install?? Which distro is it exactly? Ubuntu server or desktop? Was it Docker Desktop (with the UI) ?

alelom commented 5 months ago

Which distro is it exactly? Ubuntu server or desktop? Was it Docker Desktop (with the UI) ?

Ubuntu Server 24.04 LTS (no GUI) as stated in the issue. From terminal (no docker desktop).

You mean there was a pre-installed Docker on your ubuntu install??

Yes, if so selected during the Ubuntu install:

image

This option must be toggled off, or Docker needs to be re-installed as explained in my previous post, where I also left a Reddit post link showing that it can indeed happen to other people.

azukaar commented 5 months ago

Good to know thanks