Skip to content

Error preparing context folder under Windows #890

Closed
@lreimer

Description

@lreimer

This issue relates to the following bmuschko/gradle-docker-plugin#432

The Docker Gradle plugin is using the docker-java library in version 3.0.12. When using the plugin in a Gradle build under Windows the following exception occurs (only snippet):

        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
        ... 70 more
Caused by: java.io.IOException: Der Prozess kann nicht auf die Datei zugreifen, da ein anderer Prozess einen Teil der Datei gesperrt hat
        at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2146)
        at org.apache.commons.io.IOUtils.copy(IOUtils.java:2102)
        at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2123)
        at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1107)
        at com.github.dockerjava.core.util.CompressArchiveUtil.archiveTARFiles(CompressArchiveUtil.java:105)
        at com.github.dockerjava.core.dockerfile.Dockerfile$ScannedResult.buildDockerFolderTar(Dockerfile.java:135)
        ... 92 more
        Suppressed: java.io.IOException: This archives contains unclosed entries.
                at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.finish(TarArchiveOutputStream.java:225)
                at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.close(TarArchiveOutputStream.java:241)
                at com.github.dockerjava.core.util.CompressArchiveUtil.archiveTARFiles(CompressArchiveUtil.java:109)
                at com.github.dockerjava.core.dockerfile.Dockerfile$ScannedResult.buildDockerFolderTar(Dockerfile.java:135)

The IOException tells me that someone has locked a file the library wants to use and include in the context TAR file. But this bug only happens under Windows, when I run the exact same build on my Mac everything is OK.

Any ideas how to analyse / fix this? If you need a project to reproduce the behaviour, you can use https://github.com/lreimer/everything-as-code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions