18

I upgraded my Docker version to the latest one and I got this error:

error from daemon in stream: Error grabbing logs: invalid character '\x00' looking for beginning of value

I can’t read logs using:

docker-compose logs -f myservice

nor with:

docker logs -f 6f454c73ff9c

Output of Docker version:

Client:
 Version:      17.09.0-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:42:18 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.09.0-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:40:56 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of Docker info:

Containers: 11
 Running: 11
 Paused: 0
 Stopped: 0
Images: 8
Server Version: 17.09.0-ce
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 76
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 3f2f8b84a77f73d38244dd690525642a72156c64
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-97-generic
Operating System: Ubuntu 16.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.695GiB
Name: egmintel-desktop
ID: VB22:IXWI:GY6D:QPM4:SPHX:HYUP:OQN7:ZM55:LLKE:P3UU:XK7F:26TH
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support
My docker-compose version:
docker-compose version 1.16.1, build 6d1ac21

I also noticed that one of my containers is not working properly (but I can't see the error since I can't read logs) and I need to restart the Docker service so my container starts working again.

Any ideas how to solve this? Thanks!

freginold
  • 3,946
  • 3
  • 13
  • 28
sabrina2020
  • 2,102
  • 3
  • 25
  • 54

5 Answers5

22

simply remove the ~/.docker/ directory

  • 3
    Splendid, I had this problem on Windows and not even a full Docker reinstall helped, but this did (the folder is apparently kept even after factory reset and reinstall). My problem was with the `docker context ls` command, which broke the VSCode extension. – Jan Pokorný Sep 30 '21 at 13:11
  • @JanPokorný Had the same situation as you. Thanks for the explanation, which will most likely help future readers! – Akito Mar 07 '22 at 18:14
4

Looks like your events.log file got corrupted. Try deleting following file

  1. "/var/run/docker/libcontainerd/containerd/events.log"

  2. restart the docker through init.d

4

a workaroud may be clear the broken log file.
// the log still can be read (by cat or vim), just docker can't handle it

cmds

  • get log path
docker inspect --format='{{.LogPath}}' YOUR_CONTAINER
  • clear log
    before clear, backup it as you need
:> THE_LOG_PATH

https://stackoverflow.com/a/42510314/4896468

yurenchen
  • 1,897
  • 19
  • 17
0

For windows you need delete json file with 0x00 bytes located in %USERPROFILE%\.docker\contexts folder and it's subdirs.

mit
  • 1,763
  • 4
  • 16
  • 27
0

Using windows Docker Desktop

Troubleshoot -> Reset to factory defaults

This fixed the issue for me.