easyengine icon indicating copy to clipboard operation
easyengine copied to clipboard

The docker install doesn't roll back after cancelled install

Open pojke opened this issue 5 years ago • 4 comments

This is related to this thread: https://community.easyengine.io/t/brand-new-ec2-instance-fails-installing-v4/12372

I thought there's a random problem but I replicated it and finally can report a bug.

Here's the use-case. When you copy and paste the command from the website it contains end of the line character and submits the command, which is user error but I'd say quite common one. So try this:

  1. Create a brand new instance
  2. Copy and paste the download comand from EE website: wget -qO ee rt.cx/ee4 && sudo bash ee
  3. Copy and paste website creation command from EE homepage: sudo ee site create example.com --type=wp

Now at this stage, it will install example.com but you don't want that URL because you wanted to change URL but the end of the line at the end commits the command, so you quickly press CTRL+C and change the URL to your own one. However, from now on EE is broken and can't be used unless uninstalled completely because docker hasn't rolled back after ctrl+c.

From then on you get this: ubuntu@ip-172-31-11-87:/opt/easyengine$ sudo ee site create website.com --type=wp Error: There was some error in starting services_global-nginx-proxy_1 container. Please check logs. And the logs:

[03-03-2019 20:26:12] ee.DEBUG: -----------------------
[03-03-2019 20:26:12] ee.DEBUG: COMMAND: docker ps > /dev/null
[03-03-2019 20:26:12] ee.DEBUG: RETURN CODE: 0
[03-03-2019 20:26:12] ee.DEBUG: -----------------------
[03-03-2019 20:26:12] ee.DEBUG: -----------------------
[03-03-2019 20:26:12] ee.DEBUG: COMMAND: command -v docker-compose > /dev/null
[03-03-2019 20:26:12] ee.DEBUG: RETURN CODE: 0
[03-03-2019 20:26:12] ee.DEBUG: -----------------------
[03-03-2019 20:26:12] ee.DEBUG: Using default global config: /opt/easyengine/config/config.yml
[03-03-2019 20:26:12] ee.DEBUG: No project config found
[03-03-2019 20:26:12] ee.DEBUG: argv: /usr/local/bin/ee site create website.com --type=wp
[03-03-2019 20:26:12] ee.DEBUG: Running command: site
[03-03-2019 20:26:12] ee.DEBUG: COMMAND: which docker
[03-03-2019 20:26:12] ee.DEBUG: RETURN CODE: 0
[03-03-2019 20:26:12] ee.DEBUG: -----------------------
[03-03-2019 20:26:12] ee.DEBUG: COMMAND: docker inspect -f '{{.State.Running}}' services_global-nginx-proxy_1
[03-03-2019 20:26:13] ee.DEBUG: STDOUT:
[03-03-2019 20:26:13] ee.DEBUG: STDERR: Error: No such object: services_global-nginx-proxy_1
[03-03-2019 20:26:13] ee.DEBUG: RETURN CODE: 1
[03-03-2019 20:26:13] ee.DEBUG: -----------------------
[03-03-2019 20:26:13] ee.DEBUG: -----------------------
[03-03-2019 20:26:13] ee.DEBUG: COMMAND: docker network inspect ee-global-backend-network
[03-03-2019 20:26:13] ee.DEBUG: STDOUT: [     {         "Name": "ee-global-backend-network",         "Id": "8d5d7e1b671d50889aa4a3dffe11118587d984bea3aeb89aced5035ca9d043eb",         "Created": "2019-03-03T19:57:49.457591081Z",         "Scope": "local",         "Driver": "bridge",         "EnableIPv6": false,         "IPAM": {             "Driver": "default",             "Options": {},             "Config": [                 {                     "Subnet": "172.18.0.0/16",                     "Gateway": "172.18.0.1"                 }             ]         },         "Internal": false,         "Attachable": false,         "Ingress": false,         "ConfigFrom": {             "Network": ""         },         "ConfigOnly": false,         "Containers": {},         "Options": {},         "Labels": {             "org.label-schema.vendor": "EasyEngine"         }     } ]
[03-03-2019 20:26:13] ee.DEBUG: RETURN CODE: 0
[03-03-2019 20:26:13] ee.DEBUG: -----------------------
[03-03-2019 20:26:13] ee.DEBUG: -----------------------
[03-03-2019 20:26:13] ee.DEBUG: COMMAND: docker network inspect ee-global-frontend-network
[03-03-2019 20:26:13] ee.DEBUG: STDOUT: [     {         "Name": "ee-global-frontend-network",         "Id": "06619a56d91995c4b10c0542db5a32dd67fecf3ababd3874dfb95cec54f4d7cb",         "Created": "2019-03-03T19:57:49.577470065Z",         "Scope": "local",         "Driver": "bridge",         "EnableIPv6": false,         "IPAM": {             "Driver": "default",             "Options": {},             "Config": [                 {                     "Subnet": "172.19.0.0/16",                     "Gateway": "172.19.0.1"                 }             ]         },         "Internal": false,         "Attachable": false,         "Ingress": false,         "ConfigFrom": {             "Network": ""         },         "ConfigOnly": false,         "Containers": {},         "Options": {},         "Labels": {             "org.label-schema.vendor": "EasyEngine"         }     } ]
[03-03-2019 20:26:13] ee.DEBUG: RETURN CODE: 0
[03-03-2019 20:26:13] ee.DEBUG: -----------------------
[03-03-2019 20:26:13] ee.DEBUG: -----------------------
[03-03-2019 20:26:13] ee.DEBUG: COMMAND: docker-compose up -d global-nginx-proxy
[03-03-2019 20:26:13] ee.DEBUG: STDERR: Volume global-nginx-proxy_vhostd declared as external, but could not be found. Please create the volume manually using `docker volume create --name=global-nginx-proxy_vhostd` and try again.
[03-03-2019 20:26:13] ee.DEBUG: RETURN CODE: 1
[03-03-2019 20:26:13] ee.DEBUG: -----------------------
[03-03-2019 20:26:13] ee.ERROR: There was some error in starting services_global-nginx-proxy_1 container. Please check logs.

The quick solution is to kill the instance and start again.

pojke avatar Mar 07 '19 20:03 pojke

Now at this stage, it will install example.com but you don't want that URL because you wanted to change URL but the end of the line at the end commits the command, so you quickly press CTRL+C and change the URL to your own one.

I just checked the EasyEngine homepage on multiple browsers on both Linux and MacOS. Didn't find any copy-paste issues because of a newline. If you are not able to copy the the command properly, then you can maybe type the command or try to do the copy-paste a little more carefully.

so you quickly press CTRL+C This is bound to cause issues with any installation. If you are forcefully halting an installation midway, then you can expect to face some issues.

We don't believe this is a bug in EasyEngine or an error on the EasyEngine homepage. So closing this issue. You can comment again if you believe I missed something or create a new issue for any other problems you might be having.

mbtamuli avatar Mar 08 '19 02:03 mbtamuli

Umm.. Can you please re-read the thread? I don't think you understood it. It's nothing to do with your website

Now at this stage, it will install example.com but you don't want that URL because you wanted to change URL but the end of the line at the end commits the command, so you quickly press CTRL+C and change the URL to your own one.

I just checked the EasyEngine homepage on multiple browsers on both Linux and MacOS. Didn't find any copy-paste issues because of a newline. If you are not able to copy the the command properly, then you can maybe type the command or try to do the copy-paste a little more carefully.

Again - nothing to do with your website, it's every code snippet when you copy entire line contains end of line character in it. This is not the issue here.

so you quickly press CTRL+C This is bound to cause issues with any installation. If you are forcefully halting an installation midway, then you can expect to face some issues.

We don't believe this is a bug in EasyEngine or an error on the EasyEngine homepage. So closing this issue. You can comment again if you believe I missed something or create a new issue for any other problems you might be having.

This is a really disappointing approach. The issue is that you don't roll back changes OR cater for the error. It is a bug. If I install any package and press ctrl+c it either rolls back or allows me to retry. Your package from then on is completely broken and unusable (none of the commands from then on works). If that's not a bug then I don't know what is?!

pojke avatar Mar 08 '19 03:03 pojke

Seems like the issue is not with copy-pasting from the website but in EE itself. So it doesn't matter if you create a site by copying the command from EE home page or not, you'll still be getting this error.

@pojke Just from the information you provided, it's not clear when we should press Cntrl + C. What you can do to help is run command with --debug flag and then press cntrl+c. Now you can send us the whole output so we will know after which particular error message we would have to cancel the command to reproduce the error.

kirtangajjar avatar Mar 08 '19 11:03 kirtangajjar

@kirtangajjar I never said the problem is with the website, if you carefully read my original post it was giving you a use case when it happens. The problem is with EE. The usecase is common because highlighting entire line from your website it contains end of the line so you copy AND accidentally execute the command with example.com. All you need to do is realise that immediately that you copied end of the line and cancel. This way you break EE.

ubuntu@ip-172-31-9-132:~$ sudo ee site create example.com --type=wp --debug
Debug: ----------------------- (0.035s)
Debug: COMMAND: docker ps > /dev/null (0.036s)
Debug: RETURN CODE: 0 (0.075s)
Debug: ----------------------- (0.076s)
Debug: ----------------------- (0.076s)
Debug: COMMAND: command -v docker-compose > /dev/null (0.076s)
Debug: RETURN CODE: 0 (0.077s)
Debug: ----------------------- (0.077s)
Debug (bootstrap): Using default global config: /opt/easyengine/config/config.yml (0.079s)
Debug (bootstrap): No project config found (0.079s)
Debug (bootstrap): argv: /usr/local/bin/ee site create example.com --type=wp --debug (0.08s)
Debug (bootstrap): Running command: site (0.08s)
Debug: COMMAND: which docker (0.082s)
Debug: RETURN CODE: 0 (0.082s)
Debug: ----------------------- (0.082s)
Debug: COMMAND: docker inspect -f '{{.State.Running}}' services_global-nginx-proxy_1 (0.082s)
Debug: STDOUT:
 (0.139s)
Debug: STDERR: Error: No such object: services_global-nginx-proxy_1
 (0.14s)
Debug: RETURN CODE: 1 (0.14s)
Debug: ----------------------- (0.14s)
Debug: ----------------------- (0.15s)
Debug: COMMAND: docker volume ls --filter="label=org.label-schema.vendor=EasyEngine" --filter="label=io.easyengine.site=global-nginx-proxy" -q (0.15s)
Debug: RETURN CODE: 0 (0.191s)
Debug: ----------------------- (0.192s)
Debug: ----------------------- (0.192s)
Debug: COMMAND: docker info 2> /dev/null | awk '/Docker Root Dir/ {print $4}' (0.192s)
Debug: STDOUT: /var/lib/docker
 (0.256s)
Debug: RETURN CODE: 0 (0.257s)
Debug: ----------------------- (0.257s)
Debug: ----------------------- (0.257s)
Debug: COMMAND: docker volume create \
                                        --label "org.label-schema.vendor=EasyEngine" \
                                        --label "io.easyengine.site=global-nginx-proxy" \
                                        global-nginx-proxy_certs (0.257s)
Debug: STDOUT: global-nginx-proxy_certs
 (0.299s)
Debug: RETURN CODE: 0 (0.3s)
Debug: ----------------------- (0.3s)
Debug: ----------------------- (0.3s)
Debug: COMMAND: docker volume create \
                                        --label "org.label-schema.vendor=EasyEngine" \
                                        --label "io.easyengine.site=global-nginx-proxy" \
                                        global-nginx-proxy_dhparam (0.3s)
Debug: STDOUT: global-nginx-proxy_dhparam
 (0.34s)
Debug: RETURN CODE: 0 (0.34s)
Debug: ----------------------- (0.34s)
Debug: ----------------------- (0.341s)
Debug: COMMAND: docker volume create \
                                        --label "org.label-schema.vendor=EasyEngine" \
                                        --label "io.easyengine.site=global-nginx-proxy" \
                                        global-nginx-proxy_confd (0.341s)
Debug: STDOUT: global-nginx-proxy_confd
 (0.381s)
Debug: RETURN CODE: 0 (0.381s)
Debug: ----------------------- (0.381s)
Debug: ----------------------- (0.382s)
Debug: COMMAND: docker volume create \
                                        --label "org.label-schema.vendor=EasyEngine" \
                                        --label "io.easyengine.site=global-nginx-proxy" \
                                        global-nginx-proxy_htpasswd (0.382s)
Debug: STDOUT: global-nginx-proxy_htpasswd
 (0.423s)
Debug: RETURN CODE: 0 (0.424s)
Debug: ----------------------- (0.424s)
Debug: ----------------------- (0.424s)
Debug: COMMAND: docker volume create \
                                        --label "org.label-schema.vendor=EasyEngine" \
                                        --label "io.easyengine.site=global-nginx-proxy" \
                                        global-nginx-proxy_vhostd (0.424s)
Debug: STDOUT: global-nginx-proxy_vhostd
 (0.464s)
Debug: RETURN CODE: 0 (0.465s)
Debug: ----------------------- (0.465s)
Debug: ----------------------- (0.465s)
Debug: COMMAND: docker volume create \
                                        --label "org.label-schema.vendor=EasyEngine" \
                                        --label "io.easyengine.site=global-nginx-proxy" \
                                        global-nginx-proxy_html (0.465s)
^C
ubuntu@ip-172-31-9-132:~$ sudo ee site create example.com --type=wp
Error: There was some error in starting services_global-nginx-proxy_1 container. Please check logs.
ubuntu@ip-172-31-9-132:~$

pojke avatar Mar 10 '19 19:03 pojke