microsoftgraph / msgraph-sdk-php

Microsoft Graph Library for PHP.
Other
568 stars 144 forks source link

2.3.0 throws ApiException where it used to throw ODataError #1481

Closed wizhippo closed 6 months ago

wizhippo commented 6 months ago

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 https://github.com/microsoft/kiota-http-guzzle-php/commit/3005d525b2620fa3854c4aa21ebef20053aade1d 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"}}}.    
inserve-paul commented 6 months ago

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?

SilasKenneth commented 6 months ago

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).

SilasKenneth commented 6 months ago

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.

inserve-paul commented 6 months ago

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?

SilasKenneth commented 6 months ago

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

hubipe commented 5 months ago

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?

wizhippo commented 5 months ago

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.

wizhippo commented 4 months ago

Still broken

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