Skip to content

java.io.IOException in FileWriter copyFromDirectory() #2698

@AlexisRiksman-TomTom

Description

@AlexisRiksman-TomTom

Describe the bug
Gradle task :dokkaHtmlMultiModule fails with a java.io.IOException in FileWriter$copyFromDirectory file.copyRecursively().
See: https://github.com/Kotlin/dokka/blob/v1.7.10/plugins/base/src/main/kotlin/renderers/FileWriter.kt#L56

Expected behaviour
Dokka should 'just' work fine.

Screenshots
Error log:

> Task :dokkaHtmlMultiModule
Initializing plugins
Dokka is performing: index page for project
Processing submodules
Creating all modules page
Transforming pages
Rendering
Failed to write org.jetbrains.dokka.base.renderers.FileWriter@77113a88. Parent job is Cancelling
kotlinx.coroutines.JobCancellationException: Parent job is Cancelling; job=ScopeCoroutine{Cancelling}@4a422011
Caused by: java.io.IOException: Source file wasn't copied completely, length of destination file differs.
	at kotlin.io.FilesKt__UtilsKt.copyRecursively(Utils.kt:329)

	at kotlin.io.FilesKt__UtilsKt.copyRecursively$default(Utils.kt:288)
	at org.jetbrains.dokka.base.renderers.FileWriter$copyFromDirectory$2.invokeSuspend(FileWriter.kt:56)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
kotlinx.coroutines.JobCancellationException: Parent job is Cancelling; job=ScopeCoroutine{Cancelling}@4a422011
Caused by: java.io.IOException: Source file wasn't copied completely, length of destination file differs.
	at kotlin.io.FilesKt__UtilsKt.copyRecursively(Utils.kt:329)
	at kotlin.io.FilesKt__UtilsKt.copyRecursively$default(Utils.kt:288)
	at org.jetbrains.dokka.base.renderers.FileWriter$copyFromDirectory$2.invokeSuspend(FileWriter.kt:56)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

> Task :dokkaHtmlMultiModule FAILED

Failed to write org.jetbrains.dokka.base.renderers.FileWriter@77113a88. Parent job is Cancelling

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':dokkaHtmlMultiModule'.
> java.io.IOException: Source file wasn't copied completely, length of destination file differs.

To Reproduce
We run Dokka as part of an Azure pipeline and sometimes it fails in this way. Most of the times it works fine.

Dokka configuration
dokka = "1.7.10"
kotlin = "1.7.10"
kotlinxCoroutines = "1.6.3"

Installation

  • Operating system: Linux in Azure pipeline
  • Build tool: Gradle v7.5.1
  • Dokka version: 1.7.10

Additional context

Are you willing to provide a PR?
No, because I don't know what causes this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions