Ask questionsfailed to export image: failed to create image: failed to get layer: layer does not exist

<!-- If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.

If you suspect your issue is a bug, please edit your issue description to include the BUG REPORT INFORMATION shown below. If you fail to provide this information within 7 days, we cannot debug your issue and will close it. We will, however, reopen it if you later provide the information.

For more information about reporting issues, see


The GitHub issue tracker is for bug reports and feature requests. General support for docker can be found at the following locations:

  • Docker Support Forums -
  • Slack - #general channel
  • Post a question on StackOverflow, using the Docker tag

General support for moby can be found at the following locations:

  • Moby Project Forums -
  • Slack - #moby-project channel
  • Post a question on StackOverflow, using the Moby tag


Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST -->


  • Docker CE 18.02
  • Linux 4.15.7-1-ARCH #1 SMP PREEMPT Wed Feb 28 19:01:57 UTC 2018 x86_64 GNU/Linux
  • BTRFS as filesystem
  • Docker uses subvolumes

Sometimes when building my images i have this error.

As docker uses subvolumes, i know that sometimes BTRFS just wreck everything and files/subvolumes aren't visible from "users", including "ls" in a shell or, here, Docker.

The problem appears after many build happened. Also, the cache isn't available for docker to use it. When issuing sudo sync, the docker cache is available and build can continue from where it stopped.

Steps to reproduce the issue:

  1. BTRFS as main filesystem, docker to use subvolumes
  2. Multistage Build build build build build build build build build… many times until it happens. Having big layers helps.
  3. When the error show up, try to resume the build: cache isn't used.
  4. Issue sync as root, wait for the command to finish
  5. Restart the build: cache is available and build resumes

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

❭ docker version
 Version:       18.02.0-ce
 API version:   1.36
 Go version:    go1.9.4
 Git commit:    fc4de447b5
 Built: Tue Feb 13 15:28:01 2018
 OS/Arch:       linux/amd64
 Experimental:  false
 Orchestrator:  swarm

  Version:      18.02.0-ce
  API version:  1.36 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   fc4de447b5
  Built:        Tue Feb 13 15:28:34 2018
  OS/Arch:      linux/amd64
  Experimental: false

Output of docker info:

Containers: 673
 Running: 1
 Paused: 0
 Stopped: 672
Images: 1805
Server Version: 18.02.0-ce
Storage Driver: btrfs
 Build Version: Btrfs v4.15
 Library Version: 102
Logging Driver: json-file
Cgroup Driver: cgroupfs
 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: 9b55aab90508bd389d7654c4baf173a981477d55
runc version: 9f9c96235cc97674e935002fc3d78361b696a69e
init version: 949e6fa
Security Options:
  Profile: default
Kernel Version: 4.15.7-1-ARCH
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.643GiB
Name: padme
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: leryan
Experimental: false
Insecure Registries:
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):

Physical with SSD.


Answer questions fractos

Removing report - this is for BTRFS. Sorry.


Related questions

Swarm restarts all containers hot 2
integration: "error reading the kernel parameter" errors during CI hot 2
can not successfully install docker-ce on ubuntu 16.04 ? why ,Can you help me? hot 1
OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown hot 1
Allow COPY command's --chown to be dynamically populated via ENV or ARG hot 1
windowsRS1 and windowsRS5-process are failing due to "Unable to delete '\gopath\src\\docker\docker" hot 1
Panic: runtime error: invalid memory address or nil pointer dereference hot 1
Error response from daemon: rpc error: code = DeadlineExceeded desc = context deadline exceeded hot 1
one container in the overlay network not available hot 1
Containers on overlay network cannot reach other containers hot 1
&#34;initgroups, operation not permitted&#34; error in apache2-mpm-itk when inside Docker - moby hot 1
[Windows] windowsfilter folder impossible to delete hot 1
swarm node lost leader status hot 1
New-SmbGlobalMapping don't continued working in Container hot 1
"docker stack deploy">"rpc error: code = 3 desc = name must be valid as a DNS name component" hot 1
Github User Rank List