wordup-dev / wordup-cli

Wordup is a fully integrated development platform for WordPress. Develop plugins and themes locally. Preview in the cloud. Automatic updates in WP.
GNU General Public License v3.0
118 stars 16 forks source link

Error booting docker containers #10

Closed evertiro closed 4 years ago

evertiro commented 4 years ago

I'm experiencing an issue on Pop!_OS 19.04 (effectively Ubuntu 19.04 in terms of software repositories). When I run wordup init or wordup install, I get the following:

Installing wordup project and connected docker containers (can take some minutes)... -
 ›   Error: There was an error while booting the docker containers. Perhaps the
 ›   port is already taken.

Docker shows nothing running:

$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Neither UFW nor any other firewall is running that could be blocking the port. I've tested Docker itself through several containers outside of wordup and have no issues. Running via sudo or actually as the root user have no effect on whether or not it works.

lukkoro commented 4 years ago

Having same issue on 19.04. Had another docker container running, but after shutting it down the problem persists.

shry commented 4 years ago

I have bugfixed a linux issue 2 weeks ago, but its not released.

The problem on linux is the host user and the local file system. Thats why on linux the wordup install command tries to build the docker containers with a matching uid to your host system. I found this strategy on https://jtreminio.com/blog/running-docker-containers-as-current-host-user/

I'm not s super linux expert, if you guys have any ideas to fix this issue, it would be highly a appreciated :-)

lukkoro commented 4 years ago

This is the error wordup install --logs returns:

Version in "/home/koro/.nvm/versions/node/v12.8.0/lib/node_modules/wordup-cli/docker/docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1. For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/ › Error: There was an error while booting the docker containers. Perhaps the › port is already taken.

And the UID that's returned is 1000.

I managed to fix this issue by changing the version of the compose file, falling back to 3.3.

shry commented 4 years ago

Thank you very much. So it seems that the docker-compose file version is higher than your system supports. I will checkout if i can lower the version without breaking up things.

shry commented 4 years ago

I have released a patch with a lower docker-compose file version of 3.3 This is a good fix because now wordup will be backward compatible up to docker 17.06.0

evertiro commented 4 years ago

Getting this:

Installing wordup project and connected docker containers (can take some minutes)
Version mismatch: file /usr/lib/node_modules/wordup-cli/docker/docker-compose.yml specifies version 3.3 but extension file /usr/lib/node_modules/wordup-cli/docker/docker-compose.build.yml uses version 3.7
 ›   Error: There was an error while booting the docker containers. Perhaps the port is already taken.

If I switch it to 3.7, I get this:

Installing wordup project and connected docker containers (can take some minutes)
Version in "/usr/lib/node_modules/wordup-cli/docker/docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
 ›   Error: There was an error while booting the docker containers. Perhaps the port is already taken.
shry commented 4 years ago

I don't know why the two version are now different on your system. Have you tried: npm update -g wordup-cli ? Because you need the new version 0.7.3

evertiro commented 4 years ago

Odd... I swear I did that before, but I just did it again and it worked.