huserben / TfsExtensions

Extensions for TFS 2015+ such as custom Widgets (require TFS 2017) and Build Tasks
MIT License
45 stars 22 forks source link

Build not triggered #41

Closed dhanashivam closed 6 years ago

dhanashivam commented 6 years ago

When queue the primary build definition, the child build is not triggered. no error messages too.

Using current Team Project Url Path to Server: *** Using OAuth Access Token Will trigger build with following parameters: \"\" : \"5.27.0\",\"**\" : \"0054\"

after this message primary build completed without starting the child one.

huserben commented 6 years ago

Hi @dhanashivam

can you please provide me the complete log? It looks like the build parameters are really strange, what did you set there in the configuration?

dhanashivam commented 6 years ago

Hi,

Thanks for the reply. Herewith I have attached the details in a word document.

Please help me to sort out the issue.

Thanks, Dhanasekaran G

On Fri, Dec 15, 2017 at 7:41 AM, Benj Huser notifications@github.com wrote:

Hi @dhanashivam https://github.com/dhanashivam

can you please provide me the complete log? It looks like the build parameters are really strange, what did you set there in the configuration?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/huserben/TfsExtensions/issues/41#issuecomment-352008310, or mute the thread https://github.com/notifications/unsubscribe-auth/Ag9OSDN3wTgIOIvxes5BVCHjgkLhkLnMks5tAnb4gaJpZM4RC0V5 .

-- Thanks & Regards, Dhanasekaran G Tel: 562-506-8678

huserben commented 6 years ago

Hi I'm sorry but I cannot see any attachement. Am I just not looking in the right place or did it not upload correctly?

dhanashivam commented 6 years ago

TFS Build Details.docx

huserben commented 6 years ago

I see you're trying to use the system accesstoken for Authentication (hint: you can as well just leave the "password" field empty when using OAuth and it will fetch the OAuth Token automatically). Anyway have you made sure that the build definition is allowed to access the token? It's enablable in the "Allow scripts to access OAuth token" setting in the Options tab of the build definition.

If this is already enabled, can you trigger a build with system.debug set to true so we would get a bit more output in the logs?

dhanashivam commented 6 years ago

set debug = true. "Allow scripts...." is already enabled. below is the log. log_details.docx

huserben commented 6 years ago

Can you try to check "Ignore SSL Certificate Errors" in the basic configuration and see if it works?

dhanashivam commented 6 years ago

i checked "Ignore SSL Certificate errors", but gets new error. i tried both the $(SystemAccessToken) and blank in authentication.

Using current Team Project Url Path to Server: https://ced-tx-tfs-app2.systems.ced.local/Enterprise%20Projects/Apps Using OAuth Access Token Will trigger build with following parameters: \"VersionNo\" : \"5.27.0\",\"BuildNo\" : \"0054\" Authentication failed - please make sure your settings are correct. If you use the OAuth Token, make sure you enabled the access to it on the Build Definition. If you use a Personal Access Token, make sure it did not expire. If you use Basic Authentication, make sure alternate credentials are enabled on your TFS/VSTS. task result: Succeeded Processed: ##vso[task.complete result=Succeeded;]Authentication with TFS Server failed. Please check your settings.

huserben commented 6 years ago

ok, so at least I know i have to improve the logging and fail the task if the SSL certificate is not ok. Do you know which version of the task you are currently using?

Could you once try to use a Personal Access Token instead of the OAuth, to see if there is a problem with OAuth authentication or authentication in general.

dhanashivam commented 6 years ago

i'm using 2.0 version. Just i created a personal access token and tried with that. But still not working.

Using current Team Project Url Path to Server: https://ced-tx-tfs-app2.systems.ced.local/Enterprise%20Projects/Apps Using Personal Access Token Will trigger build with following parameters: \"VersionNo\" : \"5.27.0\",\"BuildNo\" : \"0054\" Authentication failed - please make sure your settings are correct. If you use the OAuth Token, make sure you enabled the access to it on the Build Definition. If you use a Personal Access Token, make sure it did not expire. If you use Basic Authentication, make sure alternate credentials are enabled on your TFS/VSTS.

huserben commented 6 years ago

alright, would it be possible for you to update the task to the latest version? otherwise it might be a problem that's already fixed with a newer version

huserben commented 6 years ago

Hi @dhanashivam

I haven't heard from you in a while. Were you able to update the Task to the newest version? Or is there something else I can do to help?

dhanashivam commented 6 years ago

Hi I have not yet updated to the latest version. Can you send a link for the latest version?

huserben commented 6 years ago

If you need the vsix file, you can find every release here in github: https://github.com/huserben/TfsExtensions/tree/master/BuildTasks/Releases

dhanashivam commented 6 years ago

Hi, sorry for the late reply. I have upgraded to 2.4.5 version but still its not working

ErrorLog.docx

huserben commented 6 years ago

Hi can you set following properties: ignoreSslCertificateErrors = true (as we have a certificate error according to the logs) useSameBranch = false (as you use TfsVersionControl, I think i will not work with this setting, this might be only possible when using git as underlying source control system)

dhanashivam commented 6 years ago

ScreenShots.docx

Herewith I have attached the screenshots of my build definition. Do I have to make any change with Repository?

huserben commented 6 years ago

Please disable "use same source branch as triggered build" and try again

huserben commented 6 years ago

HI @dhanashivam

any update on your issue? You managed to solve it?

Kyle-Gray commented 6 years ago

Hey @huserben I am having the same problems as @dhanashivam. I have updated to version 2 and followed all the steps above but I am also getting the same error. Have there been any updates?

I have allowed scripts for Oauth tokens, the password for Oauth is blank, I have tried turning SSL certificates on/off, I even had the admin try using his basic authentication without any luck.

huserben commented 6 years ago

Hi @Kyle-Gray

could you provide me the log file of the Build Task so I can have a detailed look once again? :-)

Kyle-Gray commented 6 years ago

Thanks for the super quick response! You will have to forgive me I am new to all of this... is this what you need? buildlog.docx

huserben commented 6 years ago

Yes, that's what I need. So I can see that you want to trigger a build that is located on a different TFS/VSTS project, is this correct? If so, the OAuth Token will not work as this provides the access to the current instance that runs the build. To access the other instance you will need Basic Authentication or the Personal Access Token. (Note to self: update the documentation for that use case)

Do you have admin access for the VSTS on which the build is located that you want to trigger? If so I would recommend creating a Personal Access Token that has access to the Build Scope and try with this one.

Kyle-Gray commented 6 years ago

Yes, you are correct I am trying to trigger a build on a different teams project. I will look into authenticating with a Personal Access Token. Thanks again for your help, I will keep you updated.

huserben commented 6 years ago

No problem, if you need further assitance let me know. If you make the changes and its still not working let me know as well and ideally provide me the logs again.

Kyle-Gray commented 6 years ago

@huserben I do have build admin access to both the current project and for the project that the build is being triggered for. I created my PAT Token and changed the settings but i still am failing authentication. Here are the logs with my PAT Token hidden... buildlog.docx

Kyle-Gray commented 6 years ago

Okay update time. I got it to work!!! thanks for your help. I still do not know the cause of the authentication failures but instead of running build A to trigger build B, I am running build B to trigger A. Same exact PAT token but for some reason this works. If you want to continue to look into this report I can continue testing and sending logs. I will check back tomorrow. Thanks again for your help and quick responses!

dhanashivam commented 6 years ago

error.docx Hi, sorry for the late reply, Still I am not able to succeed the build. here with I have attached the details. pls let me know how to sort it out.

Kyle-Gray commented 6 years ago

@dhanashivam I am not an expert on this but it seems my problem was similar to yours. I think it had to do with the space in the URL to the other project. Hopefully @huserben can shed some more light on this, but once I started to trigger builds in a project with a space in the name it worked flawlessly.

huserben commented 6 years ago

Hi @Kyle-Gray ok good that you managed to solve it. When you "reverted" and used B to trigger A you said you reused the same PAT. Does this mean both your team project are on the same TFS but in a different project?

Interesting thought about the space in the URL. I can verify if this had an impact.

@dhanashivam : Can you check once with unchecking "use same source branch"?

huserben commented 6 years ago

I cross-checked to make sure, but in my series of "test builds" I trigger to verify functionality I included one that triggers a build from a different project that includes a space: grafik

However what I saw was that both of specified an URL with escaped spaces (%20). You definetly don't need to do that as you can from the logs in my screenshot. It could be that this is causing the issue for you both. Edit: Indeed the mystery has been solved - when I change the space in the url I get the same error

grafik

I will look into the possibility to automatically handle this as part of the task. If not at least I will properly document this. But the issue should be resolved for you both by removing the %20 with a regular space :-)

Thank you both very much for the provided feedback so we can keep on improving the task and make sure that other people not gonna have the same problems. 👍

Kyle-Gray commented 6 years ago

👍

huserben commented 6 years ago

Version 2.5.2 is now uploaded.

I would be happy if you both could verify it's working as expected and give me feedback so i can either close the issue or continue looking for the problem and an appropriate fix. @dhanashivam: with this fix it should work now for you without a configuration change as soon as you update the Task (if using VSTS this should happen automatically).

Kyle-Gray commented 6 years ago

@huserben Sorry for the late reply. I just triggered a build with the space in the project name. Thanks for all your help and fixing this so quickly. Have a great day!

huserben commented 6 years ago

ok very good. Thanks for your feedback and investigation into the issue.

@dhanashivam How about you. Is this problem for you solved as well with the newest version?

huserben commented 6 years ago

I'll close this issue now, please reopen it @dhanashivam if you still have an issue.