Mkdir /opt/openvidu: read-only file system

Hello,
I am deploying Openvidu on premises, when I start it as root with this command :
./openvidu start

I get this error :

Starting openvidu_openvidu-server_1 …
Starting openvidu_kms_1 …
openvidu_redis_1 is up-to-date
Starting openvidu_nginx_1 …
openvidu_app_1 is up-to-date
Starting openvidu_openvidu-server_1 … error

ERROR: for openvidu_nginx_1 Cannot start service nginx: error while creating mount source path ‘/opt/openvidu/custom-layout’: mkdir /opt/openvidu: read-only file system
Starting openvidu_kms_1 … error
ERROR: for openvidu_openvidu-server_1 Cannot start service openvidu-server: error while creating mount source path ‘/opt/openvidu/custom-layout’: mkdir /opt/openvidu: read-only file system

ERROR: for openvidu_kms_1 Cannot start service kms: error while creating mount source path ‘/opt/openvidu/kms-crashes’: mkdir /opt/openvidu: read-only file system

ERROR: for nginx Cannot start service nginx: error while creating mount source path ‘/opt/openvidu/custom-layout’: mkdir /opt/openvidu: read-only file system

ERROR: for openvidu-server Cannot start service openvidu-server: error while creating mount source path ‘/opt/openvidu/custom-layout’: mkdir /opt/openvidu: read-only file system

ERROR: for kms Cannot start service kms: error while creating mount source path ‘/opt/openvidu/kms-crashes’: mkdir /opt/openvidu: read-only file system
ERROR: Encountered errors while bringing up the project.
Attaching to openvidu_openvidu-server_1
openvidu_openvidu-server_1 exited with code 128

I am using Ubuntu 20.04.
Can someone help me please ?

I did a sudo chmod 777 openvidu/ but I still have the same error, I continue to try.

I successfully started Openvidu as root using Debian 10.
I did not have to change permissions of the openvidu directory.

Documentation is very clear regarding this aspect. Actually is the first instruction in the deployment steps:

Hello, I got this error starting Openvidu as root with Ubuntu, but it worked with Debian, I don’t know why.

We have always used Ubuntu, never experienced this problem. If you follow instructions in the deployment section in a clean Ubuntu machine as root user, everything will work just fine.

If you had said that the problem arose in a strange, less-common Linux distribution, then I couldn’t be 100% sure that everything in the doc was right. But Ubuntu is actually the distribution we have and will always work on. So I can safely say that the documentation steps are correct.

I did the same with Ubuntu and Debian (clean installations), I “started root” in a terminal then did ./openvidu start (opt directory), but it worked only with Debian, maybe I missed something.

I’ve encountered the same issue.
I am convinced that there is a problem with Docker in Snap, it cannot modify /opt.
Therefore, the solution is to uninstall Docker and use the official script to reinstall the latest version of Docker.
I have tested it and it works.
Note that this will result in the loss of all your Docker containers and images.

sudo snap remove docker

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Alternatively, you could consider modifying all Docker-mounted source directories to not use /opt. I have not tried this solution.

1 Like

As @AoEiuV020 said, don’t install docker from snaps.

Docker has its own repositories for Ubuntu, the same instructions are present in the installation docs of Docker: