'Docker: Error grabbing logs: invalid character '\x00' looking for beginning of value

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!



Solution 1:[1]

simply remove the ~/.docker/ directory

Solution 2:[2]

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

Solution 3:[3]

delete %USERPROFILE%.docker\contexts folder.

Solution 4:[4]

Using windows Docker Desktop

Troubleshoot -> Reset to factory defaults

This fixed the issue for me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 soufiane ELAMMARI
Solution 2 Nitin Dwivedi
Solution 3 mit
Solution 4 RussColwell