apache / iceberg-python

Apache PyIceberg
https://py.iceberg.apache.org/
Apache License 2.0
402 stars 147 forks source link

`hive` docker container crash for integration test on M1 #835

Closed kevinjqliu closed 3 months ago

kevinjqliu commented 3 months ago

Apache Iceberg version

None

Please describe the bug 🐞

While running integration tests on M1 mac, the hive container will crash randomly with a JVM error message. Sometimes, restarting the container works.

Stacktrace

2024-06-18 22:58:18 /entrypoint.sh: line 26:     8 Aborted                 $HIVE_HOME/bin/schematool -dbType $DB_DRIVER -initSchema
2024-06-18 22:58:18 + '[' 134 -eq 0 ']'
2024-06-18 22:58:18 + echo 'Schema initialization failed!'
2024-06-18 22:58:18 + exit 1
2024-06-18 22:58:18 #
2024-06-18 22:58:18 # A fatal error has been detected by the Java Runtime Environment:
2024-06-18 22:58:18 #
2024-06-18 22:58:18 #  SIGBUS (0x7) at pc=0x00007ffffecc383f, pid=8, tid=0x00007ffffe26a700
2024-06-18 22:58:18 #
2024-06-18 22:58:18 # JRE version: OpenJDK Runtime Environment (8.0_342-b07) (build 1.8.0_342-b07)
2024-06-18 22:58:18 # Java VM: OpenJDK 64-Bit Server VM (25.342-b07 mixed mode linux-amd64 compressed oops)
2024-06-18 22:58:18 # Problematic frame:
2024-06-18 22:58:18 # V  [libjvm.so+0x91483f]  ObjectMonitor::enter(Thread*)+0x3f
2024-06-18 22:58:18 #
2024-06-18 22:58:18 # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
2024-06-18 22:58:18 #
2024-06-18 22:58:18 # An error report file with more information is saved as:
2024-06-18 22:58:18 # /opt/hive/hs_err_pid8.log
2024-06-18 22:58:18 #
2024-06-18 22:58:18 # If you would like to submit a bug report, please visit:
2024-06-18 22:58:18 #   http://bugreport.java.com/bugreport/crash.jsp
2024-06-18 22:58:18 #
2024-06-18 22:58:18 Schema initialization failed!

Possibly related:

Fokko commented 3 months ago

@kevinjqliu thanks for reporting. This surprises me since I'm also on a M1. Do you know which Docker version you're using?

kevinjqliu commented 3 months ago
➜  ~ docker --version
Docker version 26.1.4, build 5650f9b

Not sure if its my env / setup.

I've tried resetting docker a couple times

docker system prune --all --volumes

Its still intermittent for me

kevinjqliu commented 3 months ago

Just to be sure, are you getting this warning?

 ! hive The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s 

Screenshot 2024-06-18 at 11 16 48 PM

ndrluis commented 3 months ago

A few weeks ago I received this error. Then I ran export DOCKER_DEFAULT_PLATFORM=linux/amd64 before executing the tests and it fixed the issue.

kevinjqliu commented 3 months ago

@ndrluis are you using M1 Mac by chance? I tried DOCKER_DEFAULT_PLATFORM=linux/amd64 and ran into the same issue

ndrluis commented 3 months ago

@kevinjqliu Yes, I'm using an M1 Mac. 🤔 Do you have the "Use Rosetta for x86_64/amd64 emulation on Apple Silicon" option activated?

kevinjqliu commented 3 months ago

Looks like I do, I'll disable and give it a try. Thanks for the hint! Screenshot 2024-06-20 at 9 22 26 AM

kevinjqliu commented 3 months ago

Disabling Use Rosetta for x86_64/amd64 emulation on Apple Silicon helped prevent the container from crashing. but connections to the container often time out.

@Fokko observes similar issues.

I was able to verify that #877 helps, the hive container no longer runs on emulation image