Docker sometimes fails on Debian 9

Docker sometimes fails to start up on my Google Compute Engine Debian 9 VM.
Docker version 17.05.0-ce, build 89658be
Linux main 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux

Sometimes when I start the VM Docker is fine. Sometimes not. In that case the easy way to tell is to use docker images and if none are listed then nothing will work properly. For example

$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
ca4f61b1923c: Pull complete 
Digest: 
sha256:97ce6fa4b6cdc0790cda65fe7290b74cfebd9fa0c9b8c38e979330d547d22ce1
Status: Downloaded newer image for hello-world:latest
docker: Error response from daemon: failed to update store for object type 
*libnetwork.endpointCnt: Key not found in store.
ERRO[0001] error getting events from daemon: net/http: request canceled 

In that case the pull actually did work. But pulling my own images doesn’t, and gives odd messages. I haven’t had any luck Googling for that message. Others seem to have similar problems, though.

When startup fails the status looks like this:

# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-03-30 20:21:52 EDT; 21s ago
     Docs: https://docs.docker.com
  Process: 1596 ExecStart=/usr/bin/dockerd -g /mnt/main/docker -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 1596 (code=exited, status=1/FAILURE)
      CPU: 73ms

Mar 30 20:21:52 main systemd[1]: docker.service: Unit entered failed state.
Mar 30 20:21:52 main systemd[1]: docker.service: Failed with result 'exit-code'.
Mar 30 20:21:52 main systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Mar 30 20:21:52 main systemd[1]: Stopped Docker Application Container Engine.
Mar 30 20:21:52 main systemd[1]: docker.service: Start request repeated too quickly.
Mar 30 20:21:52 main systemd[1]: Failed to start Docker Application Container Engine.
Mar 30 20:21:52 main systemd[1]: docker.service: Unit entered failed state.
Mar 30 20:21:52 main systemd[1]: docker.service: Failed with result 'exit-code'.

When it works, the status looks like this:

# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-03-30 20:37:13 EDT; 2min 15s ago
     Docs: https://docs.docker.com
 Main PID: 697 (dockerd)
    Tasks: 70
   Memory: 171.8M
      CPU: 16.295s
   CGroup: /system.slice/docker.service
           ├─ 697 /usr/bin/dockerd -g /mnt/main/docker -H fd://
           ├─ 801 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/contai
           ├─3312 docker-containerd-shim aa0c6d69d36dc47086704721d99c25040a6d14012910fc73e97b6b6dde472d32 /var/run/docker/libcontainerd/aa0c6d69d36dc47086704721d99c25040a6d14012910fc73e97
           ├─3319 docker-containerd-shim fffc9bf93741a4038d97d53322aa577afcb1fdba2b29f45c4c5477d7b78fb363 /var/run/docker/libcontainerd/fffc9bf93741a4038d97d53322aa577afcb1fdba2b29f45c4c5
           ├─3320 docker-containerd-shim c58caf1400089857778c0576769518653ccba129be0f3004dd7713a237c33c2b /var/run/docker/libcontainerd/c58caf1400089857778c0576769518653ccba129be0f3004dd7
           └─3405 docker-containerd-shim 4859e6063a16d40dbb52cbb65cedfe1248486153e3b40d63fbcde43470af277f /var/run/docker/libcontainerd/4859e6063a16d40dbb52cbb65cedfe1248486153e3b40d63fbc

Mar 30 20:37:12 main dockerd[697]: time="2018-03-31T00:37:12.548663248Z" level=error msg="Failed to remove container df84bf9a64fe2622b8c740834d50c1180e9ff53e5540ea392fca077daaa0b72d: No s
Mar 30 20:37:12 main dockerd[697]: time="2018-03-31T00:37:12.548682221Z" level=error msg="Failed to remove container 58fbb67fc950af041d8898213c4d4a55e15b5a014bda27736296ef1294b8f23a: No s
Mar 30 20:37:12 main dockerd[697]: time="2018-03-31T00:37:12.548685074Z" level=error msg="Failed to remove container 7b2a355145cccb42db9d89b47f68b4464ab62e556c7ba91b5a91d206edb9eb2f: No s
Mar 30 20:37:12 main dockerd[697]: time="2018-03-31T00:37:12.548699147Z" level=error msg="Failed to remove container 352ad82eefc1a15abd5718f13aa8033d045c39ad58cf204fdf223286fc18452d: No s
Mar 30 20:37:12 main dockerd[697]: time="2018-03-31T00:37:12.548707811Z" level=error msg="Failed to remove container 8d4076cbeb2e4152d5bfea4b19208d1d46f38ae988e2fb0a678624399539ff33: No s
Mar 30 20:37:12 main dockerd[697]: time="2018-03-31T00:37:12.548817485Z" level=info msg="Loading containers: done."
Mar 30 20:37:13 main dockerd[697]: time="2018-03-31T00:37:13.076499240Z" level=info msg="Daemon has completed initialization"
Mar 30 20:37:13 main dockerd[697]: time="2018-03-31T00:37:13.076571506Z" level=info msg="Docker daemon" commit=89658be graphdriver=overlay2 version=17.05.0-ce
Mar 30 20:37:13 main dockerd[697]: time="2018-03-31T00:37:13.083484162Z" level=info msg="API listen on /var/run/docker.sock"
Mar 30 20:37:13 main systemd[1]: Started Docker Application Container Engine.

Can anyone help me figure out what is going on? Thanks.