Closed covterence closed 1 year ago
@guythetechie is it possible that the publisher is trying to publish to a missing entity after it has been deleted?
I'm currently facing the same issue. I had one API that is now obsolete, so i deleted it. Now the entire Release pipeline is broken as it can not publish back to DEV afer extractring so no QA or PROD deployment.
I worked around this by recreating the obsolete API and backend in DEV and then rerun the failed publisher pipeline jobs. It then properly deleted the resources in DEV, QA and PROD.
Be careful to recreate them the same they are in your higher environments. If you had a typo when naming your API initially this typo lives on in the ID forever so you need to create them with the DisplayName having the typo again otherwise it won't find it again. Not sure why Azure APIM doesn't simply give things UUIDs but derives from the DisplayName.
Release version
4.5.0
Describe the bug
When an API with a Logic App backend is deleted from DEV, publishing failed at the job "Push changes to Dev APIM" on the step trying to delete a policy of an operation that no longer exists. Not all APIs have this problem. The Petstore OAS3 (without any operations in subfolders) works fine.b__50_0>d.MoveNext()
--- End of stack trace from previous location ---
at common.IEnumerableExtensions.ForEachParallel[T](IEnumerable
info: Publisher[0] Deleting policy policy for operation manual-invoke in api covtltestapi-logic-app... crit: Publisher[0] System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/resourceGroups/integration/providers/Microsoft.ApiManagement/service/covtlapim/apis/covtltestapi-logic-app/operations/manual-invoke/policies/policy?api-version=2022-04-01-preview&format=rawxml failed with status code 404. Content is '{"error":{"code":"ResourceNotFound","message":"Operation not found.","details":null}}'. at common.HttpPipelineExtensions.Validate(Response response, Uri requestUri) at common.HttpPipelineExtensions.DeleteResource(HttpPipeline pipeline, Uri uri, CancellationToken cancellationToken) at publisher.Program.<>c__DisplayClass10_0.<<GetDeleteRestResource>b__0>d.MoveNext() --- End of stack trace from previous location --- at publisher.ApiOperationPolicy.Delete(ApiOperationPolicyName policyName, ApiOperationName operationName, ApiName apiName, ServiceUri serviceUri, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken) at publisher.ApiOperationPolicy.<>c__DisplayClass0_0.<<ProcessDeletedArtifacts>b__1>d.MoveNext() --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__50
1.<1 enumerable, Func
2 action, CancellationToken cancellationToken) at publisher.ApiOperationPolicy.ProcessDeletedArtifacts(IReadOnlyCollection1 files, ServiceDirectory serviceDirectory, ServiceUri serviceUri, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken) at publisher.Service.ProcessDeletedArtifacts(IReadOnlyCollection
1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, ListRestResources listRestResources, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken) at publisher.Publisher.ProcessDeletedCommitIdFiles(IReadOnlyCollection1 deletedCommitIdFiles, CancellationToken cancellationToken) at publisher.Publisher.RunWithCommitId(CommitId commitId, CancellationToken cancellationToken) at publisher.Publisher.Run(CancellationToken cancellationToken) at publisher.Publisher.ExecuteAsync(CancellationToken cancellationToken) info: Microsoft.Hosting.Lifetime[0] Application is shutting down...
Expected behavior
No error when publishing back to Dev
Actual behavior
Pipeline failed
Reproduction Steps