Receiving 404 "Invalid version: graph.microsoft.com" for 80% of requests

G Kelly 11 Reputation points
2021-04-06T15:51:02.917+00:00

Hi,

Our code for querying https://graph.microsoft.com/v1.0/me stopped working suddenly today. We request the users details with the OAuth access token.

The request fails roughly 80-90% of the time, with the following response:

{"error"=>{"code"=>"ResourceNotFound", "message"=>"Invalid version: graph.microsoft.com", "innerError"=>{"date"=>"2021-04-06T11:46:43", "request-id"=>"29fca351-e7ff-40f7-b353-fdb432d5c4fa", "client-request-id"=>"29fca351-e7ff-40f7-b353-fdb432d5c4fa"}}

We are sending a simple HTTPS request using the standard Ruby libraries and have no idea why this has suddenly stopped working.

Any insight is greatly appreciated.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,592 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Roeland Matthijssens 1 Reputation point
    2021-04-07T14:31:48.253+00:00

    I've been spending all day figuring this out as well. I switched to Faraday (from vanilla Net::HTTP) and i get the proper responses now. Not sure if this is an option for you. But it got me going again.

    The reason why it's going wrong is because (at least for me) the Net::HTTP client was constructing a faulty URI to send the request to. I saw this by installing the httplog gem to verify the requests. and i saw something along these lines: (Notice the double https://graph.... in the POST request)

    D, [2021-04-07T17:42:09.050306 #2373045] DEBUG -- : [httplog] Connecting: graph.microsoft.com:443
    D, [2021-04-07T17:42:09.225682 #2373045] DEBUG -- : [httplog] Sending: POST http://graph.microsoft.com:443https://graph.microsoft.com/v1.0/users/<....>/onlineMeetings
    

  2. Deva-MSFT 2,256 Reputation points Microsoft Employee
    2021-04-08T11:20:17.497+00:00

    Also just to isolate the issue outside of your code/library, i would try with Microsoft Graph Explorer or POSTMAN to see if you can repro the issue with same Graph API call or not.

    0 comments No comments

  3. Christian Nassau 1 Reputation point
    2021-04-21T17:09:11.63+00:00

    I saw the same issue when trying to access https://graph.microsoft.com/v1.0/me/messages through a proxy. The framework that I was using was rewriting the request to use the full URI, so it ended up sending

    GET https://graph.microsoft.com/v1.0/me/messages HTTP/1.1

    rather than

    GET /v1.0/me/messages HTTP/1.1

    This behaviour seems common (actually required by some RFC) for plain HTTP proxies but for HTTPS this transformation seems unnecessary. Could it be that some Microsoft servers started to be more finicky about this a few weeks ago?

    0 comments No comments