Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkins Download artifacts task always tries to download from build 1 #4110

Closed
DieterE opened this issue Apr 24, 2017 · 5 comments
Closed

Jenkins Download artifacts task always tries to download from build 1 #4110

DieterE opened this issue Apr 24, 2017 · 5 comments
Assignees

Comments

@DieterE
Copy link

DieterE commented Apr 24, 2017

Jenkins Download artifacts always tries to download artifacts from build 1 with $(Parameters.jenkinsBuildNumber)
Output from the task:

2017-04-24T14:02:50.2251588Z ##[section]Starting: Download artifacts produced by WebDriver
2017-04-24T14:02:50.8501859Z d9a777b4-091c-45c4-afff-188e31505bcb exists true
2017-04-24T14:02:51.1158093Z <head>
2017-04-24T14:02:51.1158093Z <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
2017-04-24T14:02:51.1158093Z <title>Error 404 Not Found</title>
2017-04-24T14:02:51.1158093Z </head>
2017-04-24T14:02:51.1158093Z <body><h2>HTTP ERROR 404</h2>
2017-04-24T14:02:51.1158093Z <p>Problem accessing /jenkins/job/WebDriver/1/api/json. Reason:
2017-04-24T14:02:51.1158093Z <pre>    Not Found</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>
2017-04-24T14:02:51.1158093Z 
2017-04-24T14:02:51.1158093Z </body>
2017-04-24T14:02:51.1158093Z </html>
2017-04-24T14:02:51.1158093Z 
2017-04-24T14:02:51.1314193Z Error: HTTP call to Jenkins server failed.
2017-04-24T14:02:51.1314193Z ##[error]HTTP call to Jenkins server failed.
2017-04-24T14:02:51.1314193Z ##[section]Finishing: Download artifacts produced by WebDriver

Build 1 doesn't exist on our Jenkins server, hence the error.

I'd like to copy the artifacts from the build that was triggered by the "Jenkins Queue job" task. If the build fails then I don't want to see the previous successful build artifacts, so using "Last Successful Build" is not an option here.

@davidstaheli
Copy link
Contributor

Hi @DieterE,

Sorry for the trouble this is causing you. Very soon, the Jenkins Queue Job task will be able to pass the Jenkins build number to the Jenkins Download Artifacts task so that the two are aligned. Until then, what are your settings under Control Options for both tasks? You should be able to prevent Jenkins Download Artifacts from running if Jenkins Queue Job fails so that it doesn't download mismatched artifacts.

Here's a screenshot of Control Options from Team Services which may not match what you see if you're running TFS on-premises:

image

Thanks,
David

@DieterE
Copy link
Author

DieterE commented Apr 25, 2017

Hey @davidstaheli,

That workaround wouldn't work for us since our Jenkins server can get quite busy sometimes, so there's no guarantee that the build job started by the queue task is the job which is last successful at the time the Download artifacts task is called.

As for being able to pass the build number between the Queue and Download artifacts jobs, that would perfectly solve the issue.

Thanks for your reply, I'm happy to hear this will be resolved sometime soon.

@DieterE
Copy link
Author

DieterE commented May 12, 2017

Hello,

I have noticed that recently 'process' has been added to the build tab in VSO which allows for 'linking'. Was this the solution that was mentioned in the 2nd post?

Regards,
Dieter

@davidstaheli
Copy link
Contributor

Hi @DieterE, the "linking" is actually something different. The solution mentioned in the 2nd post is this: builds tasks now have the ability to set environment variables that live beyond the execution of a task and can be seen by other tasks. So we can have the Jenkins Queue Job task set a variable for the build number and the Jenkins Download Artifact task will have an option for using it. It's a little rudimentary, but better than how things work currently. I'm hoping we can get this done in the next few weeks. After that, we plan to take a broader look at how we can improve our Jenkins integration throughout all of TFS/VSTS.

@jpricket
Copy link
Member

jpricket commented Jan 8, 2018

The feature that David mentioned is now available. Please let us know if you continue to have issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants