通过 Postman 和 curl向/api/products
and发出经过身份验证的 GET 请求时,我遇到了 500 错误。/api/categories
API请求是:
curl -X GET \
'http://HOST-IP/api/products?page[number]=1&page[size]=10&sort=id' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer XXX' \
-H 'Content-Type: application/vnd.api+json'
从 prod.log 中,输出为/api/products
:
api.ERROR: The execution of "oro_api.load_entities_by_entity_serializer" processor is failed.
{"exception":"[object] (ErrorException(code: 0): Call to a member function getId() on null
at /var/www/html/commerce/vendor/oro/commerce/src/Oro/Bundle/RedirectBundle/Api/Processor/ComputeUrlFields.php:83)",
"action":"get_list","requestType":"rest,json_api,frontend","version":"latest","class":"Oro\\Bundle\\ProductBundle\\Entity\\Product"} []
检查 的第 83 行ComputeUrlFields.php
,引用LocalizationHelper
,它存在于:/var/www/html/commerce/vendor/oro/platform/src/Oro/Bundle/LocaleBundle/Helper
这些 API 通过沙盒成功运行。此外,我还可以发出其他经过身份验证的 API 请求,例如 GET/api/productimages
和/api/productfamilies
. 对失败有什么想法吗?我没有更改 AWS Marketplace 映像中的任何捆绑包。
Orocommerce 版本:4.2.1