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 fails message":"ApiVersionSet not found on new api creation #584

Closed
lavanyar77 opened this issue Jul 11, 2024 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@lavanyar77
Copy link

Release version

v6.0.0-rc1

Describe the bug

Publisher failed with error HTTP request to URI https://management.azure.com/subscriptions/****/resourceGroups/*****/providers/Microsoft.ApiManagement/service/******/apis/demo-api;rev=1?api-version=2022-08-01 failed with status code 404. Content is '{"error":{"code":"ResourceNotFound","message":"ApiVersionSet not found.","details":null}}'.

Expected behavior

publisher should be able deploy api

Actual behavior

dbug: RunPublisher[0]
15:46:41 Found file /home/jenkins/workspace/Deployments/dev-demoapi-stv2/apiops/version sets/demo-api/versionSetInformation.json.
15:46:41 dbug: RunPublisher[0]
15:46:41 Found file /home/jenkins/workspace/Deployments/dev-demoapi-stv2/apiops/policy.xml.
15:46:41 dbug: RunPublisher[0]
15:46:41 Found file /home/jenkins/workspace/Deployments/dev-demoapi-stv2/apiops/apis/demo-api/specification.json.
15:46:41 dbug: RunPublisher[0]
15:46:41 Found file /home/jenkins/workspace/Deployments/dev-demoapi-stv2/apiops/apis/demo-api/policy.xml.
15:46:41 dbug: RunPublisher[0]
15:46:41 Found file /home/jenkins/workspace/Deployments/dev-demoapi-stv2/apiops/apis/demo-api/apiInformation.json.
15:46:41 dbug: RunPublisher[0]
15:46:41 Found file /home/jenkins/workspace/Deployments/dev-demoapi-stv2/apiops/version sets/demo-api-dev/demo-api/versionSetInformation.json.
15:46:41 info: RunPublisher[0]
15:46:41 Found 6 files in scope for publisher.
15:46:41 info: ServicePolicyPublisher[0]
15:46:41 Putting service policy policy...
15:46:41 info: VersionSetPublisher[0]
15:46:41 Putting version set demo-api...
15:46:41 trce: HttpPipeline[0]
15:46:41 Starting request
15:46:41 Method: PUT
15:46:41 Uri: https://management.azure.com/subscriptions/****/resourceGroups/*********/providers/Microsoft.ApiManagement/service/*********/apiVersionSets/demo-api?api-version=2022-08-01
15:46:41 Content: {"properties":{"displayName":"dev | demo-api","description":"DEMO-(WebDBI)-API for external access","versioningScheme":"Header","versionHeaderName":"apimversion"}}
15:46:41 trce: HttpPipeline[0]
15:46:41 Starting request
15:46:41 Method: PUT
15:46:41 Uri: https://management.azure.com/subscriptions/****/resourceGroups/*********/providers/Microsoft.ApiManagement/service/*********/policies/policy?api-version=2022-08-01
15:46:41 Content: {"properties":{"format":"rawxml","value":"\uFEFF\u003Cpolicies\u003E\n \u003Cinbound /\u003E\n \u003Cbackend\u003E\n \u003Cforward-request /\u003E\n \u003C/backend\u003E\n \u003Coutbound /\u003E\n \u003Con-error /\u003E\n\u003C/policies\u003E"}}
15:46:42 info: ApiPublisher[0]
15:46:42 Putting API demo-api...
15:46:42 trce: HttpPipeline[0]
15:46:42 Starting request
15:46:42 Method: PUT
15:46:42 Uri: https://management.azure.com/subscriptions/****/resourceGroups/*********/providers/Microsoft.ApiManagement/service/*********/apis/demo-api;rev=1?api-version=2022-08-01
15:46:42 Content: {"properties":{"path":"dev-demo-api","apiRevision":"0.11.0-SNAPSHOT","apiRevisionDescription":"demo-api Revision 0.11.0-SNAPSHOT","apiVersion":"v1-apiops","apiVersionDescription":"demo-api Version 0.11.0-SNAPSHOT","apiVersionSetId":"/subscriptions//resourceGroups//providers/Microsoft.ApiManagement/service/****/apiVersionSets/demo-api-dev","authenticationSettings":{"oAuth2AuthenticationSettings":[],"openidAuthenticationSettings":[]},"displayName":"dev | demo-api","protocols":["https"],"subscriptionKeyParameterNames":{"header":"Ocp-Apim-Subscription-Key","query":"subscription-key"},"subscriptionRequired":false}}
15:46:42 trce: HttpPipeline[0]
15:46:42 Received response
15:46:42 Method: PUT
15:46:42 Uri: https://management.azure.com/subscriptions/****/resourceGroups/*********/providers/Microsoft.ApiManagement/service/*********/apis/demo-api;rev=1?api-version=2022-08-01
15:46:42 Status code: 404
15:46:42 Duration (hh:mm:ss): 00:00:00.2685912
15:46:42 Content: {"error":{"code":"ResourceNotFound","message":"ApiVersionSet not found.","details":null}}
15:46:42 crit: Program[0]
15:46:42 Publisher failed with error HTTP request to URI https://management.azure.com/subscriptions/****/resourceGroups/*********/providers/Microsoft.ApiManagement/service/*********/apis/demo-api;rev=1?api-version=2022-08-01 failed with status code 404. Content is '{"error":{"code":"ResourceNotFound","message":"ApiVersionSet not found.","details":null}}'.
15:46:42 System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/****/resourceGroups/*********/providers/Microsoft.ApiManagement/service/*********/apis/demo-api;rev=1?api-version=2022-08-01 failed with status code 404. Content is '{"error":{"code":"ResourceNotFound","message":"ApiVersionSet not found.","details":null}}'.
15:46:42 at common.HttpPipelineExtensions.<>c__DisplayClass8_0.b__0(Response response) in /home/runner/work/apiops/apiops/tools/code/common/Http.cs:line 157
15:46:42 at LanguageExt.ClassInstances.MEither2.Match[C](Either2 choice, Func2 Left, Func2 Right, Func1 Bottom) 15:46:42 at LanguageExt.Choice.ifLeft[CHOICE,CH,A,B](CH ma, Func2 leftMap)
15:46:42 at LanguageExt.Either2.IfLeft(Func2 leftMap)

Reproduction Steps

  1. Update the existing api using publisher - no issue
  2. delete the api
  3. Re-deploy the api.
Copy link

  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. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. 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
Copy link
Contributor

Just out of curiosity. Does this happen with v5?

@waelkdouh waelkdouh added the bug Something isn't working label Jul 11, 2024
@guythetechie
Copy link
Contributor

Are you redeploying to the same instance or a different one?

Also, your logs show that version set demo-api has been published, but your api is pointing to version set demo-api-dev. Do you have two different version sets?

@lavanyar77
Copy link
Author

it is the issue with version set name demo-api-dev. i changed the version set name to demo-app and deployed. closing the issue. thank you

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