As part of the deployment process in jenkins we have a powershell script that after creating a release in octopus, it uploads other artifacts (metadata files) to the release just created via the Octopus API. This was working fine when using the version 2018.5 and doing these API calls:
POST /artifacts
{
Filename = $ArtifactName
RelatedDocumentIds = @($OctopusProjectId, $ReleaseId)
}
PUT artifacts/$ArtifactId/content
...content of the file...
Since upgrading to the version 2019.3.0 we are getting the following 500 error response when doing the same API call to POST /artifacts:
{
"ErrorMessage": "Object reference not set to an instance of an object."
}
From the logs:
2019-06-17 11:54:58.7307 1548 64 ERROR Unhandled error on request: https://octopus-server/api/artifacts a0df6f3b72a240478d9061fe8903abd7 by *** : Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Octopus.Core.Validation.ArtifactValidator.BeAnAdhocScriptOrDeploymentTask(Artifact artifact, String relatedDocumentIds)
at FluentValidation.Validators.PredicateValidator.IsValid(PropertyValidatorContext context)
at FluentValidation.Validators.PropertyValidator.Validate(PropertyValidatorContext context)
at FluentValidation.Internal.PropertyRule.<Validate>d__59.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at FluentValidation.Results.ValidationResult..ctor(IEnumerable`1 failures)
at FluentValidation.AbstractValidator`1.Validate(ValidationContext`1 context)
at Octopus.Server.Web.Infrastructure.Api.Responder`1.ValidateModel[TModel](IEnumerable`1 validators, TModel model)
at Octopus.Server.Web.Infrastructure.Api.CreateResponseDescriptor`2.Responder.ExecuteRegistered()
at Octopus.Server.Web.Infrastructure.Api.Responder`1.Respond(TDescriptor options, NancyContext context)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Octopus.Server.Web.Infrastructure.OctopusNancyModule.<>c__DisplayClass14_0.<get_Routes>b__1(Object x)
at Nancy.Routing.Route.<>c__DisplayClass4.<Wrap>b__3(Object parameters, CancellationToken context)
Any suggestion in what we should change? Is the functionality still available?
Thanks,
Alex