[TIMOB-19838] Windows: Fix Jenkins Windows SDK PR Build
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-11-03T17:27:26.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.2.0 |
Components | Windows |
Labels | n/a |
Reporter | Kota Iguchi |
Assignee | Christopher Williams |
Created | 2015-11-02T02:41:50.000+0000 |
Updated | 2016-02-16T22:37:44.000+0000 |
Description
Currently all tests in Jenkins Windows SDK PR Build are failing. Seems like they are failing when launching emulator. Do we change something recently?
12:35:24 [DEBUG] : Time Elapsed 00:00:16.29
12:35:24 [INFO] : Writing build manifest: C:\Windows\TEMP\mocha\build-manifest.json
12:35:24 [INFO] : Copying results back to project build directory
12:35:26 [INFO] : Finished building the application in 39s 280ms
12:35:26 [INFO] : Finished building the application in 39s 282ms
12:35:26 [INFO] : Waiting for Windows Phone emulator to finish booting
12:45:55 [ERROR] : Failed to start emulator "8-1-1"
12:45:55 [ERROR] : App deployment failed. Please try again.
* http://studio-jenkins.appcelerator.org/job/titanium_mobile_windows_prs/1437/
* http://studio-jenkins.appcelerator.org/job/titanium_mobile_windows_prs/1441/
* http://studio-jenkins.appcelerator.org/job/titanium_mobile_windows_prs/1440/
I _think_ this may be from running the Jenkins slave as a service, which I believe runs under Administrator rights, which may be causing some environment issues. I'll try restarting it manually under the simple user account and fix permissions issues.
I have no idea why this keeps happening! I can run from the CLI on the same box manually and it finds the emulator just fine and can launch it. I'm at a loss as to why this would happen. I tried modifying the service to start as a specific user. I fixed permissions. I stopped the service entirely and ran the slave process from cmd.exe manually through VPN/RDC. Nothing seems to work. I honestly have no idea how to get this fixed any more.
[~kota] It has been restarted. the "busy" failures were due to me being logged into the server and trying the build manually (I had a Windows Explorer open to the folder, which a subsequent build didn't like). The error message remains the default "invalid" error, not sure why. Looks like the CLi can error out about invalid values in two spots, one of which will bubble up the error given by the validation of the value, the other giving this default message. I'm playing around some more to see if I can get details why it's failing, but this is a mystery to me.
Looks like it's having trouble getting the emulator listing:
It's a permissions issue, but hell if I know where/how to fix it. If I try to run AppDeployCmd.exe /EnumerateDevices from the build script we get:
VPN/RDC in using the same account and running works fine.
This sucked to try and track down. Looks like because I initially set the Windows boxes up as slaves using a service (so I no longer had to manually log in to connect them to Jenkins), it did this as Administrator by default. Great, except it f-ed up all the permissions and npm didn't like it one bit. So I tried some hacks, but eventually changed teh service to run as the same user I'd VPN/RDC in as. Awesome. Except now we magically can't find any emulators. Except using the exact same account manually, I can. Ran ProcMon while the build failed to pick up emulators. Shows access is denied to C:\ProgramData\WowSys64\config\AppData\Local and various subfolders. WTF? Why would it be using those folders? Because Jenkins has a big bug: - https://issues.jenkins-ci.org/browse/JENKINS-27739 - https://issues.jenkins-ci.org/browse/JENKINS-28278 basically when the service connected to Jenkins master as Admin is cached all the ENV. Then when I later stopped/modified/restarted it using the correct account, IT NEVER UPDATED THE ENV VARS, thereby using the Admin HOME/USERPROFILE as the APPC/appcelerator user. Fix is to start service as APPC/appcelerator, restart Jenkins master and have a beer.
:)(y)
Closing ticket since it's a dev task.