question

AmirSohail-0150 avatar image
10 Votes"
AmirSohail-0150 asked DesmondSilveira-5616 answered

Get subscription API is not working.

We have created a subscription for users and its worked fine for us but currently, we are facing an unexpected issue related to getting a subscription because want to delete the previous subscription and create a new one for deletion we need a subscription id and get a subscription is not working let me share screenshots

168191-createsubscription.jpg

168150-get-subsc.jpg


office-teams-app-devmicrosoft-graph-teamworkmicrosoft-graph-notifications
get-subsc.jpg (49.5 KiB)
· 17
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Has your original subscription been deleted?

5 Votes 5 ·

subscription is already created I need a subscription list and get subscription list is not working

response is empty : "value": []

4 Votes 4 ·

@CarlZhao-MSFT subscription is exist but the list of subscriptions is empty when I call https://graph.microsoft.com/v1.0/subscriptions API a few days earlier its worked fine but now it's not working
I need the list of created subscriptions
https://graph.microsoft.com/v1.0/subscriptions


"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: Conflict; Reason: A subscripton already exists. It must be deleted before a another can be made.]",
"innerError": {
"date": "2022-01-25T09:07:22",
"request-id": "6a7df85b-0b69-4b4c-97de-da4b8839437c",
"client-request-id": "6a7df85b-0b69-4b4c-97de-da4b8839437c"
}
}
}

4 Votes 4 ·
Show more comments

Same issue here

![168736-imagen.png][1]


5 Votes 5 ·
imagen.png (32.7 KiB)

I'm getting the same problem. I can create a subscription easily enough, and I can get the subscription details ONLY if I include the id in the call. But if I don't capture the id upon subscription creation, I've got an outstanding subscription that I can't delete. This will eventually cause throttling problems, but more importantly creates duplicate notifications because my app expects to delete all existing subscriptions before creating new ones during specific routines.

In other words:

4 Votes 4 ·

Hello @AmirSohail-0150 - Looks like you are creating a new Subscription with the same details as you used for your previous Subscription.
Also, your previous Subscription hasn't deleted and you are trying to create another one with same details.
That is causing this issue.

Could you please verify once?

3 Votes 3 ·

We are trying to repro this scenario at our end. If you have any business critical issue please Open a ticket by visiting the Azure Admin Center or visit the Microsoft 365 Admin Center and use the Support menu to Open a service request.


3 Votes 3 ·

Also experiencing this exact issue. The API calls to https://graph.microsoft.com/v1.0/subscriptions are no longer returning anything (empty array.) Our application calls this API to look up existing subscriptions to know if new ones need to be created. The issue is resulting in duplicate subscription being added which causes problems for our users.

As far as I can tell this issue was introduced in the last ~36 hours with no code change to our application.

3 Votes 3 ·
Show more comments
venkat avatar image
4 Votes"
venkat answered BillySmith-2318 edited

There looks to be a non-empty @OData.nextLink in the response given in the screenshot. Could you please make a call using the nextLink to retrieve more results?



Sometimes backend queries timeout and Database give the next link for continuing the query from the instance of the previous query result. Clients need to use the nextLink to navigate all pages

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AmirSohail-0150 - Could you please confirm if your issue has resolved with above suggestion or still looking for any help?

1 Vote 1 ·
BenceGazder-4777 avatar image BenceGazder-4777 ChetanSharmamsft-3456 ·

This does not solve the issue, because a lot of empty pages are returned. I have to make ~50 requests just to get 2-3 subscriptions and get to the end of the pagination. With this many requests, I will reach "429 - Too many Requests" pretty fast.

5 Votes 5 ·
BillySmith-2318 avatar image BillySmith-2318 ChetanSharmamsft-3456 ·

@ChetanSharmamsft-3456
This is not documented anywhere on the list subscriptions page. The document states "If successful, this method returns a 200 OK response code and a list of subscription objects in the response body".

An empty values array (especially on the first page) leads the user to conclude that there are no subscriptions. As a developer, if I create one subscription and my request for a list of subscriptions returns an empty set, then I must assume that the subscription list is broken. Pagination is not a solution for query timeouts - this should return a response code other than 200 (maybe 202) and a follow up link.

Furthermore, I echo @BenceGazder-4777's sentiment regarding throttling...requiring the client to repeatedly send requests is an undue burden and further reduces the client's ability to work within this environment.

To be clear, our development team has been forced to consider the possibility of migrating subscriptions for our products to other platforms because of this apparent failure.


2 Votes 2 ·
DipeshJadhav-2613 avatar image
4 Votes"
DipeshJadhav-2613 answered

List Subscription is currently not working out and giving out empty array as response.

  1. For now as a work around you can do GET Subscription/ID to get the subscription. ( you will get the ID in response when you create the subscription you can store this ID and use it later when you want)

  2. Along with empty array you will receive odata.NextLink , you need to traverse each page till the end of pagination to find all the active subscription.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

venkat avatar image
4 Votes"
venkat answered ChetanSharmamsft-3456 commented

Thanks for all the reports!

On Monday 2022/1/24, we were seeing lots of “Invalid Continuation Tokens” from CosmosDB resulting in 500’s returned to the client. This lasted for about 24 hours then dissipated. We’re not seeing any occurrence of this issue currently.

Zero results with a continuation token is not uncommon, historically our service returns these frequently. However, starting earlier this week (2022/1/24), we’ve had a sharp increase in the response, roughly 10x. As reported here, the tokens are valid and enumerating them will supply the full result sets but there are many more of them to process.

We are investigating the issue with the help of the CosmosDB support team.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@venkat - Is there any update on the investigation part ?

2 Votes 2 ·
DanEspich-7384 avatar image
5 Votes"
DanEspich-7384 answered KonstantinGapeev-5789 published

I had to use this code to get all my subscriptions now. (sorry it won't let me post the actual code because it looks "suspicious"

208861-screenshot-2022-06-06-145217.png



· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thanks

0 Votes 0 ·

Thank you very much!

0 Votes 0 ·
02191796 avatar image
2 Votes"
02191796 answered 05306524 commented

Hello @AmirSohail-0150 - Looks like you are creating a new Subscription with the same details as you used for your previous Subscription.
Also, your previous Subscription hasn't deleted and you are trying to create another one with same details.
That is causing this

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Good work

1 Vote 1 ·

@02191796 No no if you check my postman request, first of all, I am checking that there is any subscription available with the exact details the API shows 0 results but when I am going to create a subscription it shows me that the subscription already exists.

1 Vote 1 ·

very good

1 Vote 1 ·
02239278 avatar image
3 Votes"
02239278 answered 02239278 commented

a lot of empty pages are returned. I have to make ~50 requests just to get 2-3 subscriptions and get to the end of the pagination. With this many requests, I will reach "429 - Too many Requests"

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thankyou

1 Vote 1 ·
BenceGazder-4777 avatar image
1 Vote"
BenceGazder-4777 answered 47989057 commented

It seems the same issue is happening again: https://github.com/microsoftgraph/microsoft-graph-docs/issues/15648

A lot of empty pages are returned and it causes a 429 error because of the request count.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OleksiiBurchynskyi-4562 avatar image
0 Votes"
OleksiiBurchynskyi-4562 answered

When this problem is going to be resolved?
I've never seen this API call working:
https://docs.microsoft.com/en-us/graph/api/subscription-list?view=graph-rest-1.0&tabs=http

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DesmondSilveira-5616 avatar image
0 Votes"
DesmondSilveira-5616 answered

I've been developing my app for the past couple of months and have been seeing this issue intermittently throughout the whole time. My app creates subscriptions, stores subscriptionIds locally, then refreshes subscriptions using the subscriptionId five minutes before the expiration time. During development, I find that if I create a subscription from scratch then use the Graph API to list subscriptions, I first get the list of active subscriptions correctly. However, hours later, after the subscription has been continually refreshed and is still active (verified by continuing to get incoming change notification webhooks), the subscriptions list endpoint starts returning the empty array, and nothing seems to get this back into a working state for those existing subscriptions. My only course of action is to wait for those active subscriptions to expire and then start over again from scratch by creating new subscriptions.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.