huserben / TfsExtensions

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

Issue When Using Multiple Variables #103

Closed Sir-Jacques closed 5 years ago

Sir-Jacques commented 5 years ago

Hey!

I am able to fire a build with no or one variable set (in the format mentioned on the marketplace page). But when I append this variable with a ',' + another variable in the same format ("SomeName: someValue") it crashes the build saying "Could not Trigger build. See console for more Information." In the console is says "Must use title or breadcrumb items + headerItemPicker" which doesn't make any sense to me (, but maybe it does to someone else?).

Full (censored) diagnostics logs: 2018-11-21T10:35:30.0223158Z ##[debug]Evaluating condition for step: 'Trigger a new build of "Hidden Project Name"' 2018-11-21T10:35:30.0235999Z ##[debug]Evaluating: succeededOrFailed() 2018-11-21T10:35:30.0236129Z ##[debug]Evaluating succeededOrFailed: 2018-11-21T10:35:30.0246098Z ##[debug]=> True 2018-11-21T10:35:30.0261266Z ##[debug]Result: True 2018-11-21T10:35:30.0321680Z ##[section]Starting: Trigger a new build of "Hidden Project Name" 2018-11-21T10:35:30.0630276Z ============================================================================== 2018-11-21T10:35:30.0630382Z Task : Trigger Build 2018-11-21T10:35:30.0630422Z Description : This tasks allows to trigger a new Build (add it to the queue) as part of a Build Definition. It contains as well some conditions that can be applied, for example if the last build of certain definition was successful or not. 2018-11-21T10:35:30.0630516Z Version : 2.4.0 2018-11-21T10:35:30.0630555Z Author : Benjamin Huser 2018-11-21T10:35:30.0630599Z Help : 2018-11-21T10:35:30.0630676Z ============================================================================== 2018-11-21T10:35:30.2964648Z ##[debug]agent.workFolder=/home/temporal/myagent/_work 2018-11-21T10:35:30.2965739Z ##[debug]loading inputs and endpoints 2018-11-21T10:35:30.2965970Z ##[debug]loading INPUT_DEFINITIONISINCURRENTTEAMPROJECT 2018-11-21T10:35:30.2966186Z ##[debug]loading INPUT_TFSSERVER 2018-11-21T10:35:30.2966317Z ##[debug]loading INPUT_BUILDDEFINITION 2018-11-21T10:35:30.3008944Z ##[debug]loading INPUT_QUEUEBUILDFORUSERTHATTRIGGEREDBUILD 2018-11-21T10:35:30.3009167Z ##[debug]loading INPUT_IGNORESSLCERTIFICATEERRORS 2018-11-21T10:35:30.3009382Z ##[debug]loading INPUT_USESAMESOURCEVERSION 2018-11-21T10:35:30.3010055Z ##[debug]loading INPUT_USESAMEBRANCH 2018-11-21T10:35:30.3010259Z ##[debug]loading INPUT_BRANCHTOUSE 2018-11-21T10:35:30.3010390Z ##[debug]loading INPUT_WAITFORQUEUEDBUILDSTOFINISH 2018-11-21T10:35:30.3010576Z ##[debug]loading INPUT_WAITFORQUEUEDBUILDSTOFINISHREFRESHTIME 2018-11-21T10:35:30.3010764Z ##[debug]loading INPUT_FAILTASKIFBUILDSNOTSUCCESSFUL 2018-11-21T10:35:30.3010884Z ##[debug]loading INPUT_DOWNLOADBUILDARTIFACTS 2018-11-21T10:35:30.3011074Z ##[debug]loading INPUT_DROPDIRECTORY 2018-11-21T10:35:30.3011943Z ##[debug]loading INPUT_STOREINENVIRONMENTVARIABLE 2018-11-21T10:35:30.3012191Z ##[debug]loading INPUT_BUILDPARAMETERS 2018-11-21T10:35:30.3012320Z ##[debug]loading INPUT_AUTHENTICATIONMETHOD 2018-11-21T10:35:30.3012503Z ##[debug]loading INPUT_ENABLEBUILDINQUEUECONDITION 2018-11-21T10:35:30.3012643Z ##[debug]loading INPUT_INCLUDECURRENTBUILDDEFINITION 2018-11-21T10:35:30.3013053Z ##[debug]loading INPUT_DEPENDENTONSUCCESSFULBUILDCONDITION 2018-11-21T10:35:30.3013287Z ##[debug]loading INPUT_DEPENDENTONFAILEDBUILDCONDITION 2018-11-21T10:35:30.3013412Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION 2018-11-21T10:35:30.3013637Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION 2018-11-21T10:35:30.3013768Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN 2018-11-21T10:35:30.3013972Z ##[debug]loaded 23 2018-11-21T10:35:31.0881503Z ##[debug]definitionIsInCurrentTeamProject=true 2018-11-21T10:35:31.1049837Z ##[debug]tfsServer="Hidden Server URL" 2018-11-21T10:35:31.1071165Z ##[debug]buildDefinition="Hidden Project Name" 2018-11-21T10:35:31.1071703Z ##[debug]ignoreSslCertificateErrors=false 2018-11-21T10:35:31.1072141Z ##[debug]queueBuildForUserThatTriggeredBuild=true 2018-11-21T10:35:31.1072456Z ##[debug]useSameSourceVersion=false 2018-11-21T10:35:31.1072873Z ##[debug]useSameBranch=false 2018-11-21T10:35:31.1073077Z ##[debug]branchToUse="Hidden Branch Name" 2018-11-21T10:35:31.1073964Z ##[debug]waitForQueuedBuildsToFinish=true 2018-11-21T10:35:31.1074373Z ##[debug]waitForQueuedBuildsToFinishRefreshTime=60 2018-11-21T10:35:31.1074798Z ##[debug]failTaskIfBuildsNotSuccessful=false 2018-11-21T10:35:31.1075072Z ##[debug]dropDirectory=/home/temporal/myagent/_work 2018-11-21T10:35:31.1075205Z ##[debug]storeInEnvironmentVariable=false 2018-11-21T10:35:31.1075915Z ##[debug]demands=null 2018-11-21T10:35:31.1076192Z ##[debug]queueid=null 2018-11-21T10:35:31.1076312Z ##[debug]buildParameters=01VarName: 10, 02VarName: 2, 03VarName: 09 2018-11-21T10:35:31.1076975Z ##[debug]authenticationMethod=OAuth Token 2018-11-21T10:35:31.1077101Z ##[debug]username=null 2018-11-21T10:35:31.1077520Z ##[debug]password=null 2018-11-21T10:35:31.1077737Z ##[debug]enableBuildInQueueCondition=false 2018-11-21T10:35:31.1077938Z ##[debug]includeCurrentBuildDefinition=true 2018-11-21T10:35:31.1078046Z ##[debug]blockingBuildsList=null 2018-11-21T10:35:31.1078369Z ##[debug]dependentOnSuccessfulBuildCondition=false 2018-11-21T10:35:31.1078634Z ##[debug]dependentBuildsList=null 2018-11-21T10:35:31.1078894Z ##[debug]dependentOnFailedBuildCondition=false 2018-11-21T10:35:31.1079468Z ##[debug]dependentFailingBuildsList=null 2018-11-21T10:35:31.1079636Z Using current Team Project Url 2018-11-21T10:35:31.1079700Z Path to Server: "Hidden Server URL" 2018-11-21T10:35:31.1080111Z Using OAuth Access Token 2018-11-21T10:35:31.1080189Z Trying to fetch authentication token from system... 2018-11-21T10:35:31.1080501Z Build shall be triggered for same user that triggered current build: "Hidden Username" 2018-11-21T10:35:31.1080578Z Will trigger build with following parameters: VarName1: 10, VarName2: 2, VarName3: 09 2018-11-21T10:35:31.1081542Z Queue new Build for definition "Hidden Project Name" 2018-11-21T10:35:31.2826223Z TF400898: An Internal Error Occurred. Activity Id: 15d63798-5cab-4bf4-a013-255f69d98622. 2018-11-21T10:35:31.2832362Z ##[debug]task result: Failed 2018-11-21T10:35:31.2965450Z ##[error]Could not Trigger build. See console for more Information. 2018-11-21T10:35:31.2978202Z ##[debug]Processed: ##vso[task.issue type=error;]Could not Trigger build. See console for more Information. 2018-11-21T10:35:31.3000077Z ##[debug]Processed: ##vso[task.complete result=Failed;]Could not Trigger build. See console for more Information. 2018-11-21T10:35:31.3063866Z ##[section]Finishing: Trigger a new build of "Hidden Project Name"

As I couldn't find any related articles on similar issues when using multiple parameters I figured I had to create this issue here.

I truely hope you could show me where I'm making a mistake.

Thanks in advance, Jacco

huserben commented 5 years ago

Hi @Sir-Jacques

hmm I haven't seen this one before, however this seems to be some issue internally to TFS, as the message displayed seems to be the exception that happened during the request.

I tried to find a bit more info on the problem given the following message: TF400898: An Internal Error Occurred. Activity Id: 15d63798-5cab-4bf4-a013-255f69d98622 But I had no luck.

Could you tell me whether you use TFS or Azure DevOps, and if TFS which version? I cross checked the behavior in my test system and it works as expected:

grafik

When you say it works when just specifying one variable, does it work for any variable of the specified? I think it's important that they are "settable at queue time", otherwise I won't work and could be the source of the problem.

Sir-Jacques commented 5 years ago

It works for any of the 3 variables (which all start with a number in their name to prevent vsts from ordering them wrong), and they are indeed all settable at queue time. I'll have a look at the message you stated next week.

Sir-Jacques commented 5 years ago

We're running Azure DevOps, I've managed to get one build to run with some specific variables. But when I add our 2nd build with different parameters it seems to break. For now this isn't an issue (as I can use the default parameters for the 2nd build and the specific parameters for the 1st build). But I imagine our company might want to use more builds with different parameters in the future.

huserben commented 5 years ago

Hi

so ok the only a bit more special thing I can see in your configuration is the fact that they start with numbers. Do you use any other special character so that I can try to reproduce the problem myself.

I'm currently quite busy so I probably won't find the time to fix this in the near future, but being able to reproduce it would already help and allow me to make some guess about the cause and potential fix.

huserben commented 5 years ago

Hi @Sir-Jacques

First of all, sorry that it took that long for me to come back to you, but I didn't have any time the last weeks to properly look into this.

I tried now to reproduce the issue, however for me it works as expected: grafik

But there is hope: I saw from your logfile that you are using version 2.4.0, however in the meanwhile there is already version 3. available. Could you try with the newest version once? If you don't want to go to version 3 you could at least try it with the newest 2. version, however I would advise to go the 3.* version, as otherwise you won't get any updates in the future. Sorry I completly missed this when I initially looked into the issue.

Sir-Jacques commented 5 years ago

Hi @Sir-Jacques

First of all, sorry that it took that long for me to come back to you, but I didn't have any time the last weeks to properly look into this.

I tried now to reproduce the issue, however for me it works as expected: grafik

But there is hope: I saw from your logfile that you are using version 2.4.0, however in the meanwhile there is already version 3. available. Could you try with the newest version once? If you don't want to go to version 3 you could at least try it with the newest 2. version, however I would advise to go the 3.* version, as otherwise you won't get any updates in the future. Sorry I completly missed this when I initially looked into the issue.

image

I've got only one option available in this dropdown (which is 2.*). Version 3.* should be visible there right?

Kind regards, Jacco

huserben commented 5 years ago

Hi yeah, it should look like this: grafik

Can you try over the marketplace website to get the newest version?: https://marketplace.visualstudio.com/items?itemName=benjhuser.tfs-extensions-build-tasks

Sir-Jacques commented 5 years ago

Aaah,

That might be what's causing the issue, so we're running an outdated version of the plugin.

Our company doesn't allow for plugins from the marketplace to be used in the pipelines though sad face. We can only use plugins that are available from Azure DevOps by default.

For now, I think, we'll put this bug on hold, and construct some workaround later on.

Thanks for your effort anyway!

Jacco

huserben commented 5 years ago

Oh ok, but then how did the extensions get there in the first place? So my guess is that it would be solved with the newest version.

You could even work around by checking out the code here in the repo and basically just reuse the scripts if you want. It's nothing else than a script invoked by node.js with some set of parameters - of course you could build your own stripped down version of this depending on your needs if you want.

Let me know in case you need any support either on this or feel free to open another issue in case you face some other problems. Thanks for taking the time and reporting/investigating this problem.