zodern / meteor-up

Production Quality Meteor Deployment to Anywhere
http://meteor-up.com/
MIT License
1.28k stars 279 forks source link

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. #1310

Closed Sergeyamir closed 2 years ago

Sergeyamir commented 2 years ago

Hello! The third day I'm struggling with the problem at this stage, are there any solutions? Thanks anyway :-)

Prepare Bundle: FAILED
               ------------------------------------ STDERR------------- ----------------------
          Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Although this file exists and I am running as root user with full rights

MQ-bkkk:~/environment/app/.deploy (main) $ sudo ls -la /var/run/docker.sock
srw-rw---- 1 root docker 0 Apr 10 08:44 /var/run/docker.sock

Mup version (mup --version): 1.5.7

Mup config

  "servers": {
    "one": {
      "host": "1.2.3.4",
      "username": "root",
      "password": "password"
    }
  },
  "app": {
    "name": "my-app",
    "path": "../",
    "servers": {
      "one": {}
    },
    "buildOptions": {
      "serverOnly": true,
      "buildLocation": "/tmp/mup-meteor-2020e0cc-43c4-4612-a39d-46a8f4827438",
      "cleanBuildLocation": true
    },
    "env": {
      "ROOT_URL": "http://host.com",
      "MONGO_URL": "mongodb+srv://user:pass@subdomain.subdomain.host.com/tesork?retryWrites=true&w=majority&readPreference=primaryPreferred"
    },
    "docker": {
      "image": "zodern/meteor:root",
      "stopAppDuringPrepareBundle": true,
      "imagePort": 3000
    },
    "enableUploadProgressBar": true,
    "type": "meteor"
  }
}

Output of command

MQ-bkkk:~/environment/app/.deploy (main) $ mup deploy --verbose 
Cleaning Up Previous Builds
Building App Bundle Locally
(node:4524) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:4524) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:4524) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
(node:4524) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(node:4524) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:4524) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating

Started TaskList: Pushing Meteor App
[1.2.3.4] - Pushing Meteor App Bundle to the Server
[1.2.3.4] - Pushing Meteor App Bundle to the Server: SUCCESS

Started TaskList: Prepare App Bundle
[1.2.3.4] - Prepare Bundle
Updating base image
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Preparing for docker build
Creating Dockerfile
Finished creating Dockerfile
Building image
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

real    0m1.958s
user    0m0.895s
sys     0m0.996s
[1.2.3.4] x Prepare Bundle: FAILED
              ------------------------------------STDERR------------------------------------
              Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
        Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

        real    0m1.958s
        user    0m0.895s
        sys     0m0.996s
              ------------------------------------STDOUT------------------------------------
              Updating base image
        Preparing for docker build
        Creating Dockerfile
        Finished creating Dockerfile
        Building image
              ------------------------------------------------------------------------------       

Checked docker start

MQ-bkkk:~/environment/app/.deploy (main) $ service docker status
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2022-04-10 08:44:31 UTC; 35min ago
     Docs: https://docs.docker.com
 Main PID: 1013 (dockerd)
    Tasks: 7
   CGroup: /system.slice/docker.service
           └─1013 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Apr 10 08:44:30 ip-172-31-27-248 dockerd[1013]: time="2022-04-10T08:44:30.103482399Z" level=warning msg="Your kernel does n
Apr 10 08:44:30 ip-172-31-27-248 dockerd[1013]: time="2022-04-10T08:44:30.103498989Z" level=warning msg="Your kernel does n
Apr 10 08:44:30 ip-172-31-27-248 dockerd[1013]: time="2022-04-10T08:44:30.103938573Z" level=warning msg="Your kernel does n
Apr 10 08:44:30 ip-172-31-27-248 dockerd[1013]: time="2022-04-10T08:44:30.104992262Z" level=info msg="Loading containers: s
Apr 10 08:44:30 ip-172-31-27-248 dockerd[1013]: time="2022-04-10T08:44:30.635187779Z" level=info msg="Default bridge (docke
Apr 10 08:44:30 ip-172-31-27-248 dockerd[1013]: time="2022-04-10T08:44:30.754549611Z" level=info msg="Loading containers: d
Apr 10 08:44:31 ip-172-31-27-248 dockerd[1013]: time="2022-04-10T08:44:31.008394796Z" level=info msg="Docker daemon" commit
Apr 10 08:44:31 ip-172-31-27-248 dockerd[1013]: time="2022-04-10T08:44:31.014770387Z" level=info msg="Daemon has completed 
Apr 10 08:44:31 ip-172-31-27-248 systemd[1]: Started Docker Application Container Engine.
Apr 10 08:44:31 ip-172-31-27-248 dockerd[1013]: time="2022-04-10T08:44:31.171117107Z" level=info msg="API listen on /var/ru
lines 1-19/19 (END)

MQ-bkkk:~/environment/app/.deploy (main) $ docker version

Client: Docker Engine - Community
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        e91ed57
 Built:             Mon Dec 13 11:45:27 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.12
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.12
  Git commit:       459d0df
  Built:            Mon Dec 13 11:43:36 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
Sergeyamir commented 2 years ago

Problem solved. Looking for an error on the forums, I found many possible causes related to setting access rights to the socket, etc. Everything turned out to be simpler and this reason was not mentioned anywhere: docker support was not enabled on the server. A letter to technical support with a request to enable docker support solved the problem.