Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot fingerprint input property #120

Open
KDanisme opened this issue Apr 16, 2023 · 10 comments
Open

Cannot fingerprint input property #120

KDanisme opened this issue Apr 16, 2023 · 10 comments

Comments

@KDanisme
Copy link

When using Gradle 8.1, and running any liquibase command im getting this error:

> Cannot fingerprint input property 'liquibaseCommand': value 'org.liquibase.gradle.liquibase.command.UpdateCommand@4118ec48' cannot be serialized.

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':update'.
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:337)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:324)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:317)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
Caused by: org.gradle.internal.execution.InputFingerprinter$InputFingerprintingException: Cannot fingerprint input property 'liquibaseCommand': value 'org.liquibase.gradle.liquibase.command.UpdateCommand@4118ec48' cannot be serialized.
	at org.gradle.internal.execution.impl.DefaultInputFingerprinter$InputCollectingVisitor.visitInputProperty(DefaultInputFingerprinter.java:114)
	at org.gradle.api.internal.tasks.execution.TaskExecution.visitRegularInputs(TaskExecution.java:313)
	at org.gradle.internal.execution.impl.DefaultInputFingerprinter.fingerprintInputProperties(DefaultInputFingerprinter.java:63)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.captureExecutionStateWithOutputs(CaptureStateBeforeExecutionStep.java:123)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$captureExecutionState$1(CaptureStateBeforeExecutionStep.java:82)
	at org.gradle.internal.execution.steps.BuildOperationStep$1.call(BuildOperationStep.java:37)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.internal.execution.steps.BuildOperationStep.operation(BuildOperationStep.java:34)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.captureExecutionState(CaptureStateBeforeExecutionStep.java:76)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$execute$0(CaptureStateBeforeExecutionStep.java:70)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:70)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:45)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.executeWithNonEmptySources(SkipEmptyWorkStep.java:177)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:81)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:53)
	at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:32)
	at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:21)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
	at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
	at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
	at org.gradle.internal.execution.steps.CleanupStaleOutputsStep.execute(CleanupStaleOutputsStep.java:75)
	at org.gradle.internal.execution.steps.CleanupStaleOutputsStep.execute(CleanupStaleOutputsStep.java:41)
	at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:32)
	at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:287)
	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:21)
	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:47)
	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:34)
	at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:64)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:146)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:135)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:337)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:324)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:317)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
Caused by: org.gradle.internal.snapshot.ValueSnapshottingException: Could not serialize value of type UpdateCommand
	at org.gradle.internal.snapshot.impl.AbstractValueProcessor.newValueSerializationException(AbstractValueProcessor.java:187)
	at org.gradle.internal.snapshot.impl.AbstractValueProcessor.javaSerialization(AbstractValueProcessor.java:178)
	at org.gradle.internal.snapshot.impl.AbstractValueProcessor.processValue(AbstractValueProcessor.java:157)
	at org.gradle.internal.snapshot.impl.DefaultValueSnapshotter.snapshot(DefaultValueSnapshotter.java:47)
	at org.gradle.internal.execution.impl.DefaultInputFingerprinter$InputCollectingVisitor.visitInputProperty(DefaultInputFingerprinter.java:107)
	... 65 more
Caused by: java.io.NotSerializableException: org.liquibase.gradle.liquibase.command.UpdateCommand
	at org.gradle.internal.snapshot.impl.AbstractValueProcessor.javaSerialization(AbstractValueProcessor.java:175)
	... 68 more
@ceyhunn
Copy link

ceyhunn commented May 7, 2023

Hi,
same problem with gradle version 7.6. It seems like, the problem is related to liquibase plugin version 2.2.0, because it works with version 2.1.0.

@luispollo
Copy link

Ran into the same issue with 2.2.0 today. Any updates on this?

@gustabart
Copy link

Hi,
I have the same problem when using the plugin together with the org.graalvm.buildtools.native plugin.
Whatever the command, the error is the same. Example with TagCommand:

* What went wrong:
Execution failed for task ':tag'.
> Cannot fingerprint input property 'liquibaseCommand': value 'org.liquibase.gradle.liquibase.command.TagCommand@38877c3a' cannot be serialized.

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':tag'.
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38)

...
Caused by: org.gradle.internal.snapshot.ValueSnapshottingException: Could not serialize value of type TagCommand
        at org.gradle.internal.snapshot.impl.AbstractValueProcessor.newValueSerializationException(AbstractValueProcessor.java:187)
        at org.gradle.internal.snapshot.impl.AbstractValueProcessor.javaSerialization(AbstractValueProcessor.java:178)
        at org.gradle.internal.snapshot.impl.AbstractValueProcessor.processValue(AbstractValueProcessor.java:157)
        at org.gradle.internal.snapshot.impl.DefaultValueSnapshotter.snapshot(DefaultValueSnapshotter.java:47)
        at org.gradle.internal.execution.impl.DefaultInputFingerprinter$InputCollectingVisitor.visitInputProperty(DefaultInputFingerprinter.java:107)
        ... 70 more
Caused by: java.io.NotSerializableException: org.liquibase.gradle.liquibase.command.TagCommand
        at org.gradle.internal.snapshot.impl.AbstractValueProcessor.javaSerialization(AbstractValueProcessor.java:175)
        ... 73 more

Environment:

  • Java 17
  • Gradle 8.5
  • build.gradle file:
plugins {
  id "java"
  id "org.springframework.boot" version "3.1.6"
  id "io.spring.dependency-management" version "1.1.4"
  id 'org.liquibase.gradle' version '2.2.1'	
  id 'org.graalvm.buildtools.native' version '0.9.28'
}
...

However, if I remove the org.graalvm.buildtools.native plugin, everything works fine.
Any ideas ?

@treethingy
Copy link

I encounter the same problem as gustabart with slightly different versions:

id 'org.springframework.boot' version '3.2.0'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.liquibase.gradle' version '2.2.1'
id 'org.graalvm.buildtools.native' version '0.9.23'

@pareekdevanshu
Copy link

pareekdevanshu commented Feb 20, 2024

any workaround till the time the issue is fixed?
I am getting the same error without org.graalvm.buildtools.native plugin as well.

nbrugger-tgm pushed a commit to nbrugger-tgm/liquibase-gradle-plugin that referenced this issue Feb 20, 2024
While I can confirm this fixes the issue, I cannot add a test since there is no infrastructure to execute the tasks.

ref: liquibase#120
nbrugger-tgm pushed a commit to nbrugger-tgm/liquibase-gradle-plugin that referenced this issue Feb 20, 2024
While I can confirm this fixes the issue, I cannot add a test since there is no infrastructure to execute the tasks.

ref: liquibase#120
nbrugger-tgm added a commit to nbrugger-tgm/liquibase-gradle-plugin that referenced this issue Feb 21, 2024
While I can confirm this fixes the issue, I cannot add a test since there is no infrastructure to execute the tasks.

ref: liquibase#120
nbrugger-tgm added a commit to nbrugger-tgm/liquibase-gradle-plugin that referenced this issue Feb 21, 2024
While I can confirm this fixes the issue, I cannot add a test since there is no infrastructure to execute the tasks.

ref: liquibase#120
@moreginger
Copy link

A fix for this would be great, since the liquibase task forces any task downstream of it to run every time.

Also, it may be that the new and shiny version using liquibase 4.28.0 - if it avoids this issue - will introduce new issues that will take some time to iron out.

@stevesaliman
Copy link
Collaborator

At long last, version 3.0.0 of the plugin has been released. The LiquibaseCommand class is no longer part of the plugin, so is this sitll an issue?

@TTia
Copy link

TTia commented Aug 9, 2024

@stevesaliman I'm still getting this error. Here some chunks from the build.gradle:

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    ...
    classpath 'org.liquibase:liquibase-core:4.29.1'
  }
}

plugins {
  id 'org.liquibase.gradle' version '3.0.0'
}
dependencies {
  ...
  liquibaseRuntime("org.liquibase:liquibase-core:4.29.1")
  liquibaseRuntime("org.liquibase:liquibase-groovy-dsl:4.0.0")
  liquibaseRuntime 'info.picocli:picocli:4.6.1'
  liquibaseRuntime("org.postgresql:postgresql")

...

liquibase {
  jvmArgs "-Duser.dir=$project.projectDir"

  activities {
    main {
      changelogFile 'src/main/resources/db/liquibase-changelog.yml'
      url "jdbc:postgresql://localhost:6432/connect_local"
      username "device_management_local"
      password "secret"
      logLevel "info"
    }
  }
  runList = "main"
}

Many thanks! Any hint is appreciated!

@iyanging
Copy link

@pareekdevanshu @treethingy @gustabart

If you are using GraalVM gradle plugin, you can set these in your build.gradle.kts:

graalvmNative {
    agent {
        tasksToInstrumentPredicate.set { task ->
            !task.group.equals("liquibase", ignoreCase = true)
        }
    }
}

The reason why GraalVM gradle plugin destorys liquibase tasks, is that:

-> GraalVM gradle plugin tries to instrument every task
-> The instrument will inject AgentCommandLineProvider, which has a @OutputDirectory property, into "jvmArgumentProviders"
-> So Task has a property which is counted as hasDeclaredOutputs()
-> Now task is incremental
-> Cannot fingerprint input property

@averyaube
Copy link

I am running into this issue in version 3.0.1 of this plugin when I set an output on the task in order to make an incremental build:

tasks.update.configure {
    outputs.dir("PATH_WITH_MY_CHANGELOG")
}

I then receive the following error:

Execution failed for task ':database:update'.
> Cannot fingerprint input property 'argumentBuilder': value 'org.liquibase.gradle.ArgumentBuilder@75f1af57' cannot be serialized.

When looking in the source, I saw that ArgumentBuilder is an input for LiquibaseTask - I assume inputs are only serialized when there is also an output (the Gradle docs mentioned that outputs are necessary for incremental builds). Perhaps ArgumentBuilder just has to implement Serializable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.