Xcode Server Bot won't connect to Gitlab server (Fails to integrate) - ios

I'm trying to integrate a simple Xcode Bot with my Xcode server.
I'm using OS X Server 5 Beta 3 and Xcode 7 Beta 5
I create a bot and everything goes great. I use an existing ssh key for connecting to this git repository on gitlab and that works fine everywhere else and even Xcode (in accounts preferences) seems to not have a problem with the repo.
But when I go to integrate the bot, it fails to check out the source with:
Failed to authenticate SSH session: Callback returned error (-1)
I've tried changing this to use my actual gitlab credentials instead of the ssh key and I get the same error. It doesn't seem to matter what I use for the bot, it fails to sign in. Yet all of those credentials work on gitlab using git and Xcode itself just fine.
Anyone else run into this? And/or are there any better logs somewhere of what's going on?
Not much in the verbosity in the xcodebuild logs on the server either:
2015-08-10 09:42:28.303 xcsbuildd[14203:84978] XCSIntegrationExecutor.m:229 [XCSIntegrationExecutor integrationStep:didFinishWithError:result:] [BuildService, Error] XCSCheckoutIntegrationStep finished integration with an error: Error Domain=XCSBuildServiceDomain Code=-1 "Could not checkout sources because the source control information is in an invalid format. UserInfo=0x7fb8ece65810 {NSLocalizedDescription=Could not checkout sources because the source control information is in an invalid format., XCSErrorFixItType=scm-failure}
Not sure what it means by invalid format?:
Could not checkout sources because the source control information is
in an invalid format

Related

How to fix Xcode's code sign issues on Jenkins?

I have done the usual steps of making the xcodebuild work on jenkins, which would be installing "keychain & provisioning profiles" plugin, uploading the right keychain+profiles in the plugin's configuration, and using security -v unlock-keychain, and PROVISIONING_PROFILE in the xcodebuild command.
the build goes forward O.K., even runs the defined postbuild scripts defined in the Xcode project, and creates the .app folder with all the necessary content, but fails here...
/Users/Shared/Jenkins/Home/jobs/iOS_feature/workspace/build/Applications/MyApp.app/Frameworks/libswiftUIKit.dylib: User interaction is not allowed.
*** error: Couldn't codesign /Users/Shared/Jenkins/Home/jobs/iOS_feature/workspace/build/Applications/MyApp.app/Frameworks/libswiftUIKit.dylib: codesign failed with exit code 1
Any ideas what could cause this? from what I understand, the Keychain+ProvisioningProfiles are in place since the build doesn't fail here.
firstly, are you passing your keychain password to the security -v unlock-keychain command (using -p)? it's definitely not an ideal solution, because it probably requires exposing your password in clear text on your build server.
our workaround for this problem is to login to the actual machine (remote screen sharing or locally sitting at the machine). run a single build from the desktop, whether it be command line or in Xcode. (you might be asked to "always allow" but i'm not 100% sure under which scenarios this will happen).
from then on, all your remote CI builds should pass through code signing successfully.
It's not due to reverse DNS failing or self signed certs on the Jenkins box is it?
We had similar issues though not on Jenkins but Xcode 7 does these extra two checks we found.
Does CodeSign have permission to use the private key?
Whenever I see this error, this is usually the solution:
https://stackoverflow.com/a/22637896/78496

Jenkins Cannot import the following key file

I am able to build my application on Visual Studio without any problem. I am trying Jenkins out on the same machine. When I try to build my application from my git remote repository (It contains the .pfx file in the SVC) I get the error
error MSB3325: Cannot import the following key file: Key.pfx. The key
file may be password protected. To correct this, try to import the
certificate again or manually install the certificate to the Strong
Name CSP with the following key container name: VS_KEY...
error MSB3321: Importing key file "Key.pfx" was canceled.
I had already run the command shown on the answer of this question Cannot import the keyfile 'blah.pfx' - error 'The keyfile may be password protected' and that is the reason my application runs in Visual Studio (I've done it through the command prompt as administrator fyi), which means when I try running it again the object already exists and if I uninstall and reinstall the same problem happens again.
Anyone has any ideas of how I can solve this problem?
Its the IIDentity (the windows account/identity) that is running Jenkins, most likely.
As a quick test, edit the Jenkins service and put in your credentials.
..
If that works, either keep it that way, or do your manual import voodoo using the identity that you want Jenkins to run under.

Error verifying the remote agent configuration 'vs-mda-remote test' fails with 'Error: not enough data'

I am following steps according to "Install Tools to Build for iOS" on msdn https://msdn.microsoft.com/en-us/library/dn771551.aspx, to setup an iOS build..
On my Mac, I get the following error when I execute the "vs-mda-remote test" command..
Initializing self test for https
downloading cert for pin 390276
Downloading client cert for selftest from https://myMac:3000/certs/390276 to /Users/fred/remote-builds/selftest/selftest-client.pfx
pfxPath: /Users/fred/remote-builds/selftest/selftest-client.pfx
serverUrl: https://myMac:3000
buildUrl: https://myMac:3000/build/tasks?vcordova=4.1.2&cfg=release&command=build&options=--emulator
_tls_common.js:176
c.context.loadPKCS12(pfx);
^
Error: not enough data
at Error (native)
at Object.createSecureContext (_tls_common.js:176:17)
at Object.exports.connect (_tls_wrap.js:850:21)
at Agent.createConnection (https.js:82:14)
at Agent.createSocket (_http_agent.js:194:16)
at Agent.addRequest (_http_agent.js:166:23)
at new ClientRequest (_http_client.js:154:16)
at Object.exports.request (http.js:49:10)
at Object.exports.request (https.js:136:15)
at Request.start (/usr/local/lib/node_modules/vs-mda-remote/node_modules/request/request.js:674:30)
The server appears to be sending one..
vs-mda-remote
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
0.2.7
Loading resources for language en from /usr/local/lib/node_modules/vs-mda-remote/resources/en/resources.json
Build Retention initialized with baseBuildDir /Users/fred/remote-builds/builds, maxBuildsToKeep 20
Initialized BuildManager with installedCordovaVersion: 4.1.2; baseBuildDir /Users/fred/remote-builds/builds; maxBuildsInQueue 10; deleteBuildsOnShutdown true; allowsEmulate true; nextBuildNumber 1479
ios-sim is installed on path at: /usr/local/lib/node_modules/vs-mda-remote/node_modules/ios-sim/build/release/ios-sim
Remote build server listening on [https] port 3000
GET /certs/390276 200 1ms - 3.51kb
Trouble shooting tried:
- to ensure that iOS profiles and xCode developer certs exist - I tested that I can deploy a test app to an iPad.
- rerun install and checked every message to look for failure, none
- regenerated serverCert and clientCert multiple times
possibly linked
- the pfxPath is valid and a pfx does exist. (other issues around this issue indicate that a passphrase must be passed to the context object and I cannot find any passphrase being passed, but this code https://sourcegraph.com/github.com/joyent/node/.CommonJSPackage/node/.def/commonjs/lib/_tls_common.js/-/createSecureContext #176 seems to handle no passphrase..
I've just had the same problem, but managed to figure it out - the following was configured Mac
1: Start the Server without TLS security
vs-mda-remote --secure false
2: Test the server (launch another terminal)
vs-mda-remote test --server http://localhost:3000
At this point - you shouldn't get any errors (this was failing here because the test mode seems to use TLS by default, and the only way to test with no security, is to manually specifiy the server URL)
3: Configure visual studio as per the documentation
https://msdn.microsoft.com/en-us/library/dn771551.aspx
I have managed to get mine working great as of about 5 minutes ago using this. One point to make, in visual studio (2003 + CTP3.1) make sure you select iOS (to the right of the build mode drop down), if you don't select iOS then the iOS specific devices will not appear in the run list - sounds trivial, but it took me a few seconds scratching my head why I couldn't deploy to iOS remotely when I had Android build selected
Hope that helps you out!

Validation Error in APS 2.0 Package "Upsell Demo Project" on Sandbox

After i figured out how to build the Demo Project "Upsell Management" (project), i'm struggling now with the installation in the sandbox.
I'm running a sandbox with POA 5.5-5562_update06-824 and every time i try to install it i get a Status "Validation Error":
http://i.imgur.com/2v6GEJc.png
So, is there a log file or anything to find out what is the error behind that?
'Validation error' means that package import task has failed, more details on this can be found in Operations->Tasks
If you see a validation error that you did not see while running apsbuild/apslint tool this means that either you or POA have an older version of apstools.
The best way is redeploy sandbox to latest POA version and update APS tools on your build machine (http://doc.apsstandard.org/2.1/tools/cli-tools/#cli-tools)

MS Deploy & IIS6 - 401 Unauthorised Error

I'm trying to get TFS to automatically publish (not package at the moment) my web app on a build to a Win2k3 server with IIS6. The remote agent service is started.
The build fails giving me a 401. I'm now trying to manually run a cmd line from the build server itself (just incase the MSBUILD was doing something strange with the params set on the build definition) and it's giving me the same thing. Here is the command I'm trying to run:
msdeploy.exe
-source:contentPath='C:\Builds\1\Test\DummyTFSWebApp Submission Build\Binaries\_PublishedWebsites\DummyTFSWebApp'
-dest:contentPath='Default Web Site',
computerName='http://ipm-vm-dev/MSDEPLOYAGENTSERVICE',
userName='Domain\AdminUser',
password='Password',
authType='basic',
includeAcls='False'
-verb:sync -allowuntrusted
But like the build report, it's giving me:
I can't understand why! The username & password provided is an Administrator on the destination machine. I've even made the build server machine and admin (clutching at straws), and I've made the destination folder a share for everyone with write permission.
Help appreciated as this is really frustrating me!
I changed the authType='NTLM' and it now works!
/p:AuthType=NTLM

Resources