Xcode Bot integration error : Failed to mmap

2019-04-07 23:39发布

问题:

I am clueless as to how to fix this "Build Service error issues" when I try to integrate a Xcode bot on my OS X Server 4.0.

Everything works fine on this server, I even have another working bot on another branch of the same project.

It throws me

Bot Issue: error. Build Service Error. Issue: Failed to mmap. Could not write data: Invalid argument (-1).

Got no idea what to do...

Thanks in advance!

回答1:

This is apparently due to a bug in Xcode 6.1.1. In order to workaround, I reinstalled Xcode 6.1.

I was not able to just select another version of Xcode in the Server app, I had to completely reset the Xcode service (this will delete all your bots, you will have to recreate them):

sudo xcrun xcscontrol --reset

Before I could select Xcode 6.1 in the Server app I also had to run this command:

sudo xcrun xcscontrol --initialize

If someone feels very adventurous and would like to understand the root cause of the problem on Xcode 6.1.1, here is where the error comes from. The libgit2 binary is at /Xcode-6.1.1.app/Contents/Developer/usr/lib/libgit2.dylib



回答2:

I had the same issue and I just updated the bot without making any changes to fix this. Just go to Report navigator in Xcode, select your bot, press "Edit bot..." and update it without making any changes.



回答3:

As of version 6.3 (possibly earlier), Xcode now offers a "Fix it" button that fixes the Git credentials, and got me up and running. The next build had warnings about the working copy state, but after a cleaning, the next build was fine.



回答4:

I had a bit of a finneky solution to this issue. Still not sure what causes the issue but this was sporadically failing for me. What i did was i kept integrating with always clean set until i got a successful test, at that point i edited the bot to never clean. Now it's successfully running tests every time. I'm not saying this is the correct solution and I know it isn't a nice solution but having tried resetting osx server and updating my ssh keys etc its the only way i could get around it.