I'm using Octopus Server. At one point within my pipeline, I run a lambda function that pushes the build package to Octopus, and then attempts to create a Release within Octopus.
I'm using the .NET Octopus SDK.
Pushing the package to Octopus works smoothly.
Creating the release throws this error:
There was a problem with your request. - A channelId must be provided for a release when more than one exists for that project and no default channel has been specified.: OctopusValidationException
at Octopus.Client.OctopusClient.DispatchRequest[TResponseResource](OctopusRequest request, Boolean readResponse)
at Octopus.Client.OctopusClient.Create[TResource](String path, TResource resource, Object pathParameters) at Octopus.Client.Repositories.ReleaseRepository.Create(ReleaseResource release, Boolean ignoreChannelRules)
at MyProject.Function.CreateRelease(ILambdaContext context, S3Entity s3Event, IOctopusSpaceRepository repositoryForSpace) in /home/runner/work/CICD/CICD/src/MyProject/Function.cs:line 113
at MyProject.Function.FunctionHandler(S3Event evnt, ILambdaContext context) in /home/runner/work/CICD/CICD/src/MyProject/Function.cs:line 84
at lambda_method(Closure , Stream , Stream , LambdaContextInternal )
... after running this:
var release = new ReleaseResource(version, "MyProjectId");
repositoryForSpace.Releases.Create(release);
The error message seems self-explanatory, and I can fix it quickly by explicitly referring to the Channel when creating the ReleaseResource
, like this:
var release = new ReleaseResource(version, "MyProjectId", "MyChannelId");
But the error message seems to be a bug, because
- I only have one channel, and
- That one channel is marked as the
default
So I would think that with even just ONE of those conditions true
, I wouldn't receive this error. Yet, I receive it even with both conditions satisfied.
Any thoughts?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…