question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot finish task jibDockerBuild use 2byte character in container args

See original GitHub issue

Use Gradle plugin. jib.container.args = ['日本語']

$ ./gradlew clean jibDockerBuild

Cannot finish task.

jib-gradle-plugin Configuration:

plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.2.50'
    id "application"
    id 'com.google.cloud.tools.jib' version '0.9.6'
}

group 'com.github.sakebook'
version '0.0.1-SNAPSHOT'
mainClassName = 'com.github.sakebook.word2vec.Word2VecKt'

jar {
    manifest {
        attributes 'Main-Class': 'com.github.sakebook.word2vec.Word2VecKt'
    }
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}

jib {
    to {
        image = 'sakebook/word2vec-deeplearning4j-kotlin'
        auth {
            username = USERNAME // Defined in 'gradle.properties'.
            password = PASSWORD
        }
    }
    container {
        args = ['日本語']
    }
}


repositories {
    mavenCentral()
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
    compile "org.deeplearning4j:deeplearning4j-core:0.9.1"
    compile "org.deeplearning4j:deeplearning4j-nlp:0.9.1"
    compile "org.nd4j:nd4j-native-platform:0.9.1"
    compile "org.slf4j:slf4j-simple:1.7.25"
    compile "org.slf4j:slf4j-api:1.7.25"
}

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

Log output:

word2vec$ ./gradlew clean jibDockerBuild
warning: Could not find build output directory 'xxxxxx/word2vec/build/classes/java/main'
warning: Base image 'gcr.io/distroless/java' does not use a specific image digest - build may not be reproducible

Containerizing application to Docker daemon as sakebook/word2vec-deeplearning4j-kotlin...

Getting base image gcr.io/distroless/java...
Building dependencies layer...
Building resources layer...
Building classes layer...
Finalizing...
Loading to Docker daemon...
<==========---> 83% EXECUTING [1h 19m 22s]

Additional Information:

My application wrote by Kotlin.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
sakebookcommented, Jul 21, 2018

Works fine! Thank you mentions.

1reaction
chanseokohcommented, Jul 16, 2018

Only when pushing to the local docker daemon. Might be that we are miscalculating the length of a string or something when multi-byte chars are involved?

Stack trace from mvn -X jib:buildTar
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.7-SNAPSHOT:buildTar (default-cli) on project _MavenJavaTest: Building image tarball failed: request to write '719' bytes exceeds size in header of '713' bytes for entry 'config.json' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.7-SNAPSHOT:buildTar (default-cli) on project _MavenJavaTest: Building image tarball failed
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Building image tarball failed
        at com.google.cloud.tools.jib.maven.BuildTarMojo.execute(BuildTarMojo.java:129)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more
Caused by: java.io.IOException: request to write '719' bytes exceeds size in header of '713' bytes for entry 'config.json'
        at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.write(TarArchiveOutputStream.java:447)
        at java.io.OutputStream.write(OutputStream.java:75)
        at com.google.cloud.tools.jib.tar.TarStreamBuilder.lambda$addEntry$1(TarStreamBuilder.java:99)
        at com.google.cloud.tools.jib.tar.TarStreamBuilder.writeEntriesAsTarArchive(TarStreamBuilder.java:62)
        at com.google.cloud.tools.jib.blob.WriterBlob.writeTo(WriterBlob.java:36)
        at com.google.cloud.tools.jib.builder.steps.WriteTarFileStep.afterPushBaseImageLayerFuturesFuture(WriteTarFileStep.java:99)
        at com.google.common.util.concurrent.CombinedFuture$CallableInterruptibleTask.runInterruptibly(CombinedFuture.java:181)
        at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
        Suppressed: java.io.IOException: This archive contains unclosed entries.
                at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.finish(TarArchiveOutputStream.java:289)
                at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.close(TarArchiveOutputStream.java:306)
                at com.google.cloud.tools.jib.tar.TarStreamBuilder.$closeResource(TarStreamBuilder.java:65)
                at com.google.cloud.tools.jib.tar.TarStreamBuilder.writeEntriesAsTarArchive(TarStreamBuilder.java:65)
                ... 7 more
Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found