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

Error executing task #7

Open
cherici-simone opened this issue Nov 7, 2019 · 2 comments
Open

Error executing task #7

cherici-simone opened this issue Nov 7, 2019 · 2 comments

Comments

@cherici-simone
Copy link

Hello, I'm trying to create a new branch at the end of a yaml build pipeline, but the task raise an error:
##[debug]GET https://dev.azure.com/XXX//YYY/_apis/git/repositories/DevOps/?api-version=5.0 with 0-byte payload ##[debug]received 15653-byte response of content type text/html; charset=utf-8 Repository Id: [] ##[debug]Caught exception from task script. ##[debug]Error record: ##[debug]D:\a\_tasks\branch-maker_b15628f5-ba26-4250-8e69-fb729fbda870\0.1.3\run.ps1 : Cannot validate argument on parameter 'Repository'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. ##[debug]At line:1 char:1 ##[debug]+ . 'd:\a\_tasks\branch-maker_b15628f5-ba26-4250-8e69-fb729fbda870\0.1. ... ##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##[debug] + CategoryInfo : InvalidData: (:) [run.ps1], ParameterBindingValidationException ##[debug] + FullyQualifiedErrorId : ParameterArgumentValidationError,run.ps1 ##[debug] ##[debug]Script stack trace: ##[debug]at <ScriptBlock>, D:\a\_tasks\branch-maker_b15628f5-ba26-4250-8e69-fb729fbda870\0.1.3\run.ps1: line 63 ##[debug]at <ScriptBlock>, <No file>: line 1 ##[debug]at <ScriptBlock>, <No file>: line 22 ##[debug]at <ScriptBlock>, <No file>: line 18 ##[debug]at <ScriptBlock>, <No file>: line 1 ##[debug]Exception: ##[debug]System.Management.Automation.ParameterBindingValidationException: Cannot validate argument on parameter 'Repository'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. ---> System.Management.Automation.ValidationMetadataException: The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. ##[debug] at System.Management.Automation.ValidateNotNullOrEmptyAttribute.Validate(Object arguments, EngineIntrinsics engineIntrinsics) ##[debug] at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags) ##[debug] --- End of inner exception stack trace --- ##[debug] at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) ##[debug] at System.Management.Automation.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame)
##[debug] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[debug] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[debug] at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
##[debug] at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
##[debug] at System.Management.Automation.PSScriptCmdlet.RunClause(Action1 clause, Object dollarUnderbar, Object inputToProcess) ##[debug] at System.Management.Automation.PSScriptCmdlet.DoEndProcessing() ##[debug] at System.Management.Automation.CommandProcessorBase.Complete() ##[error]Cannot validate argument on parameter 'Repository'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. ##[debug]Processed: ##vso[task.logissue type=error]Cannot validate argument on parameter 'Repository'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. ##[debug]Processed: ##vso[task.complete result=Failed]

Here is the configuration:

- task: branch-maker@0
inputs:
repository: '$(Build.Repository.Name)'
sourceBranchName: 'master'
newBranchName: 'release/$(Build.BuildNumber)'
applyBranchPolicy: true
MinimumApproverCount: '1'
creatorVoteCounts: true
checkForLinkedWorkItems: true
checkForLinkedWorkItemsType: 'optional'
checkForCommentResolution: true
enforceMergeStrategy: true
enforceMergeStrategyType: 'squashMerge'

@kknapp1
Copy link

kknapp1 commented Nov 20, 2019

was having the same error. fixed by setting Enable the

Allow scripts to access the OAuth token

on the pipeline phase per the instructions said. working fine now.

@NorthHighlandNicole
Copy link

NorthHighlandNicole commented Jul 13, 2020

Hello, can you please respond with the fix for this? There is no option to "allow scripts to access the OAuth token" in the classic pipelines and the documentation here does not list the inputs for the task. And when using the UI to edit the YAML there is also no option for "allow scripts to access the OAuth token".

Thank you.

Error:
##[error]Cannot validate argument on parameter 'Repository'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.

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

No branches or pull requests

3 participants