{"id":387,"date":"2020-08-21T09:51:35","date_gmt":"2020-08-21T08:51:35","guid":{"rendered":"https:\/\/blog.thomarite.uk\/?p=387"},"modified":"2020-08-21T09:51:35","modified_gmt":"2020-08-21T08:51:35","slug":"journalctl-fu","status":"publish","type":"post","link":"https:\/\/blog.thomarite.uk\/index.php\/2020\/08\/21\/journalctl-fu\/","title":{"rendered":"journalctl -fu"},"content":{"rendered":"\n<p>I rebooted my laptop today and realised that docker wasnt running&#8230; It was running before the reboot and I didn&#8217;t upgrade anything related to docker (or I thought)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ docker ps -a\nCannot connect to the Docker daemon at unix:\/\/\/var\/run\/docker.sock. Is the docker daemon running?\n$<\/pre>\n\n\n\n<p>Let&#8217;s check status and start if needed:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@athens:\/var\/log# service docker status\n\u25cf docker.service - Docker Application Container Engine\nLoaded: loaded (\/lib\/systemd\/system\/docker.service; enabled; vendor preset: enabled)\nActive: failed (Result: exit-code) since Fri 2020-08-21 08:34:03 BST; 7min ago\nTriggeredBy: \u25cf docker.socket\nDocs: https:\/\/docs.docker.com\nMain PID: 12015 (code=exited, status=1\/FAILURE)\nAug 21 08:34:03 athens systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.\nAug 21 08:34:03 athens systemd[1]: Stopped Docker Application Container Engine.\nAug 21 08:34:03 athens systemd[1]: docker.service: Start request repeated too quickly.\nAug 21 08:34:03 athens systemd[1]: docker.service: Failed with result 'exit-code'.\nAug 21 08:34:03 athens systemd[1]: Failed to start Docker Application Container Engine.\nAug 21 08:34:42 athens systemd[1]: docker.service: Start request repeated too quickly.\nAug 21 08:34:42 athens systemd[1]: docker.service: Failed with result 'exit-code'.\nAug 21 08:34:42 athens systemd[1]: Failed to start Docker Application Container Engine.\nroot@athens:\/var\/log#\nroot@athens:\/var\/log#\nroot@athens:\/var\/log# service docker start\nJob for docker.service failed because the control process exited with error code.\nSee \"systemctl status docker.service\" and \"journalctl -xe\" for details.\nroot@athens:\/var\/log# systemctl status docker.service\n\u25cf docker.service - Docker Application Container Engine\nLoaded: loaded (\/lib\/systemd\/system\/docker.service; enabled; vendor preset: enabled)\nActive: failed (Result: exit-code) since Fri 2020-08-21 08:41:20 BST; 5s ago\nTriggeredBy: \u25cf docker.socket\nDocs: https:\/\/docs.docker.com\nProcess: 35305 ExecStart=\/usr\/sbin\/dockerd -H fd:\/\/ $DOCKER_OPTS (code=exited, status=1\/FAILURE)\nMain PID: 35305 (code=exited, status=1\/FAILURE)\nAug 21 08:41:19 athens systemd[1]: docker.service: Main process exited, code=exited, status=1\/FAILURE\nAug 21 08:41:19 athens systemd[1]: docker.service: Failed with result 'exit-code'.\nAug 21 08:41:19 athens systemd[1]: Failed to start Docker Application Container Engine.\nAug 21 08:41:20 athens systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.\nAug 21 08:41:20 athens systemd[1]: Stopped Docker Application Container Engine.\nAug 21 08:41:20 athens systemd[1]: docker.service: Start request repeated too quickly.\nAug 21 08:41:20 athens systemd[1]: docker.service: Failed with result 'exit-code'.\nAug 21 08:41:20 athens systemd[1]: Failed to start Docker Application Container Engine.\nroot@athens:\/var\/log#<\/pre>\n\n\n\n<p>Ok, so not much info&#8230; let check the recommend details:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@athens:\/var\/log# journalctl -xe\n\u2591\u2591 Support: https:\/\/www.debian.org\/support\n\u2591\u2591\n\u2591\u2591 A start job for unit docker.socket has begun execution.\n\u2591\u2591\n\u2591\u2591 The job identifier is 4236.\nAug 21 08:41:20 athens systemd[1]: Listening on Docker Socket for the API.\n\u2591\u2591 Subject: A start job for unit docker.socket has finished successfully\n\u2591\u2591 Defined-By: systemd\n\u2591\u2591 Support: https:\/\/www.debian.org\/support\n\u2591\u2591\n\u2591\u2591 A start job for unit docker.socket has finished successfully.\n\u2591\u2591\n\u2591\u2591 The job identifier is 4236.\nAug 21 08:41:20 athens systemd[1]: docker.service: Start request repeated too quickly.\nAug 21 08:41:20 athens systemd[1]: docker.service: Failed with result 'exit-code'.\n\u2591\u2591 Subject: Unit failed\n\u2591\u2591 Defined-By: systemd\n\u2591\u2591 Support: https:\/\/www.debian.org\/support\n\u2591\u2591\n\u2591\u2591 The unit docker.service has entered the 'failed' state with result 'exit-code'.\nAug 21 08:41:20 athens systemd[1]: Failed to start Docker Application Container Engine.\n\u2591\u2591 Subject: A start job for unit docker.service has failed\n\u2591\u2591 Defined-By: systemd\n\u2591\u2591 Support: https:\/\/www.debian.org\/support\n\u2591\u2591\n\u2591\u2591 A start job for unit docker.service has finished with a failure.\n\u2591\u2591\n\u2591\u2591 The job identifier is 4113 and the job result is failed.\nAug 21 08:41:20 athens systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'.\n\u2591\u2591 Subject: Unit failed\n\u2591\u2591 Defined-By: systemd\n\u2591\u2591 Support: https:\/\/www.debian.org\/support\n\u2591\u2591\n\u2591\u2591 The unit docker.socket has entered the 'failed' state with result 'service-start-limit-hit'.\nroot@athens:\/var\/log# systemctl status docker.service log\nUnit log.service could not be found.\n\u25cf docker.service - Docker Application Container Engine\nLoaded: loaded (\/lib\/systemd\/system\/docker.service; enabled; vendor preset: enabled)\nActive: failed (Result: exit-code) since Fri 2020-08-21 08:41:20 BST; 1min 2s ago\nTriggeredBy: \u25cf docker.socket\nDocs: https:\/\/docs.docker.com\nProcess: 35305 ExecStart=\/usr\/sbin\/dockerd -H fd:\/\/ $DOCKER_OPTS (code=exited, status=1\/FAILURE)\nMain PID: 35305 (code=exited, status=1\/FAILURE)\nAug 21 08:41:19 athens systemd[1]: docker.service: Main process exited, code=exited, status=1\/FAILURE\nAug 21 08:41:19 athens systemd[1]: docker.service: Failed with result 'exit-code'.\nAug 21 08:41:19 athens systemd[1]: Failed to start Docker Application Container Engine.\nAug 21 08:41:20 athens systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.\nAug 21 08:41:20 athens systemd[1]: Stopped Docker Application Container Engine.\nAug 21 08:41:20 athens systemd[1]: docker.service: Start request repeated too quickly.\nAug 21 08:41:20 athens systemd[1]: docker.service: Failed with result 'exit-code'.\nAug 21 08:41:20 athens systemd[1]: Failed to start Docker Application Container Engine.\nroot@athens:\/var\/log#<\/pre>\n\n\n\n<p>So &#8220;journalctl -xe&#8221; and &#8220;systemctl status docker.service log&#8221; gave nothing useful&#8230;.<\/p>\n\n\n\n<p>So I searched for &#8220;docker.socket: Failed with result &#8216;service-start-limit-hit'&#8221; as it was the message that looked more suspicious. I landed <a href=\"https:\/\/github.com\/moby\/moby\/issues\/33931\">here<\/a> and tried one command to get  more logs that I didnt know: &#8220;journaltctl -fu docker&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@athens:\/var\/log# journalctl -fu docker\n-- Logs begin at Sun 2020-02-02 21:12:23 GMT. --\nAug 21 08:42:41 athens dockerd[35469]: proto: duplicate proto type registered: io.containerd.cgroups.v1.RdmaStat\nAug 21 08:42:41 athens dockerd[35469]: proto: duplicate proto type registered: io.containerd.cgroups.v1.RdmaEntry\nAug 21 08:42:41 athens systemd[1]: docker.service: Main process exited, code=exited, status=1\/FAILURE\nAug 21 08:42:41 athens systemd[1]: docker.service: Failed with result 'exit-code'.\nAug 21 08:42:41 athens systemd[1]: Failed to start Docker Application Container Engine.\nAug 21 08:42:41 athens systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.\nAug 21 08:42:41 athens systemd[1]: Stopped Docker Application Container Engine.\nAug 21 08:42:41 athens systemd[1]: docker.service: Start request repeated too quickly.\nAug 21 08:42:41 athens systemd[1]: docker.service: Failed with result 'exit-code'.\nAug 21 08:42:41 athens systemd[1]: Failed to start Docker Application Container Engine.\nAug 21 08:44:32 athens systemd[1]: Starting Docker Application Container Engine\u2026\nAug 21 08:44:32 athens dockerd[35538]: proto: duplicate proto type registered: io.containerd.cgroups.v1.Metrics\nAug 21 08:44:32 athens dockerd[35538]: proto: duplicate proto type registered: io.containerd.cgroups.v1.HugetlbStat\n<strong>Aug 21 08:44:32 athens dockerd[35538]: unable to configure the Docker daemon with file \/etc\/docker\/daemon.json: invalid character '\"' after object key:value pair\n<\/strong>Aug 21 08:44:32 athens dockerd[35538]: proto: duplicate proto type registered: io.containerd.cgroups.v1.PidsStat\nAug 21 08:44:32 athens dockerd[35538]: proto: duplicate proto type registered: io.containerd.cgroups.v1.CPUStat\nAug 21 08:44:32 athens dockerd[35538]: proto: duplicate proto type registered: io.containerd.cgroups.v1.CPUUsage\nAug 21 08:44:32 athens dockerd[35538]: proto: duplicate proto type registered: io.containerd.cgroups.v1.Throttle\nAug 21 08:44:32 athens dockerd[35538]: proto: duplicate proto type registered: io.containerd.cgroups.v1.MemoryStat\nAug 21 08:44:32 athens dockerd[35538]: proto: duplicate proto type registered: io.containerd.cgroups.v1.MemoryEntry\nAug 21 08:44:32 athens dockerd[35538]: proto: duplicate proto type registered: io.containerd.cgroups.v1.BlkIOStat\nAug 21 08:44:32 athens dockerd[35538]: proto: duplicate proto type registered: io.containerd.cgroups.v1.BlkIOEntry\nAug 21 08:44:32 athens dockerd[35538]: proto: duplicate proto type registered: io.containerd.cgroups.v1.RdmaStat\nAug 21 08:44:32 athens dockerd[35538]: proto: duplicate proto type registered: io.containerd.cgroups.v1.RdmaEntry\nAug 21 08:44:32 athens systemd[1]: docker.service: Main process exited, code=exited, status=1\/FAILURE\nAug 21 08:44:32 athens systemd[1]: docker.service: Failed with result 'exit-code'.\nAug 21 08:44:32 athens systemd[1]: Failed to start Docker Application Container Engine.\nAug 21 08:44:32 athens systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.\nAug 21 08:44:32 athens systemd[1]: Stopped Docker Application Container Engine.<\/pre>\n\n\n\n<p>And now, yes, I could see the docker logs properly&#8230; and found the culprit and fixed. I am pretty sure the last time I played with &#8220;\/etc\/docker\/daemon.json&#8221; I restarted docker and it was fine&#8230;<\/p>\n\n\n\n<p>Anyway, I learned a new command &#8220;journaltctl -fu SERVICE&#8221; to troubleshoot services.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I rebooted my laptop today and realised that docker wasnt running&#8230; It was running before the reboot and I didn&#8217;t upgrade anything related to docker (or I thought) $ docker ps -a Cannot connect to the Docker daemon at unix:\/\/\/var\/run\/docker.sock. Is the docker daemon running? $ Let&#8217;s check status and start if needed: root@athens:\/var\/log# service &hellip; <a href=\"https:\/\/blog.thomarite.uk\/index.php\/2020\/08\/21\/journalctl-fu\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;journalctl -fu&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-387","post","type-post","status-publish","format-standard","hentry","category-unix"],"_links":{"self":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/comments?post=387"}],"version-history":[{"count":1,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/387\/revisions"}],"predecessor-version":[{"id":388,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/387\/revisions\/388"}],"wp:attachment":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/media?parent=387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/categories?post=387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/tags?post=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}