xebialabs-community / xld-deployed-artifact-steps-plugin

<upload-artifact> and <delete-artifact> steps supporting diff mode for the XL Deploy rule engine.
http://www.xebialabs.com
1 stars 1 forks source link

Deployment fails if files are present on the target folder that are also in the to be deployed artifact #4

Open jdewinne opened 6 years ago

jdewinne commented 6 years ago

XLD version: 8.0.0 (also reproducible on 8.1.0) How to reproduce:

Log output:

Analyze.../tmp/demo
Step failed
java.security.AccessControlException: access denied ("java.io.FilePermission" "work/workdir-20180712T044403316.3330/artifact.2128/cloud-plugin-3.9.3.jar/META-INF/MANIFEST.MF" "read")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.security.AccessController.checkPermission(AccessController.java:884)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
at java.io.FileInputStream.<init>(FileInputStream.java:127)
at com.xebialabs.overthere.local.LocalFile$1.<init>(LocalFile.java:201)
at com.xebialabs.overthere.local.LocalFile.getInputStream(LocalFile.java:201)
at com.xebialabs.overtherepy.FileWrapper$OverthereFileByteSource.openStream(FileWrapper.java:82)
at com.google.common.io.ByteSource.copyTo(ByteSource.java:247)
at com.google.common.io.ByteSource.hash(ByteSource.java:325)
at com.xebialabs.overtherepy.FileWrapper.getHashCode(FileWrapper.java:59)
at com.xebialabs.overtherepy.DirectoryChangeSet.lambda$process$2(DirectoryChangeSet.java:65)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1380)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
bmoussaud commented 6 years ago

Something has changed in XLD engine since 8.x ... I'm investigating ...

hierynomus commented 6 years ago

It seems that the security policy file is not correct for this case. I think that was tightened/added in 8.0.0

bmoussaud commented 6 years ago

cat xl-deploy.policy

grant {
    permission java.security.AllPermission;
};
hierynomus commented 6 years ago

That's weird. That should indeed mean that all permissions are granted. Though the stacktrace claims otherwise.

bmoussaud commented 6 years ago

is it because I'm using foreach() with parallelStream() ? https://github.com/xebialabs-community/xld-deployed-artifact-steps-plugin/blob/df331296bd3cc3c88e873eb69cdc4e0b2b3a3a3f/src/main/java/com/xebialabs/overtherepy/DirectoryChangeSet.java#L65

hierynomus commented 6 years ago

I have no idea, have you tried without parallel?

bmoussaud commented 6 years ago

@hierynomus without parallelStream (parallelStream=false) it works .. any ideas why does it fail when I use parallel Streams ?

hierynomus commented 6 years ago

No, I actually have no idea... Might be something deep in the JVM then...

bmoussaud commented 6 years ago

@jdewinne this commit exposes the options in the file.LargeFolder plugin : https://github.com/xebialabs-community/xld-deployed-artifact-steps-plugin/commit/036f089a2fba04a81dad9514fbdabdeac61da9f4

jdewinne commented 6 years ago

@bmoussaud you want me to report this with the XLD core team, so they can have a look at it why parallelStream isn't working?

bmoussaud commented 6 years ago

@jdewinne +1