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

[CI][Packaging] Java jars job is currently failing on arm64 #41577

Closed
raulcd opened this issue May 7, 2024 · 31 comments
Closed

[CI][Packaging] Java jars job is currently failing on arm64 #41577

raulcd opened this issue May 7, 2024 · 31 comments

Comments

@raulcd
Copy link
Member

raulcd commented May 7, 2024

Describe the bug, including details regarding any error messages, version, and platform.

The java-jars jobs is failing with:

 [INFO] <<< source:3.3.0:jar (default-cli) < generate-sources @ module-info-compiler-maven-plugin <<<
[INFO] 
[INFO] 
[INFO] --- source:3.3.0:jar (default-cli) @ module-info-compiler-maven-plugin ---
Error:  We have duplicated artifacts attached.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Apache Arrow Java Root POM 17.0.0-SNAPSHOT:
[INFO] 
[INFO] Arrow Maven Plugins ................................ SUCCESS [ 35.403 s]
[INFO] Module Info Compiler Maven Plugin .................. FAILURE [ 17.883 s]
[INFO] Arrow Bill of Materials ............................ SKIPPED
[INFO] Apache Arrow Java Root POM ......................... SKIPPED
[INFO] Arrow Format ....................................... SKIPPED
[INFO] Arrow Memory ....................................... SKIPPED
[INFO] Arrow Memory - Core ................................ SKIPPED
[INFO] Arrow Memory - Unsafe .............................. SKIPPED
[INFO] Arrow Memory - Netty Buffer ........................ SKIPPED
[INFO] Arrow Memory - Netty ............................... SKIPPED
[INFO] Arrow Vectors ...................................... SKIPPED
[INFO] Arrow Compression .................................. SKIPPED
[INFO] Arrow Tools ........................................ SKIPPED
[INFO] Arrow JDBC Adapter ................................. SKIPPED
[INFO] Arrow Flight ....................................... SKIPPED
[INFO] Arrow Flight Core .................................. SKIPPED
[INFO] Arrow Flight SQL ................................... SKIPPED
[INFO] Arrow Flight SQL JDBC Driver Core .................. SKIPPED
[INFO] Arrow Flight SQL JDBC Driver ....................... SKIPPED
[INFO] Arrow Flight Integration Tests ..................... SKIPPED
[INFO] Arrow AVRO Adapter ................................. SKIPPED
[INFO] Arrow Algorithms ................................... SKIPPED
[INFO] Arrow Performance Benchmarks ....................... SKIPPED
[INFO] Arrow Java C Data Interface ........................ SKIPPED
[INFO] Arrow Orc Adapter .................................. SKIPPED
[INFO] Arrow Gandiva ...................................... SKIPPED
[INFO] Arrow Java Dataset ................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  53.821 s
[INFO] Finished at: 2024-05-07T09:29:26Z
[INFO] ------------------------------------------------------------------------
[INFO] 66 goals, 65 executed, 1 from cache
Error:  Failed to execute goal org.apache.maven.plugins:maven-source-plugin:3.3.0:jar (default-cli) on project module-info-compiler-maven-plugin: Presumably you have configured maven-source-plugn to execute twice times in your build. You have to configure a classifier for at least on of them. -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Error:  
Error:  After correcting the problems, you can resume the build with the command
Error:    mvn <args> -rf :module-info-compiler-maven-plugin
Error: Process completed with exit code 1.

This seems to be failing since macos-latest moved to arm64.

Component(s)

Continuous Integration, Packaging

@raulcd
Copy link
Member Author

raulcd commented May 8, 2024

@danepitkin @vibhatha @lidavidm any idea what is the issue on the java-jars? This is currently blocking 16.1.0, if someone can take a look.

@lidavidm
Copy link
Member

lidavidm commented May 8, 2024

apache/arrow-java#92

@lidavidm
Copy link
Member

lidavidm commented May 8, 2024

Though we didn't cherry-pick the suspected commit so something else is going on?

@raulcd
Copy link
Member Author

raulcd commented May 8, 2024

ok, let me cherry-pick: 2fd3fcc manually and validate

@lidavidm
Copy link
Member

lidavidm commented May 8, 2024

I thought that commit didn't fix the issue?

@lidavidm
Copy link
Member

lidavidm commented May 8, 2024

I'm saying that linked issue suspects 9090e67 as the cause. But that's not in 16.1.0, so there's some other cause.

@raulcd
Copy link
Member Author

raulcd commented May 8, 2024

The release was failing on a slightly different point which might be solved by only adding the other commit I mentioned. I assumed (probably wrongly) that this would also be required for the release. I am testing at the moment, see: #41437 (comment)
I will update if the job succeeds for the release.

@vibhatha
Copy link
Collaborator

vibhatha commented May 8, 2024

Yes that commit didn't fix it as far as I understand. I got the same issue in another PR today.

@lidavidm
Copy link
Member

lidavidm commented May 8, 2024

@vibhatha
Copy link
Collaborator

vibhatha commented May 8, 2024

Sure @lidavidm, I can.

@lidavidm
Copy link
Member

lidavidm commented May 8, 2024

It sounds like either: we can downgrade maven-source-plugin, or we can see if java_full_build.sh is specifying any duplicate phases

@vibhatha
Copy link
Collaborator

vibhatha commented May 8, 2024

I looked into the solution, I will probably start testing the ideas within the hour.

@raulcd
Copy link
Member Author

raulcd commented May 8, 2024

Might also fix: #41571

@lidavidm
Copy link
Member

lidavidm commented May 8, 2024

I don't think that's related, I would suspect bad usage of modules on our side or theirs

@vibhatha
Copy link
Collaborator

vibhatha commented May 8, 2024

I am testing a few ideas here: #41586
I will update if I get a favorable outcome.

@raulcd
Copy link
Member Author

raulcd commented May 8, 2024

Adding the following to the maint-16.1.0 branch:

$ git log -p b28633cfe5263ac977598f058b53d76f95d3d1fc
commit b28633cfe5263ac977598f058b53d76f95d3d1fc
Author: Raúl Cumplido <[email protected]>
Date:   Wed May 8 10:15:17 2024 +0200

    MINOR: [Release] Manually commit fix to avoid cherry-pick conflict for changing runner on java-jars

diff --git a/dev/tasks/java-jars/github.yml b/dev/tasks/java-jars/github.yml
index 0437ee7..eb9478e 100644
--- a/dev/tasks/java-jars/github.yml
+++ b/dev/tasks/java-jars/github.yml
@@ -80,7 +80,7 @@ jobs:
       fail-fast: false
       matrix:
         platform:
-          - { runs_on: ["macos-latest"], arch: "x86_64"}
+          - { runs_on: ["macos-13"], arch: "x86_64"}
           - { runs_on: ["macos-14"], arch: "aarch_64" }
     env:
       MACOSX_DEPLOYMENT_TARGET: "10.15"

commit ac8af222dd2e5800e2c6cbf45a5bdbb2309deed4
Author: Raúl Cumplido <[email protected]>

fixes the initial issue but fails somewhere else:

Error:  Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.119 s <<< FAILURE! -- in org.apache.arrow.dataset.jni.TestReservationListener
Error:  org.apache.arrow.dataset.jni.TestReservationListener.testDirectReservationListener -- Time elapsed: 0.017 s <<< ERROR!
java.lang.ExceptionInInitializerError
	at org.apache.arrow.dataset/org.apache.arrow.dataset.jni.TestReservationListener.testDirectReservationListener(TestReservationListener.java:46)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:42)
	at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
	at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:72)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
	at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.lambda$execute$1(JUnitPlatformProvider.java:191)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:186)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:118)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
Caused by: java.lang.RuntimeException: Failed to initialize DirectReservationListener. When starting Java you must include `--add-opens=java.base/java.nio=org.apache.arrow.dataset,org.apache.arrow.memory.core,ALL-UNNAMED` (See https://arrow.apache.org/docs/java/install.html)
	at org.apache.arrow.dataset/org.apache.arrow.dataset.jni.DirectReservationListener.<init>(DirectReservationListener.java:43)
	at org.apache.arrow.dataset/org.apache.arrow.dataset.jni.DirectReservationListener.<clinit>(DirectReservationListener.java:52)
	... 47 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make static void java.nio.Bits.reserveMemory(long,long) accessible: module java.base does not "opens java.nio" to module org.apache.arrow.dataset
	at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:391)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:367)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:315)
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:203)
	at java.base/java.lang.reflect.Method.setAccessible(Method.java:197)
	at org.apache.arrow.dataset/org.apache.arrow.dataset.jni.DirectReservationListener.<init>(DirectReservationListener.java:39)
	... 48 more

[INFO] 
[INFO] Results:
[INFO] 
Error:  Errors: 
Error:    TestReservationListener.testDirectReservationListener:46 ExceptionInInitializer
[INFO] 
Error:  Tests run: 37, Failures: 0, Errors: 1, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Apache Arrow Java Root POM 17.0.0-SNAPSHOT:
[INFO] 
[INFO] Arrow Maven Plugins ................................ SUCCESS [ 28.471 s]
[INFO] Module Info Compiler Maven Plugin .................. SUCCESS [ 19.556 s]
[INFO] Arrow Bill of Materials ............................ SUCCESS [  4.385 s]
[INFO] Apache Arrow Java Root POM ......................... SUCCESS [ 24.951 s]
[INFO] Arrow Format ....................................... SUCCESS [ 14.401 s]
[INFO] Arrow Memory ....................................... SUCCESS [  3.489 s]
[INFO] Arrow Memory - Core ................................ SUCCESS [ 30.969 s]
[INFO] Arrow Memory - Unsafe .............................. SUCCESS [ 11.935 s]
[INFO] Arrow Memory - Netty Buffer ........................ SUCCESS [ 12.603 s]
[INFO] Arrow Memory - Netty ............................... SUCCESS [ 12.214 s]
[INFO] Arrow Vectors ...................................... SUCCESS [01:52 min]
[INFO] Arrow Compression .................................. SUCCESS [ 14.812 s]
[INFO] Arrow Tools ........................................ SUCCESS [ 17.821 s]
[INFO] Arrow JDBC Adapter ................................. SUCCESS [ 20.325 s]
[INFO] Arrow Flight ....................................... SUCCESS [  4.016 s]
[INFO] Arrow Flight Core .................................. SUCCESS [01:15 min]
[INFO] Arrow Flight SQL ................................... SUCCESS [ 24.863 s]
[INFO] Arrow Flight SQL JDBC Driver Core .................. SUCCESS [02:03 min]
[INFO] Arrow Flight SQL JDBC Driver ....................... SUCCESS [ 39.296 s]
[INFO] Arrow Flight Integration Tests ..................... SUCCESS [ 23.352 s]
[INFO] Arrow AVRO Adapter ................................. SUCCESS [ 16.407 s]
[INFO] Arrow Algorithms ................................... SUCCESS [ 37.601 s]
[INFO] Arrow Performance Benchmarks ....................... SUCCESS [ 12.898 s]
[INFO] Arrow Java C Data Interface ........................ SUCCESS [ 15.981 s]
[INFO] Arrow Orc Adapter .................................. SUCCESS [ 27.511 s]
[INFO] Arrow Gandiva ...................................... SUCCESS [ 54.642 s]
[INFO] Arrow Java Dataset ................................. FAILURE [ 15.656 s]
[INFO] ------------------------------------------------------------------------

I've retried 3 times to see if it was a fluke but seems to be pretty consistent:
https://github.com/ursacomputing/crossbow/actions/runs/8998563168/job/24722115895

@raulcd
Copy link
Member Author

raulcd commented May 8, 2024

Meaning the issue on main is not reproducible on the 16.1.0 release but there's something else to be fixed.

@vibhatha
Copy link
Collaborator

vibhatha commented May 8, 2024

I mean if that is the case, the documentation describes the solution

https://arrow.apache.org/docs/java/install.html#java-compatibility

java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED -jar ...
env _JAVA_OPTIONS="--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED" java -jar ...

cc @lidavidm

@vibhatha
Copy link
Collaborator

vibhatha commented May 8, 2024

https://github.com/apache/arrow/blob/main/java/dataset/pom.xml#L204

<argLine combine.self="override">--add-reads=org.apache.arrow.dataset=com.fasterxml.jackson.databind --add-opens=java.base/java.nio=org.apache.arrow.dataset,org.apache.arrow.memory.core,ALL-UNNAMED</argLine>

Could this solve?

@vibhatha
Copy link
Collaborator

vibhatha commented May 8, 2024

It sounds like either: we can downgrade maven-source-plugin, or we can see if java_full_build.sh is specifying any duplicate phases

This doesn't seem to have duplicate phases, right?

# build the entire project
mvn clean \
    install \
    assembly:single \
    source:jar \
    javadoc:jar \
    -Papache-release \
    -Parrow-c-data \
    -Parrow-jni \
    -Darrow.cpp.build.dir=$dist_dir \
    -Darrow.c.jni.dist.dir=$dist_dir \
    -DdescriptorId=source-release

raulcd added a commit that referenced this issue May 8, 2024
@raulcd
Copy link
Member Author

raulcd commented May 8, 2024

If I add the two following commits (manually) b28633c and be62f6c to maint-16.1.0 the java-jars job on it does succeed.

Do we want to add be62f6c to main? It won't fix the current java-jars issue. CC @kou @lidavidm

@raulcd
Copy link
Member Author

raulcd commented May 8, 2024

Could this solve?

It does solve indeed. Thanks @vibhatha

@vibhatha
Copy link
Collaborator

vibhatha commented May 8, 2024

That's great. I am working on a parallel fix on main. Still I couldn't figure out it. But these findings could help to narrow it down, I guess.

@kou
Copy link
Member

kou commented May 8, 2024

Ah, how about using macos-12 not macos-13 for now?
I think that we don't need --add-opens=... with macos-12 (the previous macos-latest).

@vibhatha
Copy link
Collaborator

vibhatha commented May 9, 2024

@raulcd Is apache/arrow-java#92 a blocker for 16.1.0 release?

@lidavidm
Copy link
Member

lidavidm commented May 9, 2024

Sorry for missing this...we can add it to main too. It should be OK.

@lidavidm
Copy link
Member

lidavidm commented May 9, 2024

I assume it would fail without that once we fix the current java-jars issue on main anyways. (I believe @jbonofre has been looking at that, it sounds like this has been an issue for multiple Apache projects.)

@vibhatha
Copy link
Collaborator

vibhatha commented May 9, 2024

@lidavidm I tested a few ideas here
#41586

But the maven-source-plugin is not something we have explicitly added, it must be internally used somewhere in 31 pom update? Only place we use it is in gandiva and it has the proper configuration.

Also I am not sure if we have multiple phases on the build script either. Sorry I am still trying to figure out a solution for this.

@lidavidm
Copy link
Member

lidavidm commented May 9, 2024

We can let JB look at it then, I thought it was causing problems for the 16.1.0 branch. I assumed we could just override the parent pom and downgrade the plugin. It would be nice to reproduce it locally and see if we can avoid the duplicate artifact in the first place. Of course, the other solution might be to drop Java 8 and drop the plugin, and hope the rest of the build works.

@vibhatha
Copy link
Collaborator

vibhatha commented May 9, 2024

I need to see if we can bypass the parent pom using a particular version of a dependency it is using, like we do for regular dependencies. Not very familiar with this part, but I will keep looking in parallel.

@raulcd
Copy link
Member Author

raulcd commented May 9, 2024

I am going to close this as the 16.1.0 release has been solved. The issue for main can be tracked on the original: apache/arrow-java#92

@raulcd raulcd closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants