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

[BUG] Publisher Error PessimisticConcurrencyConflict - Operation on the API is in progress #379

Closed
erdelacruz opened this issue Sep 7, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@erdelacruz
Copy link

Release version

v4.10.0

Describe the bug

Publisher version 4.10.0 is throwing PessimisticConcurrencyConflict error:

Error Logs:
crit: Publisher[0] System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/resourceGroups/<RG>/providers/Microsoft.ApiManagement/service/<APIM>/apis/data-lookup-apiv1?api-version=2022-04-01-preview failed with status code 409. Content is '{"error":{"code":"PessimisticConcurrencyConflict","message":"Operation on the API is in progress","details":null}}'. at common.HttpPipelineExtensions.Validate(Response response, Uri requestUri) at common.HttpPipelineExtensions.PutResource(HttpPipeline pipeline, Uri uri, JsonObject resource, CancellationToken cancellationToken) at publisher.Program.<>c__DisplayClass12_0.<<GetPutRestResource>b__0>d.MoveNext() --- End of stack trace from previous location --- at publisher.Api.PutApi(ApiName apiName, ApiInformationFile apiInformationFile, ApiSpecificationFile specificationFile, JsonObject configurationApiJson, ServiceUri serviceUri, PutRestResource putRestResource, ILogger logger, CancellationToken cancellationToken) at publisher.Api.<>c__DisplayClass23_0.<<ProcessArtifactsToPut>b__4>d.MoveNext() --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__501.<b__50_0>d.MoveNext()
--- End of stack trace from previous location ---
at common.IEnumerableExtensions.ForEachParallel[T](IEnumerable1 enumerable, Func2 action, CancellationToken cancellationToken)
at publisher.Api.ProcessArtifactsToPut(IReadOnlyCollection1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, PutRestResource putRestResource, ILogger logger, CancellationToken cancellationToken) at publisher.Service.ProcessArtifactsToPut(IReadOnlyCollection1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, ListRestResources listRestResources, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken)
at publisher.Publisher.RunWithoutCommitId(CancellationToken cancellationToken)
at publisher.Publisher.Run(CancellationToken cancellationToken)
at publisher.Publisher.ExecuteAsync(CancellationToken cancellationToken)
info: Microsoft.Hosting.Lifetime[0]
Application is shutting down...
fail: Microsoft.Extensions.Hosting.Internal.Host[9]
BackgroundService failed
`

Expected behavior

All artifacts should be published without errors

Actual behavior

After running the publisher using publish-all-artifacts, its throwing PessimisticConcurrencyConflict error whenever executing a PUT operation to an existing APIs in APIM:

System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/resourceGroups/<RG>/providers/Microsoft.ApiManagement/service/<APIM>/apis/data-lookup-apiv1?api-version=2022-04-01-preview failed with status code 409. Content is '{"error":{"code":"PessimisticConcurrencyConflict","message":"Operation on the API is in progress","details":null}}'.

Reproduction Steps

STEP:

  1. Make sure you have existing APIs in APIM.
  2. Run the Publisher pipeline with publish-all-artifacts
  3. Check the pipeline logs
@github-actions
Copy link

github-actions bot commented Sep 7, 2023

🎉 Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes. 🎉

@waelkdouh waelkdouh added the bug Something isn't working label Sep 7, 2023
@waelkdouh
Copy link
Contributor

duplicate #141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants