dokku / dokku-mongo

a mongo plugin for dokku
MIT License
174 stars 32 forks source link

"ERROR: unable to connect" while create the database #145

Closed kamzata closed 2 years ago

kamzata commented 2 years ago

Description of problem

I cannot create any Mongo database with Dokku. I receive this error: "Waiting for container to be ready ERROR: unable to connect"

Steps to Reproduce

⌁ dokku  /home/dokku: dokku mongo:create vidlydb
Waiting for container to be ready
  ERROR: unable to connect

Actual Results

 ⌁ dokku  /home/dokku  1  sudo dokku mongo:info vidlydb
=====> vidlydb mongo service information
       Config dir:          /var/lib/dokku/services/mongo/vidlydb/config
       Config options:       --storageEngine wiredTiger --auth
       Data dir:            /var/lib/dokku/services/mongo/vidlydb/data
       Dsn:                 mongodb://vidlydb:632513454757448db0bfff63de15841e@dokku-mongo-vidlydb:27017/vidlydb
       Exposed ports:       -
       Id:                  7ec785ef3b811efca3e95fd262cccabd476c038a4f23fc0bbaa8dbf18f0b31f7
       Internal ip:
       Links:               -
       Service root:        /var/lib/dokku/services/mongo/vidlydb
       Status:              restarting
       Version:             mongo:5.0.3

Environment Information

dokku report Vidly output

 ⌁ kamzata  /home/dokku  dokku report vidly
-----> uname: Linux dokku 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
-----> memory:
                     total        used        free      shared  buff/cache   available
       Mem:           1987         413         451           1        1122        1381
       Swap:          2047           0        2047
-----> docker version:
       Client: Docker Engine - Community
        Version:           20.10.10
        API version:       1.41
        Go version:        go1.16.9
        Git commit:        b485636
        Built:             Mon Oct 25 07:42:59 2021
        OS/Arch:           linux/amd64
        Context:           default
        Experimental:      true

       Server: Docker Engine - Community
        Engine:
         Version:          20.10.10
         API version:      1.41 (minimum version 1.12)
         Go version:       go1.16.9
         Git commit:       e2f740d
         Built:            Mon Oct 25 07:41:08 2021
         OS/Arch:          linux/amd64
         Experimental:     false
        containerd:
         Version:          1.4.11
         GitCommit:        5b46e404f6b9f661a205e28d59c982d3634148f8
        runc:
         Version:          1.0.2
         GitCommit:        v1.0.2-0-g52b36a2
        docker-init:
         Version:          0.19.0
         GitCommit:        de40ad0
-----> docker daemon info:
WARNING: No swap limit support
       Client:
        Context:    default
        Debug Mode: true
        Plugins:
         app: Docker App (Docker Inc., v0.9.1-beta3)
         buildx: Build with BuildKit (Docker Inc., v0.6.3-docker)
         scan: Docker Scan (Docker Inc., v0.9.0)

       Server:
        Containers: 2
         Running: 1
         Paused: 0
         Stopped: 1
        Images: 20
        Server Version: 20.10.10
        Storage Driver: overlay2
         Backing Filesystem: extfs
         Supports d_type: true
         Native Overlay Diff: true
         userxattr: false
        Logging Driver: json-file
        Cgroup Driver: cgroupfs
        Cgroup Version: 1
        Plugins:
         Volume: local
         Network: bridge host ipvlan macvlan null overlay
         Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
        Swarm: inactive
        Runtimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2
        Default Runtime: runc
        Init Binary: docker-init
        containerd version: 5b46e404f6b9f661a205e28d59c982d3634148f8
        runc version: v1.0.2-0-g52b36a2
        init version: de40ad0
        Security Options:
         apparmor
         seccomp
          Profile: default
        Kernel Version: 5.4.0-90-generic
        Operating System: Ubuntu 20.04.3 LTS
        OSType: linux
        Architecture: x86_64
        CPUs: 2
        Total Memory: 1.941GiB
        Name: dokku
        ID: A4AF:ZRJL:WE5E:MMAM:N6VS:OX7N:QCAS:IMRC:EH2I:ND7L:PR23:X6E7
        Docker Root Dir: /var/lib/docker
        Debug Mode: false
        Registry: https://index.docker.io/v1/
        Labels:
        Experimental: false
        Insecure Registries:
         127.0.0.0/8
        Live Restore Enabled: false

-----> git version: git version 2.25.1
-----> sigil version: 0.7.1build+1ec3006
-----> herokuish version:
       herokuish: 0.5.31
       buildpacks:
         heroku-buildpack-multi     v1.0.0
         heroku-buildpack-ruby      v230
         heroku-buildpack-nodejs    v189
         heroku-buildpack-clojure   v87
         heroku-buildpack-python    v201
         heroku-buildpack-java      v69
         heroku-buildpack-gradle    v35
         heroku-buildpack-scala     v91
         heroku-buildpack-play      v26
         heroku-buildpack-php       v199
         heroku-buildpack-go        v156
         buildpack-nginx            v14
         buildpack-null             v3
-----> dokku version: dokku version 0.26.6
-----> plugn version: plugn: 0.7.1build+9bf216b
-----> dokku plugins:
         00_dokku-standard    0.26.6 enabled    dokku core standard plugin
         20_events            0.26.6 enabled    dokku core events logging plugin
         app-json             0.26.6 enabled    dokku core app-json plugin
         apps                 0.26.6 enabled    dokku core apps plugin
         builder              0.26.6 enabled    dokku core builder plugin
         builder-dockerfile   0.26.6 enabled    dokku core builder-dockerfile plugin
         builder-herokuish    0.26.6 enabled    dokku core builder-herokuish plugin
         builder-null         0.26.6 enabled    dokku core builder-null plugin
         builder-pack         0.26.6 enabled    dokku core builder-pack plugin
         buildpacks           0.26.6 enabled    dokku core buildpacks plugin
         certs                0.26.6 enabled    dokku core certificate management plugin
         checks               0.26.6 enabled    dokku core checks plugin
         common               0.26.6 enabled    dokku core common plugin
         config               0.26.6 enabled    dokku core config plugin
         cron                 0.26.6 enabled    dokku core cron plugin
         docker-options       0.26.6 enabled    dokku core docker-options plugin
         domains              0.26.6 enabled    dokku core domains plugin
         enter                0.26.6 enabled    dokku core enter plugin
         git                  0.26.6 enabled    dokku core git plugin
         logs                 0.26.6 enabled    dokku core logs plugin
         mongo                1.16.0 enabled    dokku mongo service plugin
         network              0.26.6 enabled    dokku core network plugin
         nginx-vhosts         0.26.6 enabled    dokku core nginx-vhosts plugin
         plugin               0.26.6 enabled    dokku core plugin plugin
         proxy                0.26.6 enabled    dokku core proxy plugin
         ps                   0.26.6 enabled    dokku core ps plugin
         registry             0.26.6 enabled    dokku core registry plugin
         repo                 0.26.6 enabled    dokku core repo plugin
         resource             0.26.6 enabled    dokku core resource plugin
         run                  0.26.6 enabled    dokku core run plugin
         scheduler            0.25.6 enabled    dokku core scheduler plugin
         scheduler-docker-local 0.26.6 enabled    dokku core scheduler-docker-local plugin
         scheduler-null       0.26.6 enabled    dokku core scheduler-null plugin
         shell                0.26.6 enabled    dokku core shell plugin
         ssh-keys             0.26.6 enabled    dokku core ssh-keys plugin
         storage              0.26.6 enabled    dokku core storage plugin
         trace                0.26.6 enabled    dokku core trace plugin
=====> vidly app-json information
       App json computed selected:    app.json
       App json global selected:      app.json
       App json selected:
=====> vidly app information
       App created at:                1637079024
       App deploy source:             vidly
       App deploy source metadata:    vidly
       App dir:                       /home/dokku/vidly
       App locked:                    false
=====> vidly builder information
       Builder build dir:
       Builder computed build dir:
       Builder computed selected:
       Builder global build dir:
       Builder global selected:
       Builder selected:
=====> vidly builder-dockerfile information
       Builder dockerfile computed dockerfile path: Dockerfile
       Builder dockerfile global dockerfile path: Dockerfile
       Builder dockerfile dockerfile path:
=====> vidly builder-pack information
       Builder pack computed projecttoml path: project.toml
       Builder pack global projecttoml path: project.toml
       Builder pack projecttoml path:
=====> vidly buildpacks information
       Buildpacks computed stack:     gliderlabs/herokuish:latest-20
       Buildpacks global stack:
       Buildpacks list:
       Buildpacks stack:
=====> vidly ssl information
       Ssl dir:                       /home/dokku/vidly/tls
       Ssl enabled:                   false
       Ssl hostnames:
       Ssl expires at:
       Ssl issuer:
       Ssl starts at:
       Ssl subject:
       Ssl verified:
=====> vidly checks information
       Checks disabled list:          none
       Checks skipped list:           none
=====> vidly cron information
       Cron task count:               0
=====> vidly docker options information
       Docker options build:
       Docker options deploy:         --restart=on-failure:10
       Docker options run:
=====> vidly domains information
       Domains app enabled:           true
       Domains app vhosts:            vidly.dokku.area51bit.com
       Domains global enabled:        true
       Domains global vhosts:         dokku.area51bit.com
=====> vidly git information
       Git deploy branch:             master
       Git global deploy branch:      master
       Git keep git dir:              false
       Git rev env var:               GIT_REV
       Git sha:                       973f9ae
       Git last updated at:           1637078302
=====> vidly logs information
       Logs computed max size:        10m
       Logs global max size:          10m
       Logs global vector sink:
       Logs max size:
       Logs vector sink:
=====> vidly network information
       Network attach post create:
       Network attach post deploy:
       Network bind all interfaces:          false
       Network computed attach post create:
       Network computed attach post deploy:
       Network computed bind all interfaces: false
       Network computed initial network:
       Network computed tld:
       Network global attach post create:
       Network global attach post deploy:
       Network global bind all interfaces:   false
       Network global initial network:
       Network global tld:
       Network initial network:
       Network static web listener:
       Network tld:
       Network web listeners:                172.17.0.3:5000
=====> vidly nginx information
       Nginx access log format:
       Nginx access log path:         /var/log/nginx/vidly-access.log
       Nginx bind address ipv4:
       Nginx bind address ipv6:       ::
       Nginx client max body size:
       Nginx disable custom config:   false
       Nginx error log path:          /var/log/nginx/vidly-error.log
       Nginx global hsts:             true
       Nginx computed hsts:           true
       Nginx hsts:
       Nginx hsts include subdomains: true
       Nginx hsts max age:            15724800
       Nginx hsts preload:            false
       Nginx proxy buffer size:       4096
       Nginx proxy buffering:         on
       Nginx proxy buffers:           8 4096
       Nginx proxy busy buffers size: 8192
       Nginx proxy read timeout:      60s
       Nginx last visited at:         1637078312
       Nginx x forwarded for value:   $remote_addr
       Nginx x forwarded port value:  $server_port
       Nginx x forwarded proto value: $scheme
       Nginx x forwarded ssl:
=====> vidly proxy information
       Proxy enabled:                 true
       Proxy port map:                http:80:5000
       Proxy type:                    nginx
=====> vidly ps information
       Deployed:                      true
       Processes:                     1
       Ps can scale:                  true
       Ps computed procfile path:     Procfile
       Ps global procfile path:       Procfile
       Ps procfile path:
       Ps restart policy:             on-failure:10
       Restore:                       true
       Running:                       true
       Status web 1:                  running (CID: 84df7027490)
=====> vidly registry information
       Registry computed image repo:      dokku/vidly
       Registry computed push on release: false
       Registry computed server:
       Registry global push on release:
       Registry global server:
       Registry image repo:
       Registry push on release:
       Registry server:
       Registry tag version:
=====> vidly resource information
=====> vidly scheduler information
       Scheduler computed selected:   docker-local
       Scheduler global selected:     docker-local
       Scheduler selected:
=====> vidly scheduler-docker-local information
       Scheduler docker local disable chown:
       Scheduler docker local parallel schedule count:
=====> vidly storage information
       Storage build mounts:
       Storage deploy mounts:
       Storage run mounts:

How (deb/make/rpm) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:

Self-Hosted: Virtual Machine on Proxmox

Additional information

josegonzalez commented 2 years ago

Can you get the logs of that container? Seems like the status is running, so I wonder if the container initialized incorrectly...

kamzata commented 2 years ago

Can you get the logs of that container? Seems like the status is running, so I wonder if the container initialized incorrectly...

How can I get it?

josegonzalez commented 2 years ago

The output of dokku mongo:info vidlydb should have the container ID there :)

kamzata commented 2 years ago

The output of dokku mongo:info vidlydb should have the container ID there :)

dokku@dokku:~$ dokku mongo:info vidlydb
=====> vidlydb mongo service information
       Config dir:          /var/lib/dokku/services/mongo/vidlydb/config
       Config options:       --storageEngine wiredTiger --auth
       Data dir:            /var/lib/dokku/services/mongo/vidlydb/data
       Dsn:                 mongodb://vidlydb:14a301e949ea563ce655c406a4434ec6@dokku-mongo-vidlydb:27017/vidlydb
       Exposed ports:       -
       Id:                  110ad2faceaf88956167f0ad13a887888ae201076f67c9ca29b515ccf030d87e
       Internal ip:
       Links:               vidly
       Service root:        /var/lib/dokku/services/mongo/vidlydb
       Status:              restarting
       Version:             mongo:5.0.3
dokku@dokku:~$ docker logs 110ad2faceaf88956167f0ad13a887888ae201076f67c9ca29b515ccf030d87e

WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
  see https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2
  see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814

Edit: I changed the VM CPU from kvm64 to host and now it works. Thanks!