TeamCity 构建 "Process exited with code 128"

TeamCity Build "Process exited with code 128"

由于我通过提交更改了消息并强制推送它,team city 在构建时显示此错误并且我的所有下一次推送都没有发送到服务器。更改未发送。

我不知道如何处理这个错误,在互联网上没有找到任何东西,而且我的新推送没有被计算在内这一事实让我很困扰。

这是日志:

[15:55:51]Skip checking for changes - changes are already collected
[15:55:52]Building incremental patch for VCS root: Osaxis Git parametered root; checkout rules: =>; revision: bced9add36f7c34c8622b6f47bafbfdc45a69a48 --> 1efd8f421044b9f0d58784d982fd6d2c0f12609c
[15:55:51]Publishing internal artifacts
[15:55:51][Publishing internal artifacts] Sending using WebPublisher
[15:55:51][Publishing internal artifacts] Sending using ArtifactsCachePublisher
[15:55:51]Clearing temporary directory: /srv/TeamCity/buildAgent/temp/buildTmp
[15:55:51]Checkout directory: /srv/TeamCity/buildAgent/work/b4756bb7138c55d8
[15:55:51]Updating sources: server side checkout
[15:55:51][Updating sources] Using vcs information from agent file: b4756bb7138c55d8.xml
[15:55:52][Updating sources] Repository sources transferred
[15:55:52]Step 1/2: VCS update (parametered) (Command Line)
[15:55:52][Step 1/2] Starting: /bin/sh /scripts/intranet/10-vcs_update.sh
[15:55:52][Step 1/2] in directory: /srv/TeamCity/buildAgent/work/b4756bb7138c55d8
[15:55:52][Step 1/2] From http://git.osaxis.fr:8888/r/IntranetSF2
[15:55:52][Step 1/2]  + bced9ad...1efd8f4 developpement -> origin/developpement  (forced update)
[15:55:52][Step 1/2] 
[15:55:52][Step 1/2] *** Please tell me who you are.
[15:55:52][Step 1/2] 
[15:55:52][Step 1/2] Run
[15:55:52][Step 1/2] 
[15:55:52][Step 1/2]   git config --global user.email "you@example.com"
[15:55:52][Step 1/2]   git config --global user.name "Your Name"
[15:55:52][Step 1/2] 
[15:55:52][Step 1/2] to set your account's default identity.
[15:55:52][Step 1/2] Omit --global to set the identity only in this repository.
[15:55:52][Step 1/2] 
[15:55:52][Step 1/2] fatal: unable to auto-detect email address (got 'root@aef183e198de.(none)')
[15:55:52][Step 1/2] Process exited with code 128
[15:55:52][Step 1/2] Step VCS update (parametered) (Command Line) failed
[15:55:52]Step 2/2: Docker upgrade (parametered) (Command Line)
[15:55:52][Step 2/2] Build step Docker upgrade (parametered) (Command Line) is skipped because the previous step has failed
[15:55:52]Publishing internal artifacts
[15:55:52][Publishing internal artifacts] Sending using WebPublisher
[15:55:52][Publishing internal artifacts] Sending using ArtifactsCachePublisher
[15:55:53]Build finished

似乎是 git 配置的问题,但我没有更改它。

如果有人知道如何处理这个问题那就太好了。

这很可能与 TeamCity 无关,而是与您的更新脚本有关。

您的脚本 /scripts/intranet/10-vcs_update.sh 出现错误,退出代码为 128,因此 TeamCity 构建失败。

转到您的服务器,执行您的更新脚本并查看它究竟在哪里失败。您还可以将 set -x 添加到脚本中,然后它应该输出当前执行的内容。

您需要在 TeamCity 服务器上配置 git 默认设置,所以基本上您需要通过 ssh 连接到服务器并设置您的电子邮件和名称,例如:

git 配置 --global user.email "you_email@example.com"

git 配置 --global user.name "Your Name"