Jenkins

與 Jack 伺服器 (77) 的通信錯誤導致 Jenkins 建構失敗

  • July 24, 2018

我正在創建一個 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

我沒有得到任何有價值的東西。任何幫助,將不勝感激。

最後超級簡單的修復,只需要重新啟動伺服器,我的建構現在就完成了。

引用自:https://serverfault.com/questions/923182