microsoftgraph/msgraph-sdk-php

2.3.0 throws ApiException where it used to throw ODataError

Closed this issue · 8 comments

I have upgrade to 2.3.0 and now getting a different exception that used to throw ODataError.

Is this intentional? I see no comments in the changelog that would indicate this change.

I believe this is because kiota-http-guzzle-php does not handle the mapped XXX error, this looks to be fixed in microsoft/kiota-http-guzzle-php@3005d52 but this release seems to assume or depend on it?

Using "microsoft/kiota-http-guzzle": "dev-dev as 1.2.0" restores the previous behavior.

Example of wrong exception class thrown.

 [Microsoft\Kiota\Abstractions\ApiException]                                                                                                                                     
  the server returned an unexpected status code and no error class is registered for this code 400 {"error":{"code":"Request_BadRequest","message":"Another object with the same  
   value for property proxyAddresses already exists.","details":[{"code":"ObjectConflict","message":"Another object with the same value for property proxyAddresses already exis  
  ts.","target":"proxyAddresses"},{"code":"ConflictingObjects","message":"Another object with the same value for property proxyAddresses already exists.","target":"User_36d7803  
  7-b8cc-420b-b7a0-a6bfeab3ff55"}],"innerError":{"date":"2024-03-06T16:41:48","request-id":"c45087f3-5514-4eed-8597-af702745693b","client-request-id":"fcf7dcc0-2680-4911-b3be-a  
  75f06b03d64"}}}.    

I've exactly the same issue when using the 2.3.0 version.
Please restore the previous behavior!

@Ndiritu Can you take a look at this?

Hi @wizhippo , @inserve-paul thank you trying out the SDK. I am really sorry for the issue you are facing.
I am looking into it and a fix should be available later today(by 5PM EAT).

Hi @wizhippo , @inserve-paul we’ve released the latest version of https://github.com/microsoft/kiota-http-guzzle-php, kindly do a composer update to get the change. Feel free to reopen the issue if the problem persists.

Hi @SilasKenneth, Thank you for your quick response and action!
Would you also like to update this package so it depends on the correct version (1.3.0) of the kiota-http-guzzle-php package?

Hi @inserve-paul , we will make the releases for the repos depending on the kiota http library by the end of the week.

I've just upgraded to 2.4.0 and the same error occured. I had to cap the version to 2.2.0. Is the change permanent or will the behavior return to the pre 2.3.0 state?

I've just upgraded to 2.4.0 and the same error occured. I had to cap the version to 2.2.0. Is the change permanent or will the behavior return to the pre 2.3.0 state?

For now you can use the bellow. It pulls in 2.4 and the correct guzzle dep.
"microsoft/microsoft-graph": "^2.0",
"microsoft/kiota-http-guzzle": "^1.3",

microsoft/microsoft-graph-core needs it's microsoft/kiota-http-guzzle bumped.

Still broken

Using only "microsoft/microsoft-graph": "^2.8", you can see below the wrong old microsoft/kiota-http-guzzle is being used.

  • Downgrading microsoft/kiota-abstractions (1.3.1 => 1.0.2): Extracting archive
  • Downgrading microsoft/kiota-serialization-text (1.1.0 => 1.0.1): Extracting archive
  • Downgrading microsoft/kiota-serialization-json (1.2.0 => 1.1.0): Extracting archive
  • Downgrading microsoft/kiota-http-guzzle (1.3.0 => 1.1.0): Extracting archive
  • Downgrading microsoft/microsoft-graph-core (2.1.1 => 2.1.0): Extracting archive