dokku / dokku-event-listener

Service that listens to docker events and runs dokku commands
BSD 3-Clause "New" or "Revised" License
11 stars 11 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #20

Closed bjab closed 3 years ago

bjab commented 4 years ago

Description of problem

dokku-event-listener.service throws panic: runtime error: invalid memory address or nil pointer dereference errors in logs

Logs are like that:

Oct 30 13:42:51 systemd[1]: Stopped dokku-event-listener process.
Oct 30 13:42:51 systemd[1]: Started dokku-event-listener process.
Oct 30 13:42:51 dokku-event-listener.service[31447]: {"level":"info","container_id":"a40834cbe","app":"ttrss","ip_address":"172.17.0.12","time":1604061771,"message":"register_container"}
Oct 30 13:42:51 dokku-event-listener.service[31447]: {"level":"info","container_id":"ebd57a439","app":"ttrss","ip_address":"172.17.0.9","time":1604061771,"message":"register_container"}
Oct 30 13:42:51 dokku-event-listener.service[31447]: {"level":"info","container_id":"b4bd6bc25","app":"influxdb","ip_address":"172.17.0.4","time":1604061771,"message":"register_container"}
Oct 30 13:42:51 dokku-event-listener.service[31447]: {"level":"info","container_id":"beab674fc","app":"hivemq","ip_address":"172.17.0.2","time":1604061771,"message":"register_container"}
Oct 30 13:42:51 dokku-event-listener.service[31447]: {"level":"info","container_id":"3c8f4c783","app":"calibre","ip_address":"172.17.0.3","time":1604061771,"message":"register_container"}
Oct 30 13:42:51 dokku-event-listener.service[31447]: panic: runtime error: invalid memory address or nil pointer dereference
Oct 30 13:42:51 dokku-event-listener.service[31447]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x68 pc=0x825b96]
Oct 30 13:42:51 dokku-event-listener.service[31447]: goroutine 1 [running]:
Oct 30 13:42:51 dokku-event-listener.service[31447]: main.registerContainers(0x9bf540, 0xc000022018, 0xcf8f60, 0xc0000f7d80)
Oct 30 13:42:51 dokku-event-listener.service[31447]:         github.com/dokku/dokku-event-listener/main.go:100 +0x466
Oct 30 13:42:51 dokku-event-listener.service[31447]: main.main()
Oct 30 13:42:51 dokku-event-listener.service[31447]:         github.com/dokku/dokku-event-listener/main.go:227 +0x114
Oct 30 13:42:51 systemd[1]: dokku-event-listener.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Oct 30 13:42:51 systemd[1]: dokku-event-listener.service: Failed with result 'exit-code'.

All my running containers:

# docker ps
CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS              PORTS                              NAMES
a40834cbeadf        dokku/ttrss:latest      "/start clock"           44 hours ago        Up 44 hours                                            ttrss.clock.1
ebd57a439d55        dokku/ttrss:latest      "/start web"             44 hours ago        Up 44 hours                                            ttrss.web.1
5659166597eb        postgres:11.6           "docker-entrypoint.s…"   2 days ago          Up 2 days           5432/tcp                           dokku.postgres.ttrss-pgsql
b4bd6bc25a85        dokku/influxdb:latest   "/entrypoint.sh infl…"   2 days ago          Up 2 days           8086/tcp                           influxdb.web.1
beab674fce1b        dokku/hivemq:latest     "/opt/docker-entrypo…"   6 weeks ago         Up 2 days           0.0.0.0:1883->1883/tcp, 8000/tcp   hivemq.web.1
3c8f4c7833c7        dokku/calibre:latest    "/init"                  6 weeks ago         Up 2 days           8083/tcp                           calibre.web.1
09ade9061436        dokku/hab:latest        "/entrypoint.sh gosu…"   6 weeks ago         Up 2 days                                              hab.web.1

I suppose that it crashes on last container. It's set up with --net=host option, instead of docker bridge.

Environment Information

dokku report hab output

# dokku report hab
-----> uname: Linux hassan 4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64 GNU/Linux
-----> memory:
                     total        used        free      shared  buff/cache   available
       Mem:           7897        5320        1633          96         943        3166
       Swap:          3813         634        3179
-----> docker version:
       Client: Docker Engine - Community
        Version:           19.03.13
        API version:       1.40
        Go version:        go1.13.15
        Git commit:        4484c46d9d
        Built:             Wed Sep 16 17:02:55 2020
        OS/Arch:           linux/amd64
        Experimental:      false

       Server: Docker Engine - Community
        Engine:
         Version:          19.03.13
         API version:      1.40 (minimum version 1.12)
         Go version:       go1.13.15
         Git commit:       4484c46d9d
         Built:            Wed Sep 16 17:01:25 2020
         OS/Arch:          linux/amd64
         Experimental:     false
        containerd:
         Version:          1.3.7
         GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
        runc:
         Version:          1.0.0-rc10
         GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
        docker-init:
         Version:          0.18.0
         GitCommit:        fec3683
-----> docker daemon info:
       Client:
        Debug Mode: true

       Server:
        Containers: 24
         Running: 7
         Paused: 0
         Stopped: 17
        Images: 104
        Server Version: 19.03.13
        Storage Driver: overlay2
         Backing Filesystem: extfs
         Supports d_type: true
         Native Overlay Diff: true
        Logging Driver: json-file
        Cgroup Driver: cgroupfs
        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: runc
        Default Runtime: runc
WARNING: No swap limit support
        Init Binary: docker-init
        containerd version: 8fba4e9a7d01810a393d5d25a3621dc101981175
        runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
        init version: fec3683
        Security Options:
         apparmor
         seccomp
          Profile: default
        Kernel Version: 4.19.0-10-amd64
        Operating System: Debian GNU/Linux 10 (buster)
        OSType: linux
        Architecture: x86_64
        CPUs: 8
        Total Memory: 7.712GiB
        Name: hassan
        ID: TU5C:5RF5:UROC:Y7BQ:Z7CC:C2D4:2WMM:GJAK:UGEG:MOA7:RHIR:SSQ4
        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

-----> sigil version: 0.6.0
-----> herokuish version:
       herokuish: 0.5.18
       buildpacks:
         heroku-buildpack-multi     v1.0.0
         heroku-buildpack-ruby      v218
         heroku-buildpack-nodejs    v175
         heroku-buildpack-clojure   v85
         heroku-buildpack-python    v177
         heroku-buildpack-java      v66
         heroku-buildpack-gradle    v31
         heroku-buildpack-scala     v87
         heroku-buildpack-play      v26
         heroku-buildpack-php       v179
         heroku-buildpack-go        v145
         buildpack-nginx            v14
-----> dokku version: dokku version 0.21.4
-----> dokku plugins:
       plugn: 0.5.0
         00_dokku-standard    0.21.4 enabled    dokku core standard plugin
         20_events            0.21.4 enabled    dokku core events logging plugin
         app-json             0.21.4 enabled    dokku core app-json plugin
         apps                 0.21.4 enabled    dokku core apps plugin
         builder-dockerfile   0.21.4 enabled    dokku core builder-dockerfile plugin
         builder-herokuish    0.21.4 enabled    dokku core builder-herokuish plugin
         buildpacks           0.21.4 enabled    dokku core buildpacks plugin
         certs                0.21.4 enabled    dokku core certificate management plugin
         checks               0.21.4 enabled    dokku core checks plugin
         common               0.21.4 enabled    dokku core common plugin
         config               0.21.4 enabled    dokku core config plugin
         docker-options       0.21.4 enabled    dokku core docker-options plugin
         domains              0.21.4 enabled    dokku core domains plugin
         enter                0.21.4 enabled    dokku core enter plugin
         git                  0.21.4 enabled    dokku core git plugin
         letsencrypt          0.9.4 enabled    Automated installation of let's encrypt TLS certificates
         logs                 0.21.4 enabled    dokku core logs plugin
         network              0.21.4 enabled    dokku core network plugin
         nginx-vhosts         0.21.4 enabled    dokku core nginx-vhosts plugin
         plugin               0.21.4 enabled    dokku core plugin plugin
         postgres             1.11.5 enabled    dokku postgres service plugin
         proxy                0.21.4 enabled    dokku core proxy plugin
         ps                   0.21.4 enabled    dokku core ps plugin
         repo                 0.21.4 enabled    dokku core repo plugin
         resource             0.21.4 enabled    dokku core resource plugin
         scheduler-docker-local 0.21.4 enabled    dokku core scheduler-docker-local plugin
         shell                0.21.4 enabled    dokku core shell plugin
         ssh-keys             0.21.4 enabled    dokku core ssh-keys plugin
         storage              0.21.4 enabled    dokku core storage plugin
         tags                 0.21.4 enabled    dokku core tags plugin
         tar                  0.21.4 enabled    dokku core tar plugin
         trace                0.21.4 enabled    dokku core trace plugin
=====> hab app information
       App deploy source:
       App dir:                       /home/dokku/hab
       App locked:                    false
=====> hab buildpacks information
       Buildpacks list:
=====> hab checks information
       Checks disabled list:          none
       Checks skipped list:           none
=====> hab docker options information
       Docker options build:
       Docker options deploy:         --net=host --restart=on-failure:10 -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro -v /srv/storage/openhab/addons:/openhab/addons -v /srv/storage/openhab/conf:/openhab/conf -v /srv/storage/openhab/userdata:/openhab/userdata
       Docker options run:            --net=host -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro -v /srv/storage/openhab/addons:/openhab/addons -v /srv/storage/openhab/conf:/openhab/conf -v /srv/storage/openhab/userdata:/openhab/userdata

=====> hab git information
       Git deploy branch:             master
       Git global deploy branch:      master
       Git keep git dir:              false
       Git rev env var:               GIT_REV
       Git sha:                       8a3db5a
       Git last updated at:
=====> hab network information
       Network attach post create:
       Network attach post deploy:
       Network bind all interfaces:   false
       Network web listeners:         127.0.0.1:48080
=====> hab nginx information
       Nginx access log path:         /var/log/nginx/hab-access.log
       Nginx bind address ipv4:
       Nginx bind address ipv6:       ::
       Nginx error log path:          /var/log/nginx/hab-error.log
       Nginx hsts:                    true
       Nginx hsts include subdomains: true
       Nginx hsts max age:            15724800
       Nginx hsts preload:            false
       Nginx proxy read timeout:      60s
       Nginx last visited at:         1603926001
=====> hab proxy information
       Proxy enabled:                 true
       Proxy port map:                http:5007:5007 http:80:48080 http:8101:8101 http:8443:844 https:443:48080
       Proxy type:                    nginx
=====> hab ps information
       Processes:                     1
       Deployed:                      true
       Running:                       true
       Restore:                       true
       Restart policy:                on-failure:10
       Ps can scale:                  true
       Status web.1:                  running    (CID: 09ade9061436)
=====> hab scheduler-docker-local information
       Scheduler docker local disable chown:
=====> hab storage information
       Storage build mounts:
       Storage deploy mounts:         -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro -v /srv/storage/openhab/addons:/openhab/addons -v /srv/storage/openhab/conf:/openhab/conf -v /srv/storage/openhab/userdata:/openhab/userdata
       Storage run mounts:            -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro -v /srv/storage/openhab/addons:/openhab/addons -v /srv/storage/openhab/conf:/openhab/conf -v /srv/storage/openhab/userdata:/openhab/userdata

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

deb:

Package: dokku
Version: 0.21.4
AyashiNoCeres commented 3 years ago

is this actually fixed or not? I'm getting the same error and I'm not sure how to get rid of it...