-
Notifications
You must be signed in to change notification settings - Fork 34
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
[error]Cannot validate argument on parameter 'Result'. The argument "Error updating workitems" does not belong to the set "Succeeded,SucceededWithIssues,Failed,Cancelled,Skipped" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. #2
Comments
Same here:
|
I have tried to create a copy of the task with more traces. The error occurs when calling
The trace:
And I can confirm that the type loaded was from the task directory:
|
Found a similar bug on another vsts task : microsoft/azure-pipelines-tasks#2045 |
Ok, nailed it. As reported on the vsts-task issue, PowerShell does not handle very well complex methods with multiple overloads and async pattern. My solution was to add two utility functions first:
This code has been found in SonarQube extension code, in Then update method invocation with reflection based calls:
There are other methods which need replacement. I will try to create a fork and submit a PR, if the author responds to this comment. Regards, |
@tbolon Thanks for looking into this. Your fix using the code from SonarQube looks good to me. |
@BlueBasher I created a PR for the fix. I could not test the patch on my fork, because initially I used the extension zip to have an identical folder layout. Perhaps you should give instruction on how to build/debug the extension from a clean clone. Regards, |
I've merged the PR and fixed a small bug with the $projectIdGuid and $buildIdNum variables. |
Thanks for the fix guys.
I have tested 1.3.4, the original issue seems to be fixed, however I am getting below error.
I am using this task as a last step in Release to move the checked in User story to particular Kanban board column.
1. 2017-07-05T00:49:18.1099575Z ##[debug]Importing function 'Assert-Path'.
2. 2017-07-05T00:49:18.1109575Z ##[debug]Importing function 'Find-Files'.
3. 2017-07-05T00:49:18.1129575Z ##[debug]Importing function 'Find-Match'.
4. 2017-07-05T00:49:18.1139575Z ##[debug]Importing function 'Get-AssemblyReference'.
5. 2017-07-05T00:49:18.1149575Z ##[debug]Importing function 'Get-Endpoint'.
6. 2017-07-05T00:49:18.1159575Z ##[debug]Importing function 'Get-Input'.
7. 2017-07-05T00:49:18.1169575Z ##[debug]Importing function 'Get-LocString'.
8. 2017-07-05T00:49:18.1179575Z ##[debug]Importing function 'Get-TaskVariable'.
9. 2017-07-05T00:49:18.1189575Z ##[debug]Importing function 'Get-TaskVariableInfo'.
10. 2017-07-05T00:49:18.1199575Z ##[debug]Importing function 'Get-TfsClientCredentials'.
11. 2017-07-05T00:49:18.1209575Z ##[debug]Importing function 'Get-TfsService'.
12. 2017-07-05T00:49:18.1219575Z ##[debug]Importing function 'Get-VssCredentials'.
13. 2017-07-05T00:49:18.1229575Z ##[debug]Importing function 'Get-VssHttpClient'.
14. 2017-07-05T00:49:18.1239575Z ##[debug]Importing function 'Import-LocStrings'.
15. 2017-07-05T00:49:18.1249575Z ##[debug]Importing function 'Invoke-Tool'.
16. 2017-07-05T00:49:18.1259575Z ##[debug]Importing function 'New-FindOptions'.
17. 2017-07-05T00:49:18.1269575Z ##[debug]Importing function 'New-MatchOptions'.
18. 2017-07-05T00:49:18.1279575Z ##[debug]Importing function 'Out-Default'.
19. 2017-07-05T00:49:18.1289575Z ##[debug]Importing function 'Select-Match'.
20. 2017-07-05T00:49:18.1299575Z ##[debug]Importing function 'Set-TaskVariable'.
21. 2017-07-05T00:49:18.1309575Z ##[debug]Importing function 'Trace-EnteringInvocation'.
22. 2017-07-05T00:49:18.1309575Z ##[debug]Importing function 'Trace-LeavingInvocation'.
23. 2017-07-05T00:49:18.1319575Z ##[debug]Importing function 'Trace-Path'.
24. 2017-07-05T00:49:18.1329575Z ##[debug]Importing function 'Write-AddAttachment'.
25. 2017-07-05T00:49:18.1339575Z ##[debug]Importing function 'Write-AddBuildTag'.
26. 2017-07-05T00:49:18.1349575Z ##[debug]Importing function 'Write-AssociateArtifact'.
27. 2017-07-05T00:49:18.1359575Z ##[debug]Importing function 'Write-LogDetail'.
28. 2017-07-05T00:49:18.1369575Z ##[debug]Importing function 'Write-SetProgress'.
29. 2017-07-05T00:49:18.1369575Z ##[debug]Importing function 'Write-SetResult'.
30. 2017-07-05T00:49:18.1379575Z ##[debug]Importing function 'Write-SetSecret'.
31. 2017-07-05T00:49:18.1389575Z ##[debug]Importing function 'Write-SetVariable'.
32. 2017-07-05T00:49:18.1399575Z ##[debug]Importing function 'Write-TaskDebug'.
33. 2017-07-05T00:49:18.1619575Z ##[debug]Importing function 'Write-TaskError'.
34. 2017-07-05T00:49:18.1639575Z ##[debug]Importing function 'Write-TaskVerbose'.
35. 2017-07-05T00:49:18.1649575Z ##[debug]Importing function 'Write-TaskWarning'.
36. 2017-07-05T00:49:18.1829575Z ##[debug]Importing function 'Write-UpdateBuildNumber'.
37. 2017-07-05T00:49:18.1849575Z ##[debug]Importing function 'Write-UploadArtifact'.
38. 2017-07-05T00:49:18.1859575Z ##[debug]Importing function 'Write-UploadBuildLog'.
39. 2017-07-05T00:49:18.2259575Z ##[debug]BuildId 610
40. 2017-07-05T00:49:18.2259575Z ##[debug]ProjectId 34147a9c-0c69-4132-aa13-4e2cd697ac95
41. 2017-07-05T00:49:18.2269575Z ##[debug]requestedFor Sumit Yadam
42. 2017-07-05T00:49:18.2269575Z ##[debug]workItemType User Story
43. 2017-07-05T00:49:18.2279575Z ##[debug]WorkItemState Active
44. 2017-07-05T00:49:18.2279575Z ##[debug]WorkItemKanbanState In Progress
45. 2017-07-05T00:49:18.2289575Z ##[debug]WorkItemDone False
46. 2017-07-05T00:49:18.2289575Z ##[debug]updateAssignedTo Never
47. 2017-07-05T00:49:18.2299575Z ##[debug]Converting buildId '610' as int
48. 2017-07-05T00:49:18.2299575Z ##[debug]Converting projectId '34147a9c-0c69-4132-aa13-4e2cd697ac95' as GUID
49. 2017-07-05T00:49:18.4699575Z ##[debug]GetBuildWorkItemsRefsAsync 34147a9c-0c69-4132-aa13-4e2cd697ac95 610
50. 2017-07-05T00:49:18.8359575Z ##[debug]Loop workItemsRefs
51. 2017-07-05T00:49:18.8379575Z ##[debug]Microsoft.VisualStudio.Services.WebApi.ResourceRef
52. 2017-07-05T00:49:18.8569575Z ##[debug]Found WorkItemRef: 1896
53. 2017-07-05T00:49:18.9819575Z ##[debug]Found WorkItem: 1896
54. 2017-07-05T00:49:18.9829575Z Updating WorkItem 1896
55. 2017-07-05T00:49:18.9869575Z ##[debug]Found KanbanColumn: WEF_13B56BE23846402A897F92E3C089F35C_Kanban.Column WEF_D0CEBEC070DA4D549967B81DF159CD86_Kanban.Column WEF_C54A9D74724A40879251DD62A6A5A4C4_Kanban.Column WEF_B9CFDA2C487E4819BFB2C149BBE69E55_Kanban.Column WEF_90C4902BB70E426796AB02912F3948E7_Kanban.Column WEF_FBFDA0C4023D47D9927933703E6E21DC_Kanban.Column WEF_CE3336052F9147E3A2A08F3D8493B002_Kanban.Column
56. 2017-07-05T00:49:18.9989575Z ##[debug]Patch: /fields/System.State Active
57. 2017-07-05T00:49:19.0019575Z ##[debug]Patch: /fields/WEF_13B56BE23846402A897F92E3C089F35C_Kanban.Column WEF_D0CEBEC070DA4D549967B81DF159CD86_Kanban.Column WEF_C54A9D74724A40879251DD62A6A5A4C4_Kanban.Column WEF_B9CFDA2C487E4819BFB2C149BBE69E55_Kanban.Column WEF_90C4902BB70E426796AB02912F3948E7_Kanban.Column WEF_FBFDA0C4023D47D9927933703E6E21DC_Kanban.Column WEF_CE3336052F9147E3A2A08F3D8493B002_Kanban.Column In Progress
58. 2017-07-05T00:49:19.0029575Z ##[debug]Patch: /fields/WEF_13B56BE23846402A897F92E3C089F35C_Kanban.Column WEF_D0CEBEC070DA4D549967B81DF159CD86_Kanban.Column WEF_C54A9D74724A40879251DD62A6A5A4C4_Kanban.Column WEF_B9CFDA2C487E4819BFB2C149BBE69E55_Kanban.Column WEF_90C4902BB70E426796AB02912F3948E7_Kanban.Column WEF_FBFDA0C4023D47D9927933703E6E21DC_Kanban.Column WEF_CE3336052F9147E3A2A08F3D8493B002_Kanban.Column.Done False
59. 2017-07-05T00:49:19.1469575Z Process is terminated due to StackOverflowException.
60. 2017-07-05T00:49:23.0839575Z ##[error]Process completed with exit code 255.
From: Marco van Kimmenade [mailto:notifications@github.com]
Sent: Wednesday, 5 July 2017 3:09 AM
To: BlueBasher/WorkItemUpdater <WorkItemUpdater@noreply.github.com>
Cc: Dipen Patel <Dipen.Patel@environment.nsw.gov.au>; Author <author@noreply.github.com>
Subject: Re: [BlueBasher/WorkItemUpdater] [error]Cannot validate argument on parameter 'Result'. The argument "Error updating workitems" does not belong to the set "Succeeded,SucceededWithIssues,Failed,Cancelled,Skipped" specified by the ValidateSet attribute. ...
I've merged the PR and fixed a small bug with the $projectIdGuid and $buildIdNum variables.
A new version (1.3.4) with these changes has been published in the VSTS Marketplace.
@tbolon<https://github.com/tbolon> Thanks for the help!
FYI: To be honest, building/debugging is a PITA. I usually deploy the extension as a private extensions under a different name. I would like to move from PS to JS at some point in time so debugging would be a lot easier.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#2 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AYnA4cCXM7R31nUxdqOSMTwfxoS9FeXLks5sKnGcgaJpZM4OKGxI>.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
This email is intended for the addressee(s) named and may contain confidential and/or privileged information.
If you are not the intended recipient, please notify the sender and then delete it immediately.
Any views expressed in this email are those of the individual sender except where the sender expressly and with authority states them to be the views of the NSW Office of Environment and Heritage.
PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL
|
Hi I am getting above error.
I have added this task as last item in the release pipeline.
Here is log
2017-06-30T03:06:08.3880037Z ##[debug]Importing function 'Assert-Path'.
2017-06-30T03:06:08.3880037Z ##[debug]Importing function 'Find-Files'.
2017-06-30T03:06:08.3890038Z ##[debug]Importing function 'Find-Match'.
2017-06-30T03:06:08.3900039Z ##[debug]Importing function 'Get-AssemblyReference'.
2017-06-30T03:06:08.3910040Z ##[debug]Importing function 'Get-Endpoint'.
2017-06-30T03:06:08.3920041Z ##[debug]Importing function 'Get-Input'.
2017-06-30T03:06:08.3930042Z ##[debug]Importing function 'Get-LocString'.
2017-06-30T03:06:08.3940043Z ##[debug]Importing function 'Get-TaskVariable'.
2017-06-30T03:06:08.3950044Z ##[debug]Importing function 'Get-TaskVariableInfo'.
2017-06-30T03:06:08.3970046Z ##[debug]Importing function 'Get-TfsClientCredentials'.
2017-06-30T03:06:08.3980047Z ##[debug]Importing function 'Get-TfsService'.
2017-06-30T03:06:08.3990048Z ##[debug]Importing function 'Get-VssCredentials'.
2017-06-30T03:06:08.4010050Z ##[debug]Importing function 'Get-VssHttpClient'.
2017-06-30T03:06:08.4020051Z ##[debug]Importing function 'Import-LocStrings'.
2017-06-30T03:06:08.4030052Z ##[debug]Importing function 'Invoke-Tool'.
2017-06-30T03:06:08.4040053Z ##[debug]Importing function 'New-FindOptions'.
2017-06-30T03:06:08.4050054Z ##[debug]Importing function 'New-MatchOptions'.
2017-06-30T03:06:08.4060055Z ##[debug]Importing function 'Out-Default'.
2017-06-30T03:06:08.4070056Z ##[debug]Importing function 'Select-Match'.
2017-06-30T03:06:08.4080057Z ##[debug]Importing function 'Set-TaskVariable'.
2017-06-30T03:06:08.4090058Z ##[debug]Importing function 'Trace-EnteringInvocation'.
2017-06-30T03:06:08.4100059Z ##[debug]Importing function 'Trace-LeavingInvocation'.
2017-06-30T03:06:08.4120061Z ##[debug]Importing function 'Trace-Path'.
2017-06-30T03:06:08.4120061Z ##[debug]Importing function 'Write-AddAttachment'.
2017-06-30T03:06:08.4140063Z ##[debug]Importing function 'Write-AddBuildTag'.
2017-06-30T03:06:08.4140063Z ##[debug]Importing function 'Write-AssociateArtifact'.
2017-06-30T03:06:08.4150064Z ##[debug]Importing function 'Write-LogDetail'.
2017-06-30T03:06:08.4160065Z ##[debug]Importing function 'Write-SetProgress'.
2017-06-30T03:06:08.4170066Z ##[debug]Importing function 'Write-SetResult'.
2017-06-30T03:06:08.4180067Z ##[debug]Importing function 'Write-SetSecret'.
2017-06-30T03:06:08.4190068Z ##[debug]Importing function 'Write-SetVariable'.
2017-06-30T03:06:08.4200069Z ##[debug]Importing function 'Write-TaskDebug'.
2017-06-30T03:06:08.4230072Z ##[debug]Importing function 'Write-TaskError'.
2017-06-30T03:06:08.4240073Z ##[debug]Importing function 'Write-TaskVerbose'.
2017-06-30T03:06:08.4460095Z ##[debug]Importing function 'Write-TaskWarning'.
2017-06-30T03:06:08.4460095Z ##[debug]Importing function 'Write-UpdateBuildNumber'.
2017-06-30T03:06:08.4620111Z ##[debug]Importing function 'Write-UploadArtifact'.
2017-06-30T03:06:08.4630112Z ##[debug]Importing function 'Write-UploadBuildLog'.
2017-06-30T03:06:08.5110160Z ##[debug]BuildId 604
2017-06-30T03:06:08.5120161Z ##[debug]ProjectId 34147a9c-0c69-4132-aa13-4e2cd697ac95
2017-06-30T03:06:08.5130162Z ##[debug]requestedFor Sumit Yadam
2017-06-30T03:06:08.5130162Z ##[debug]workItemType User Story
2017-06-30T03:06:08.5130162Z ##[debug]WorkItemState Active
2017-06-30T03:06:08.5140163Z ##[debug]WorkItemKanbanState In Dev
2017-06-30T03:06:08.5140163Z ##[debug]WorkItemDone False
2017-06-30T03:06:08.5150164Z ##[debug]updateAssignedTo Never
2017-06-30T03:06:08.9090558Z Index was outside the bounds of the array.
2017-06-30T03:06:08.9100559Z at System.Management.Automation.Adapter.CompareOverloadCandidates(OverloadCandidate candidate1, OverloadCandidate candidate2, Object[] arguments)
2017-06-30T03:06:08.9100559Z at System.Management.Automation.Adapter.FindBestCandidate(IEnumerable`1 candidates, Object[] arguments)
2017-06-30T03:06:08.9110560Z at System.Management.Automation.Adapter.FindBestCandidate(IEnumerable`1 candidates, Object[] arguments, PSMethodInvocationConstraints invocationConstraints)
2017-06-30T03:06:08.9110560Z at System.Management.Automation.Adapter.FindBestMethod(MethodInformation[] methods, PSMethodInvocationConstraints invocationConstraints, Object[] arguments, String& errorId, String& errorMsg, Boolean& expandParamsOnBest)
2017-06-30T03:06:08.9110560Z at System.Management.Automation.Language.PSInvokeMemberBinder.InvokeDotNetMethod(DynamicMetaObject target, DynamicMetaObject[] args, BindingRestrictions restrictions, MethodInformation[] mi, Type errorExceptionType)
2017-06-30T03:06:08.9110560Z at System.Management.Automation.Language.PSInvokeMemberBinder.FallbackInvokeMember(DynamicMetaObject target, DynamicMetaObject[] args, DynamicMetaObject errorSuggestion)
2017-06-30T03:06:08.9110560Z at System.Management.Automation.PSObject.PSDynamicMetaObject.BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args)
2017-06-30T03:06:08.9120561Z at System.Dynamic.DynamicMetaObjectBinder.Bind(Object[] args, ReadOnlyCollection`1 parameters, LabelTarget returnLabel)
2017-06-30T03:06:08.9120561Z at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite`1 site, Object[] args)
2017-06-30T03:06:08.9120561Z at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
2017-06-30T03:06:08.9120561Z at System.Management.Automation.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
2017-06-30T03:06:08.9120561Z at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
2017-06-30T03:06:08.9710620Z ##[error]Cannot validate argument on parameter 'Result'. The argument "Error updating workitems" does not belong to the set "Succeeded,SucceededWithIssues,Failed,Cancelled,Skipped" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.
The text was updated successfully, but these errors were encountered: