我正在创建一个 CI 构建来编译我们的自定义 Android ROM / OS,当我尝试进行自动构建时,我在 Jenkins 中收到一个奇怪的错误。当我手动构建时,问题不会发生,这让我相信它与 Jenkins 有关,但我似乎无法弄清楚原因。
通过研究,似乎很多人对与内存相关的 jackserver 存在问题,但我正在构建的机器有 64GB 的 RAM 和 24 个线程。加上我得到的错误是一个通信错误:
Communication error with Jack server (77)
下面是我从 Jenkins 那里得到的错误日志:
FAILED: /bin/bash -c "(prebuilts/sdk/tools/jack-admin install-server prebuilts/sdk/tools/jack-launcher.jar prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar 2>&1 || (exit 0) ) && (JACK_SERVER_VM_ARGUMENTS=\"-Dfile.encoding=UTF-8 -XX:+TieredCompilation\" prebuilts/sdk/tools/jack-admin start-server 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update server prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar 4.8.ALPHA 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-2.28.RELEASE.jar 2.28.RELEASE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-3.36.CANDIDATE.jar 3.36.CANDIDATE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-4.7.BETA.jar 4.7.BETA || exit 47 )"
Writing client settings in /nvme/jenkins-slave/.jack-settings
Installing jack server in "/nvme/jenkins-slave/.jack-server"
Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore /nvme/jenkins-slave/.jack-server/server.jks -destkeystore /nvme/jenkins-slave/.jack-server/server.jks -deststoretype pkcs12".
Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore /nvme/jenkins-slave/.jack-server/client.jks -destkeystore /nvme/jenkins-slave/.jack-server/client.jks -deststoretype pkcs12".
Communication error with Jack server (77), try 'jack-diagnose' or see Jack server log
Failed to contact Jack server: Problem reading /nvme/jenkins-slave/.jack-server/server.pem. Try 'jack-diagnose'
Failed to contact Jack server: Problem reading /nvme/jenkins-slave/.jack-server/server.pem. Try 'jack-diagnose'
[ 31% 15431/48680] target thumb C++: libandroidfw_32 <= frameworks/base/libs/androidfw/ResourceTypes.cpp
[ 31% 15431/48680] target thumb C++: libandroidfw_32 <= frameworks/base/libs/androidfw/StreamingZipInflater.cpp
[ 31% 15431/48680] target thumb C++: libandroidfw_32 <= frameworks/base/libs/androidfw/BackupData.cpp
[ 31% 15431/48680] target SharedLib: libhardware_32 (out/target/product/rk3399_firefly_box/obj_arm/SHARED_LIBRARIES/libhardware_intermediates/LINKED/libhardware.so)
[ 31% 15431/48680] target thumb C++: libandroidfw_32 <= frameworks/base/libs/androidfw/ZipUtils.cpp
[ 31% 15431/48680] target thumb C++: libandroidfw_32 <= frameworks/base/libs/androidfw/BackupHelpers.cpp
[ 31% 15431/48680] target thumb C++: libandroidfw_32 <= frameworks/base/libs/androidfw/CursorWindow.cpp
[ 31% 15431/48680] target thumb C++: libandroidfw_32 <= frameworks/base/libs/androidfw/DisplayEventDispatcher.cpp
[ 31% 15431/48680] target thumb C++: libgui_32 <= frameworks/native/libs/gui/IGraphicBufferConsumer.cpp
[ 31% 15431/48680] target thumb C++: libgui_32 <= frameworks/native/libs/gui/IGraphicBufferProducer.cpp
[ 31% 15431/48680] target thumb C++: libgui_32 <= frameworks/native/libs/gui/IConsumerListener.cpp
[ 31% 15431/48680] target thumb C++: libgui_32 <= frameworks/native/libs/gui/BitTube.cpp
[ 31% 15431/48680] AAPT2 link out/target/common/obj/JAVA_LIBRARIES/android-support-annotations_intermediates/package-res.apk
[ 31% 15431/48680] AAPT2 link out/target/common/obj/JAVA_LIBRARIES/android-support-compat_intermediates/package-res.apk
[ 31% 15431/48680] AAPT2 link out/target/common/obj/JAVA_LIBRARIES/android-support-fragment_intermediates/package-res.apk
[ 31% 15431/48680] AAPT2 link out/target/common/obj/JAVA_LIBRARIES/android-support-v4_intermediates/package-res.apk
[ 31% 15431/48680] target thumb C++: libgui_32 <= frameworks/native/libs/gui/BufferItem.cpp
[ 31% 15431/48680] target thumb C++: libgui_32 <= frameworks/native/libs/gui/BufferItemConsumer.cpp
[ 31% 15431/48680] target thumb C++: libgui_32 <= frameworks/native/libs/gui/BufferQueue.cpp
[ 31% 15431/48680] target thumb C++: libgui_32 <= frameworks/native/libs/gui/BufferQueueConsumer.cpp
[ 31% 15431/48680] target thumb C++: libgui_32 <= frameworks/native/libs/gui/BufferQueueCore.cpp
[ 31% 15431/48680] target thumb C++: libcamera_client_32 <= frameworks/av/camera/Camera.cpp
[ 31% 15431/48680] Compiling SDK Stubs: out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes.jar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
Build step 'Execute shell' marked build as failure
Finished: FAILURE
另一个痛苦是 Jackserver 日志文件中没有任何记录,当我运行时:
jack-diagnose
我没有得到任何有价值的东西。任何帮助,将不胜感激。
最后超级简单的修复,只需要重新启动服务器,我的构建现在就完成了。