0

Since I changed the message with a commit and forced push it, team city is displaying this error on the build and all of my next pushes aren't sent to the server. The changes aren't sent.

I don't know how to deal with this error, didn't find anything on the internet, and the fact that my new pushes aren't counted is just what bothers me.

Here's the log :

[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

Seems to be a problem with the git config but I didn't change that.

If anyone knows how to deal with the problem that would be awesome.

rene
  • 41,474
  • 78
  • 114
  • 152
Von
  • 178
  • 1
  • 20

2 Answers2

0

This has most probably nothing to do with TeamCity, but with your update script.

Your script /scripts/intranet/10-vcs_update.sh is erroring out with exit code 128 and so the TeamCity build fails.

Go to your server, execute your update script and see where it fails exactly. You can also add set -x to your script then it should output what is currently executed.

Vampire
  • 35,631
  • 4
  • 76
  • 102
  • I didn't want to do mistakes so I just looked in the file and there is only : set -eu cd /var/docker/intranet git pull. Also it's in read only, maybe that's the problem – Von Apr 25 '16 at 11:56
  • Yeah, and there you have your problem. You make a `pull` which is a `fetch` and then a `merge` if you didn't change configuration. So you try to create a merge commit, but your `user.email` and `user.name` are not set and thus the command errors out and even tells you in prosa before erroring out. – Vampire Apr 25 '16 at 11:58
  • Sooo... Something "restarted git" and deleted the users infos set before ? What can I do I need to do to fix it ? And without damaging anything – Von Apr 25 '16 at 12:02
  • I doubt there were user infos set before. There were simply no merge necessary before as on the server nothing is committed and the incoming changes were fast-forwarded. Through your rewriting of published history, you cause a situation where anyone (including the buildserver) has to rebase their local repositories to recover from you, manipulating the history of the repository. How you handle with the situation depends on your goals. For a short-time fix, just rebase the repo on TC. For a long-term fix make sure noone works on TC and change the pull to a fetch and hard-reset or similar. – Vampire Apr 25 '16 at 12:22
  • But, they were. Before my git push --force, everything worked well. I never had problems before that. I checked former logs, like the one before the problem and everything is fine, and it was the day before. I really did something bad by wantig to change the message of a commit already pushed, but I don't get how it changed teamcity that much – Von Apr 25 '16 at 12:28
  • Also, I searched into my files on the server, and the changes I pushed (but that don't appear on the website) are in the buildAgent/work directory. But the directory supposed to contain the on-date files, have the version before the problem. Is there a way to recover them somehow with teamcity ? Will it take care after the pb is solved ? – Von Apr 25 '16 at 12:42
  • The were most probably not. I already explained what most probably happened and how you can resolve it in my last comment. – Vampire Apr 25 '16 at 12:56
0

You need to configure you git default settings on the TeamCity server, so basically you need ssh to the server and set you email and name like:

git config --global user.email "you_email@example.com"

git config --global user.name "Your Name"

  • Well, it worked perfectly before, and I don't know which account is used for it :/ – Von Apr 25 '16 at 11:58