magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

Internal Server Error in /V1/inventory/low-quantity-notification API Endpoint #35927

Closed mlf20 closed 2 years ago

mlf20 commented 2 years ago

Preconditions and environment

Steps to reproduce

  1. Retrieve auth token from the admin endpoint /V1/integration/admin/
  2. Request endpoint:
curl -H 'Content-Type: application/json' -H 'Authorization: Bearer' <AUTH TOKEN> -d '{"sourceItemConfigurations": ""}'  -X POST http://<MAGENTO_URL>/pub/rest/default/V1/inventory/low-quantity-notification

Expected result

Returns a 400 error as the request is malformed.

Actual result

Returns a 500 status code from a null TypeError .

Additional information

output of var/log/system.log:

    [2022-08-01T11:57:47.938446+00:00] main.CRITICAL: TypeError: Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration\SaveMultiple\Interceptor::execute(): Argument #1 ($sourceItemConfigurations) must be of type array, null given in /magento/generated/code/Magento/InventoryLowQuantityNotification/Model/SourceItemConfiguration/SaveMultiple/Interceptor.php:20
    Stack trace:
    #0 [internal function]: Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration\SaveMultiple\Interceptor->execute()
    #1 /magento/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array()
    #2 /magento/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process()
    #3 /magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch()
    #4 /magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent()
    #5 /magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}()
    #6 /magento/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins()
    #7 /magento/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch()
    #8 /magento/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
    #9 /magento/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
    #10 /magento/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
    #11 {main} [] []

Release note

No response

Triage and priority

m2-assistant[bot] commented 2 years ago

Hi @mlf20. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 2 years ago

Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-November commented 2 years ago

Hi @mlf20 , Thank you for reporting and collaboration. This issue is not reproducible on 2.4-develop branch The exception mentioned in all the below issues reported by you is the similar error/ issue which is not reproducible on 2.4-develop branch. Can we close all the other issues and track in a single bug: https://github.com/magento/magento2/issues/35934 Similar issues having same kind of exception: https://github.com/magento/magento2/issues/35929 https://github.com/magento/magento2/issues/35928 https://github.com/magento/magento2/issues/35927 https://github.com/magento/magento2/issues/35926 https://github.com/magento/magento2/issues/35931 https://github.com/magento/magento2/issues/35930

We are getting a 400 error as the request is malformed. Kindly check Magento system requirements and 3rd party exntensions / modules enabled is causing this issue. Kindly recheck the issue on Magento 2.4-develop branch and provide missing steps if any if you are still facing any issues. Thank you

mlf20 commented 2 years ago

Hi @engcom-November

I have gone over my logs and the payload in thebody should be '{"sourceItemConfigurations": ""}'

This reproduces the issue as shown below: Screenshot 2022-08-12 at 16 38 52

engcom-November commented 2 years ago

Hi @mlf20 , Thanks for the update. Verified the issue on Magento 2.4-develop branch and the issue is reproducible with above payload. But however, similar issue has been confirmed here: https://github.com/magento/magento2/issues/35931. Since the issue occurred for all these API's is with same/ similar payload and with similar exception / error, we are tracking this in a single bug mentioning all endpoints / API's here: https://github.com/magento/magento2/issues/35931 and closing this issue as duplicate. Please move on to this issue for latest updates / solutions on the same. Thank you.

Olha27691 commented 2 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 years ago

Hi @Olha27691. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @Olha27691, here is your Magento Instance: https://7d9b6ba55384fa5427f9dac89fd08822.instances.magento-community.engineering Admin access: https://7d9b6ba55384fa5427f9dac89fd08822.instances.magento-community.engineering/admin_20e8 Login: 9a347754 Password: 67b0e8d9055c