Teamcity fails to fetch files from Azure Devops - azure-devops

I am very new to the TeamCity and want to learn auto build and deploy applications from online TFS. My project has windows and web apps developed in .NET only.
I have no code on my machine and directly using online TFS as source.
VCS Root setting works fine and connection gets successful.
In the Build Step, I am using Build as the first step using MSBuild. When I click on RUN it starts the process and shows the first step as UPDATING SOURCES. In the code checkout directory, it creates only directories and there is no even single source code file though I can see all code files in TFS online. After this step it shows error:
Failed to start MSBuild.exe. Failed to find project file at path:
C:\TeamCity\buildAgent\work\740b9db587af8795\ProjectName.sln
ProjectName.sln file exists in TFS at https://ProjectName.visualstudio.com/DefaultCollection/$/Main/MainBranch
I am not getting what things I am missing. I googled much about but I wasn't able to get what is missing here. What extra steps I need to do to get this working.
Appreciate your help.
FI: Teamcity Version 2018.1.3 (build 58658). Teamcity server and build agent are on the same machine: Win 10.
Edited:
Below is screenshot with the RUN process.
Teamcity-Activities.log
[2019-01-07 19:44:23,906] INFO - s.buildServer.ACTIVITIES.AUDIT - build_type_edit_settings: "MLD / Main {id=Mld_Main, internal id=bt2}" build configuration settings were edited ("version before: 45, version after: 46") by "'admin'(AB) {id=1}" with comment "runners of 'Main' build configuration were updated"
[2019-01-07 19:44:34,460] INFO - s.buildServer.ACTIVITIES.AUDIT - build_add_to_queue: Build BUILD_PROMOTION{id=52} was added to queue by "'admin'(AB) {id=1}"
[2019-01-07 19:44:34,466] INFO - tbrains.buildServer.ACTIVITIES - Build added to queue; Queued build {Build promotion {promotion id=52, configuration={id=Mld_Main, internal id=bt2}, queued}, triggered by "'admin'(AB) {id=1}" (##userId='1' type='user')}
[2019-01-07 19:44:34,539] INFO - tbrains.buildServer.ACTIVITIES - Build started; MLD / Main {id=Mld_Main, internal id=bt2} #25 {promotion id=52, agent="Agent-Name" {id=1}, triggered by "'admin'(AB) {id=1}" (##userId='1' type='user'). Started 2019-01-07 19:44:34.514, running}
[2019-01-07 19:55:38,847] INFO - tbrains.buildServer.ACTIVITIES - Finished build MLD / Main {id=Mld_Main, internal id=bt2} #25 {promotion id=52, agent="Agent-Name" {id=1}, triggered by "'admin'(AB) {id=1}" (##userId='1' type='user'). Started 2019-01-07 19:44:41.748, finished. Status "FAILURE 'Cannot start build runner; exit code -42 (Step: Build (MSBuild))'"}
Teamcity-tfs.log
[2019-01-07 19:42:03,434] INFO - .vcs.tfs.java.TfsJavaWebRunner - Starting TFS out of process application
[2019-01-07 19:42:03,439] INFO - .vcs.tfs.java.TfsJavaWebRunner - TFS out of process application has been started
[2019-01-07 19:42:08,312] INFO - .vcs.tfs.java.TfsJavaWebRunner - Web server started at http://localhost:64729/api/commands
[2019-01-07 19:42:08,312] INFO - gers.vcs.tfs.TfsTimeoutWatcher - TFS out of process app idle timer has started
[2019-01-07 19:42:25,586] INFO - .vcs.tfs.java.TfsJavaWebRunner - TFS java web command has finished: TestConnection $/Main/Feature -s="https://ProjectName.visualstudio.com/" -p="*******", completed in 22.140 second(s)
[2019-01-07 19:43:00,661] INFO - .vcs.tfs.java.TfsJavaWebRunner - TFS java web command has finished: GetCurrentVersion $/Main/Feature -s="https://ProjectName.visualstudio.com/" -p="*******", completed in 1.607 second(s)
[2019-01-07 19:44:35,894] INFO - .vcs.tfs.java.TfsJavaWebRunner - TFS java web command has finished: GetCurrentVersion $/Main/Feature 31529 -s="https://ProjectName.visualstudio.com/" -p="*******", completed in 1.293 second(s)

Finally got the issue issue resolved!
The token generated for the TFVC access was not having sufficient permissions. Changed the access token to have Full Access and it started working and I can see all code files in the checkout directory. Thanks jesse for your comments.

Related

How to build azure pipeline tasks from https://github.com/microsoft/azure-pipelines-tasks locally and consume them in an on-prem Azure DevOps Server?

So I cloned their repository, but how do I actually build the tasks?
Here is my scenario. We use Azure DevOps Server 2020 (on prem). All of our build pipelines run the Index Sources & Publish Symbols task
However, it has a bug https://github.com/microsoft/azure-pipelines-tasks/issues/14852. Luckily a fix was merged to master. However, we are not going to see it until it is propagated to the Azure DevOps Server edition and only All Mighty knows when it would happen.
So, I would like to build that task locally and upload to our Azure DevOps server. But I cannot find instructions on how to do it.
So, how can I build and consume it in our Azure DevOps Server?
EDIT 1
Tried to follow the procedure in https://github.com/microsoft/azure-pipelines-tasks/blob/master/ci/build-all-steps.yml, but it did not work.
The first step that seems relevant to me is https://github.com/microsoft/azure-pipelines-tasks/blob/6ab084f52e582370880127132d1c449634c9bfbc/ci/build-all-steps.yml#L39:
- script: |
cd ci
cd verifyMinAgentDemands
npm install
node index.js
displayName: Verify all min agent demands are valid
And it is fine:
C:\work\azure-pipelines-tasks\ci\verifyMinAgentDemands [master ≡]> npm install
npm WARN verifyminagentdemands#1.0.0 No description
npm WARN verifyminagentdemands#1.0.0 No repository field.
added 52 packages from 78 contributors and audited 52 packages in 1.743s
found 2 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
C:\work\azure-pipelines-tasks\ci\verifyMinAgentDemands [master ≡]> node .\index.js
##vso[task.debug]agent.TempDirectory=undefined
##vso[task.debug]agent.workFolder=undefined
##vso[task.debug]loading inputs and endpoints
##vso[task.debug]loaded 0
##vso[task.debug]Agent.ProxyUrl=undefined
##vso[task.debug]Agent.CAInfo=undefined
##vso[task.debug]Agent.ClientCert=undefined
##vso[task.debug]Agent.SkipCertValidation=undefined
Verifying min agent demands.
Latest version of the Agent that's fully rolled out is 2.195.0.
The next step (https://github.com/microsoft/azure-pipelines-tasks/blob/6ab084f52e582370880127132d1c449634c9bfbc/ci/build-all-steps.yml#L47) seems to be relevant too:
- script: node make.js build --task "$(task_pattern)"
displayName: Build
condition: ne(variables['numTasks'], 0)
But:
C:\work\azure-pipelines-tasks [master ≡]> node make.js build --task PublishSymbolsV2
> prepending PATH C:\work\azure-pipelines-tasks\node_modules\.bin
tsc tool:
Version 2.3.4
C:\work\azure-pipelines-tasks\node_modules\.bin\tsc
npm tool:
6.14.12
C:\Program Files\nodejs\npm
------------------------------------------------------------
Building: PublishSymbolsV2
------------------------------------------------------------
> getting task externals
Downloading file: https://vstsagenttools.blob.core.windows.net/tools/symstore/2/symbol.zip
Could not use "nc", falling back to slower node.js method for sync requests.
C:\work\azure-pipelines-tasks\node_modules\sync-request\index.js:77
throw new Error(res.stderr.toString());
^
Error
at doRequestWith (C:\work\azure-pipelines-tasks\node_modules\sync-request\index.js:77:11)
at doRequest (C:\work\azure-pipelines-tasks\node_modules\sync-request\index.js:20:10)
at downloadFile (C:\work\azure-pipelines-tasks\make-util.js:411:22)
at downloadArchive (C:\work\azure-pipelines-tasks\make-util.js:451:27)
at C:\work\azure-pipelines-tasks\make-util.js:644:33
at Array.forEach (<anonymous>)
at getExternals (C:\work\azure-pipelines-tasks\make-util.js:639:25)
at C:\work\azure-pipelines-tasks\make.js:193:13
at Array.forEach (<anonymous>)
at Function.target.build (C:\work\azure-pipelines-tasks\make.js:158:14)
C:\work\azure-pipelines-tasks [master ≡]>
What is now?

rundeck :how to correct the configuration of rundeck to access via the browser

i have problem accessing rundeck
[2021-05-03T17:33:33,231] WARN beans.GenericTypeAwarePropertyDescriptor - Invalid JavaBean property 'exceptionMappings' being accessed! Ambiguous write methods found next to actually used [public void grails.plugin.springsecurity.web.authentication.AjaxAwareAuthenticationFailureHandler.setExceptionMappings(java.util.List)]: [public void org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler.setExceptionMappings(java.util.Map)]
[2021-05-03T17:33:41,756] INFO rundeckapp.BootStrap - Starting Rundeck 3.3.10-20210301 (2021-03-02) ...
[2021-05-03T17:33:41,757] INFO rundeckapp.BootStrap - using rdeck.base config property: /var/lib/rundeck
[2021-05-03T17:33:41,768] INFO rundeckapp.BootStrap - loaded configuration: /etc/rundeck/framework.properties
[2021-05-03T17:33:41,805] INFO rundeckapp.BootStrap - RSS feeds disabled
[2021-05-03T17:33:41,806] INFO rundeckapp.BootStrap - Using jaas authentication
[2021-05-03T17:33:41,811] INFO rundeckapp.BootStrap - Preauthentication is disabled
[2021-05-03T17:33:41,918] INFO rundeckapp.BootStrap - Rundeck is ACTIVE: executions can be run.
[2021-05-03T17:33:42,283] WARN rundeckapp.BootStrap - [Development Mode] Usage of H2 database is recommended only for development and testing
[2021-05-03T17:33:42,590] INFO rundeckapp.BootStrap - Rundeck startup finished in 945ms
[2021-05-03T17:33:42,877] INFO rundeckapp.Application - Started Application in 32.801 seconds (JVM running for 35.608)
Grails application running at http://xxx.xxx.xxx.xxx:4440 in environment: production
Session terminated, killing shell...[2021-05-04T10:20:46,596] INFO rundeckapp.BootStrap - Rundeck Shutdown detected
...killed.
can you help me please
by the way I have installed a vm under redhat
then I installed rundeck RPM
and from my physical machine when I do http: // rundecknode_ip: 4440
it returns me on the browser error 113 no route to host and on examination of the logs I have what I have posted above
when i do systemctl status rundeck it is active running

Rundeck and Hipchat Plugin

I am configuring Rundeck in my work and I want to receive all notifications from jobs via Hipchat. I have found this plugin: https://github.com/hbakkum/rundeck-hipchat-plugin
I copied .jar file in Rundeck libext directory and now I see Hipchat option in Job notification. Despite the fact that I wrote the room ID and I get a token to allow Rundeck sends notifications to this room, nothing happens..
I saw this topic: https://github.com/rundeck/rundeck/issues/764
Also I am getting this logs:
2018-01-31 15:15:12,122 [quartzScheduler_Worker-3] INFO grails.app.services.rundeck.services.ExecutionUtilService - Execution successful: 13 in project proyecto_prueba
2018-01-31 15:15:12,501 [quartzScheduler_Worker-3] INFO grails.app.services.rundeck.services.ExecutionService - updated scheduled Execution
2018-01-31 15:15:31,088 [quartzScheduler_Worker-4] ERROR grails.app.services.rundeck.services.PluginService - Notification: configuration was not valid for plugin 'HipChatNotification': apiAuthToken: required
is Hipchat plugin working wrong because last update was in 2016 or Am I configuring something wrong?
Thanks beforehand.
Regards,
Mike.
I found the issue. Hipchat API Token has to have next scopes: Send notification y View Room. With these scopes, I have to specify next lines in Rundeck config files:
configure framework:
framework.plugin.Notification.HipChatNotification.apiVersion=v2
framework.plugin.Notification.HipChatNotification.apiAuthToken=value
configure project:
project.plugin.Notification.HipChatNotification.apiVersion=v2
project.plugin.Notification.HipChatNotification.apiAuthToken=value

jenkins gradle sonar -> github comments

I'd like to have sonar comments on github pull requests. For that I set up a jenkins job which runs ./gradlew clean sonarRunner [properties].
I read through this:
jenkins + sonar + github integration
My setup is similar, I don't start sonar with maven but with gradle.
I use the following properties:
-Dsonar.github.login=
-Dsonar.github.repository=company/repo
-Dsonar.analysis.mode=preview
-Dsonar.issuesReport.console.enable=true
-Dsonar.github.login=gitusername
-Dsonar.github.oauth=token
As described here:
http://docs.sonarqube.org/display/PLUG/GitHub+Plugin
The end of the log on jenkins is:
11:06:02.167 INFO - Sensor GitHub Plugin InputFile Cache
11:06:02.167 INFO - Sensor GitHub Plugin InputFile Cache (done) | time=0ms
11:06:02.168 INFO - Load server issues
11:06:02.532 INFO -
------------- Issues Report -------------
+620 issues
+2 blocking
+43 critical
+402 major
+169 minor
+4 info
11:06:02.532 INFO - Export issues to
/jenkins/workspace/scheduling-sonar-pull-request/jdk/JDK8/label/Linux/build/sonar/sonar-report.json
11:06:02.611 INFO - ANALYSIS SUCCESSFUL
INFO: EXECUTION SUCCESS INFO:
Total time: 20.198s Final Memory: 26M/742M INFO:
BUILD SUCCESSFUL
But there are no comments appearing on github.
In order to debug changed the oauth token, which gave:
ERROR: Caused by: Unable to perform GitHub WS operation
ERROR: Caused by: Server returned HTTP response code: 401 for URL:
Why are no comments appearing on github? The github plugin is installed on sonarqube, jenkins triggers the sonarRunner, the PR id is correct (tried it hard-coded), the PR has a lot of files, a wrong oauth token gives an error.

Selenium looping through jenkins and permission denied in cli

After struggling to get proper testsuites, I'm now pretty disappointed by the fact that , while following as close as possible this tutorial (pretty straightforward, right ?) Setting up Selenium server on a headless Jenkins CI build machine, Jenkins keeps looping on the current build, outputting :
So I decided to run a selenium build by hand on the ci machine, and got this :
user#machine:/var/log$ export DISPLAY=":99" && java -jar /var/lib/selenium/selenium- server.jar -browserSessionReuse -htmlSuite *firefox http://staging.site.com /var/lib/jenkins/jobs/project/workspace/tests/selenium/testsuite.html /var/lib/jenkins/jobs/project/workspace/logs/selenium.html
24 janv. 2012 19:27:56 org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
19:27:59.927 INFO - Java: Sun Microsystems Inc. 20.0-b11
19:27:59.929 INFO - OS: Linux 3.0.0-14-generic amd64
19:27:59.951 INFO - v2.17.0, with Core v2.17.0. Built from revision 15540
19:27:59.958 INFO - Will recycle browser sessions when possible.
19:28:00.143 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
19:28:00.144 INFO - Version Jetty/5.1.x
19:28:00.145 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
19:28:00.147 INFO - Started HttpContext[/selenium-server,/selenium-server]
19:28:00.147 INFO - Started HttpContext[/,/]
19:28:00.183 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#16ba8602
19:28:00.184 INFO - Started HttpContext[/wd,/wd]
19:28:00.199 INFO - Started SocketListener on 0.0.0.0:4444
19:28:00.199 INFO - Started org.openqa.jetty.jetty.Server#6f7a29a1
HTML suite exception seen:
java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:900)
at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:603)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:287)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:245)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:54)
19:28:00.218 INFO - Shutting down...
19:28:00.220 INFO - Stopping Acceptor ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=4444]
While understanding the output is'nt that hard, finding what to do to remove this issue is.
Any chance you guys already have been facing that kind of stuff ? Thanks
I only just got past these problems myself, but I was able to run your command when I pointed it at my .jar, testSuite and report file. I'm thinking that perhaps the location of your files under,
/var/lib/selenium
could be part of the problem. Try putting them where your user has permission perhaps under
/home/USERNAME/selenium
Other than that the only thing I can say is make sure your .jar, testSuite and report file are valid.
Also (I assume this is an error of copy and paste into stack overflow) but, this part of your command is incorrect
/var/lib/selenium/selenium- server.jar
You are not getting the error I would expect from an incorrect jar location so I assume something was lost when you pasted to stackoverflow.