VS 2013 Release Management - Illegal characters in path - tfs

I have build a custom deployment Action based on TFS 2010 command-line utility, TF.exe. When executed from a DOS prompt on the deployment agent server, it runs fine.
TF view /collection:uri "$source path" > "local path"
and the file does get downloaded, without a need of a workspace. However, when executed through VS2013RM, I get an error:
Illegal characters in path.
When I hover over the message column it reads:
The installation command \"my correct command line here\" failed with the exit code \"100\"
What gives? How come it executes fine in one place, but not the other? The RM Client runs under a network service account, which is part of the local admins and collection's service accounts.
After enabling log
I was able to capture this command:
Deployment: **********Installing component using command "C:\DevOps\TfsClient\TF.exe view /collection:http://[removed detail] "$/[removed detail]/MetastoreCS.xml" > "F:\[removed detail]\MetastoreCS.xml""
Than the error
9/24/2014 10:58:10 AM - Information - (12628, 26560) - Deployment: Exception The installation command \"C:\DevOps\TfsClient\TF.exe view /collection:http://[removed detail] "$/[removed detail]/MetastoreCS.xml" > "F:\[removed detail]\MetastoreCS.xml"\" failed with the exit code \"100\".

It seems like the redirecting character '>' is causing issue.
I was able to make it work using the /output option. Refer to the tf view documentation.
C:\DevOps\TfsClient\TF.exe view /collection:http://[removed detail] "$/[removed detail]/MetastoreCS.xml" /output:"F:\[removed detail]\MetastoreCS.xml"

Related

Using signtool.exe through Jenkins

I am using an EV Code Token USB for this process.
I've got this .bat which signs an .exe with the help of signtool.exe
The bat works fine when i call it locally from cmd. It first calls an Autohotkey script (that is looking for the Windows Security window that is triggered by the signtool.exe (where you have to enter the PIN in order to successfully sign the .exe), starts the signtool process, the pin is entered automatically and all's good.
I'm trying to call the same .bat with the help of Jenkins, but no matter what I do, I keep getting this error
Error information: "Error: SignerSign() failed." (-2147023892/0x800703ec)
SignTool Error: An unexpected internal error has occurred.
The error means invalid flags but I literally do not know what that means.
The signing command line looks like this:
signtool.exe sign /tr http://timestamp.globalsign.com/?signature=sha2 /td SHA256 /sha1 [thumbprint] .exe
It doesn't change a thing if I run just the above command in Jenkins' "execute windows batch command" build step.
How could I get past this?

Premake, command line options don't do anything

I have the following section in my lua script:
newoption {
trigger = "build-tests",
description = "Build tests."
}
configuration "build-tests"
print("bbbbbbbbb")
include("Src/tests/tests.lua")
configuration "not build-tests"
print("aaaaaaaaaaa")
running premake5 gmake --help gives:
Usage: premake5 [options] action [arguments]
OPTIONS - General
--build-benchmarks Build benchmarks.
--build-tests Build tests.
--debugger Start MobDebug remote debugger. Works with ZeroBrane Studio
--fatal Treat warnings from project scripts as errors
--file=FILE Read FILE as a Premake script; default is 'premake5.lua'
--help Display this information
However running premake5 --build-tests gmake outputs:
bbbbbbbbb
aaaaaaaaaaa
Building configurations...
Running action 'gmake'...
Done (362ms).
BOTH versions are running, I don't understand. I am trying to get a toggle to select whether I want to build tests or not.
configuration() is a function, not an if-then. Your example above is equivalent to...
configuration("build-tests")
print("bbbbbbbbb")
include("Src/tests/tests.lua")
configuration("not build-tests")
print("aaaaaaaaaaa")
It has no effect on which code runs or does not run in your script; all the code in your script is always run, and then the configuration conditions are evaluated later.
Instead look at the actual generated project output to see if things are working or not.

Error when attempting to run UI automation script from jenkins

I am using Xcode 6.1. And i need to run a UI automation script from jenkins as a post build action. The command that i use is shown below.
instruments -t $TRACETEMPLATE -w $DEVICE $APP_PATH -e UIASCRIPT $SCRIPT -e UIARESULTSPATH $RESULTS_PATH | grep "<" > test-reports/test-results.xml
When i run that the following error is thrown by jenkins.
Failed to authorize rights (0x1) with status: -60007.
2014-11-12 16:31:30.685 instruments[488:2607] -[XRSimulatorDevice prepareConnection:]: Unable to authorize simulated daemon (99637): 8
Instruments Trace Error : Target failed to run: Permission to debug com.test.app was denied.
Any help is much appreciated.
The user that invokes Instruments must have developer permissions. The user must be in the _developer group.
Security permissions allowing the user to access Instruments must be set. See the man page for DevToolsSecurity
The user must be logged in to a window server to use the simulator. How to do this will depend somewhat on your Jenkins and OS configuration for that user. In older versions of MacOS creating an SSH connection back into the machine and running Instruments through that connection typically worked. YMMV.
Note that any of the above steps escalates the rights for the Jenkins user, which was security implications.
I got an almost identical error message to yours, and it seemed to be because when Jenkins is launched as a Launch Daemon, it doesn't have access to the screen, even if you log in as "jenkins".
I found the solution from reading this discussion: https://issues.jenkins-ci.org/browse/JENKINS-14421
You can either launch Jenkins from Terminal with java -jar jenkins.war, or you can create a Launch Agent, which runs as the logged-in user and has access to the user's screen.
I achieved the latter solution by moving /Library/LaunchDaemons/org.jenkins-ci.plist to /Library/LaunchAgents/org.jenkins-ci.plist and removing the UserName key and value from the plist. Now Jenkins doesn't start automatically when I boot the machine, but it does start when I log into the desktop, which is required for running UI Automation tests anyway.
It appears that Jenkins still can't actually launch the Simulator app, but if Simulator is already running, the UI Automation scripts proceed just fine.
I also got this error message. Moving service from LaunchDaemons to LaunchAgents didn't solve the problem. My solution was as following:
remove the service by deleting /Library/LaunchAgents/org.jenkins-ci.plist file
create an iOS application using Automator tool. (Which I think exists by default):
I chose "Library" -> "Utilities" -> "Shell Script".
Enter the content of /Library/Application Support/Jenkins/jenkins-runner.sh.
Put export JENKINS_HOME=/path/to/jenkins at the top.
Save the app somewhere
Go to Preferences -> Users & Groups -> choose your user -> Add the saved app.
This way, jenkins is run as an application after login and it has all the privilages of any other application.

Jenkins creating a view in ClearCase

I'm working on an automatic build using Jenkins and ClearCase and I have a problem.
I wrote a batch script to create a view in ClearCase using the cleartool command mkview.
When I execute the script by clicking on it, everything works, the view is created in ClearCase. But when I launch the script via Jenkins, I have the following errors :
C:\Program Files\Jenkins\workspace\JenkinsLecon1>
"C:\Program Files\IBM\RationalSDLC\ClearCase\bin\cleartool.exe"
mkview -sna -tag AUTOBUILD_VIEW_TEST1_CFW_INFRA_V5.10_Dev -str CFW_INFRA_V5.10_Dev#\projects -host sasla15001 -hpath d:\ClearCase_Storage\views\DOM3\268875\ -gpath \\sasla15001\ccstg_d\views\DOM3\268875\ CFW_INFRA_V5.10_Dev
Selected Server Storage Location "sasla15001_ccstg_d_views".
cleartool: Error: unable to set access control list for \\sasla15001\ccstg_d\views\AUTORITE+NT\SYSTEM\CFW_INFRA_V5.10_Dev.22.vws: Accès refusé.
cleartool: Error: protection on \\sasla15001\ccstg_d\views\AUTORITE+NT\SYSTEM\CFW_INFRA_V5.10_Dev.22.vws is out-of-synch with identity.sd and groups.sd
cleartool: Error: Failed to set identity on view: Permission denied
cleartool: Error: unable to set access control list for \\sasla15001\ccstg_d\views\AUTORITE+NT\SYSTEM\CFW_INFRA_V5.10_Dev.22.vws: Accès refusé.
cleartool: Error: \\sasla15001\ccstg_d\views\AUTORITE+NT\SYSTEM\CFW_INFRA_V5.10_Dev.22.vws:
Permission denied
cleartool: Error: Unable to create view "\\sasla15001\ccstg_d\views\AUTORITE+NT\SYSTEM\CFW_INFRA_V5.10_Dev.22.vws".
I pretty sure that the error come from an access right problem.
But I did not find an mkview option like -user or something like that to user my clearcase user account.
I hop that someone had the same problem and solve it or just someone who can help me!
For those who have the same problem, the solution is start Jenkins as administrator.
To do this :
1) open a prompt command as administrator
start/accessories/
Then right click on prompt command and choose start as
2) go to Jenkins directory
cd /D C:\Program Files\Jenkins
3) start Jenkins Server
java -jar jenkins.war --httpPort=8081 not 8080
wait until the sever is running this line will appear INFO:Jenkins is fully up and running
now the Jenkins server is running as administrator
4)open your web browser and go to
http ://localhost:8081
5) create your job!!!
to know where is the workspace just create a new batch script add the command line
cd
save and build the job. Next go to the console and just read the path
See for instance the Error: unable to set access control list for : Access is denied
The cause of this problem relates to restrictive permissions on either the view share or directory to which the view is being created.
Make sure who (i.e. which account) is executing those commands when run by Jenkins (is it the local system account?). As the OP Bastien mentions, running with elevated privileges is key.
Make also sure of the CLEARCASE_PRIMARY_GROUP environment variable value at the time of the Jenkins job.
It must be set to the group of the vob you want to access (or one of its secondary group).

Jenkins fails to execute while running as winservice

I am able to run my script successfully from jenkins when jenking is opened using war file.
If set the jenkinks as winservice my script is failing in middle.
I am trying to run a start.bat file from jenkinks, this bat file calls a java class. again this java class uses bat file to run a plink command.
Execution stops at this stepsif jenkinks is running as winservice and also I can't view the output as it is running in background.
Is there any way to make jenkinks behave normal while running as winservice
Thanks
Try this:
1. Go to services (hit windows key, type "services", select "Services" from the list of matches).
2. Find the Jenkins service and open it's properties
3. Switch to Log On tab
4. Change the service to run as you, instead of local system user.
5. Restart service.
Alternative is to fix local system user account (probably environment variables) so it works as local system user.

Resources