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

s3Upload fails with duplicate class definition of com.amazonaws.event.ProgressEvent #277

Open
VladimirKovac-FS opened this issue May 21, 2021 · 1 comment
Labels

Comments

@VladimirKovac-FS
Copy link

Hello,

I've been getting this error for plugin version 1.43, Jenkins version 2.277.4:

java.lang.LinkageError: loader (instance of  hudson/ClassicPluginStrategy$AntClassLoader2): attempted  duplicate class definition for name: "com/amazonaws/event/ProgressEvent"
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at jenkins.util.AntClassLoader.defineClassFromData(AntClassLoader.java:1155)
	at hudson.ClassicPluginStrategy$AntClassLoader2.defineClassFromData(ClassicPluginStrategy.java:718)
	at jenkins.util.AntClassLoader.getClassFromStream(AntClassLoader.java:1326)
	at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1377)
	at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1342)
	at jenkins.ClassLoaderReflectionToolkit._findClass(ClassLoaderReflectionToolkit.java:107)
	at hudson.ClassicPluginStrategy$DependencyClassLoader.findClass(ClassicPluginStrategy.java:637)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at jenkins.util.AntClassLoader.findBaseClass(AntClassLoader.java:1406)
	at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1085)
	at java.lang.ClassLoader.loadClass(Unknown Source)
Caused: java.lang.BootstrapMethodError
	at de.taimos.pipeline.aws.S3UploadStep$RemoteUploader.invoke(S3UploadStep.java:626)
	at de.taimos.pipeline.aws.S3UploadStep$RemoteUploader.invoke(S3UploadStep.java:481)
	at hudson.FilePath.act(FilePath.java:1164)
	at hudson.FilePath.act(FilePath.java:1147)
	at de.taimos.pipeline.aws.S3UploadStep$Execution.run(S3UploadStep.java:463)
	at de.taimos.pipeline.aws.S3UploadStep$Execution.run(S3UploadStep.java:295)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
  • The build is setup via a scripting pipeline.
  • The path to upload is a directory with multiple child folders and files.
  • Starting the upload via CLI works as intended.
  • AWS credentials are correct.
  • The only Amazon-related plugin installed is Pipeline: AWS Steps and its dependencies. I thought at first some other plugin may be loading a different version of ProgressEvent but that wasn't the case.

Did anyone encounter anything similar? I can't find any good resources on what else to check and how to fix this issue. Is it possible multiple uploads load the same class and cause a collision?

@VladimirKovac-FS
Copy link
Author

In case somebody runs into the same issue, we still haven't solved it but instead avoided it by replacing the plugin with a direct batch call to AWS CLI:

withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'KEY_ID', credentialsId: 'CRED-ID', secretKeyVariable: 'ACCESS_KEY']])
{
	echo bat(returnStdout: true, script: "aws s3 cp --recursive ${FOLDER_FROM} ${FOLDER_TO}").trim()
}

If on Windows, make sure that the Jenkins service runs with a Windows user that has privileges to access FOLDER_FROM and call aws s3 cp.

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

No branches or pull requests

1 participant