Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a new product through the REST API throws internal error #3822

Closed
mamof opened this issue Mar 17, 2016 · 4 comments
Closed

Creating a new product through the REST API throws internal error #3822

mamof opened this issue Mar 17, 2016 · 4 comments
Assignees

Comments

@mamof
Copy link

mamof commented Mar 17, 2016

Steps to reproduce

Using chrome RestClient extension.
URL: http://domain/magento2/rest/V1/products
Method: POST
Headers:

Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: Bearer fsqijfl2cdu3u9c8s7uxdrb07qqit3yb

Payload:

{
    "product": {
        "sku": "B201-SKU",
        "name": "B201",
        "price": 25.00,
        "status": 1,
        "type_id": "simple",
        "custom_attributes": [{
            "description": "Heavy Duty Brake Cables"
        }]
    }
}

Expected result

Creates part B201.

Actual result

{
"message": "Internal Error. Details are available in Magento log file. Report ID: webapi-56eab1fa2ee25"
}

[2016-03-17 13:32:42] main.CRITICAL: exception 'Exception' with message 'Report ID: webapi-56eab1fa2ee25; Message: Notice: Undefined index: value in /var/www/magento2/vendor/magento/framework/Webapi/ServiceInputProcessor.php on line 192' in /var/www/magento2/vendor/magento/framework/Webapi/ErrorProcessor.php:194
Stack trace:

0 /var/www/magento2/vendor/magento/framework/Webapi/ErrorProcessor.php(139): Magento\Framework\Webapi\ErrorProcessor->_critical(Object(Exception))

1 /var/www/magento2/vendor/magento/module-webapi/Controller/Rest.php(163): Magento\Framework\Webapi\ErrorProcessor->maskException(Object(Exception))

2 /var/www/magento2/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))

3 /var/www/magento2/vendor/magento/framework/App/Http.php(115): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

4 /var/www/magento2/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()

5 /var/www/magento2/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))

6 {main} [] []

@mamof
Copy link
Author

mamof commented Mar 31, 2016

Any chance we could get an update on this? We're trying to finish out our integration and creating products is a big roadblock.

@eb84
Copy link

eb84 commented May 11, 2016

I am also running into this issue when attempting to POST a new product. Are there any updates on this issue?

@nimmneun
Copy link

nimmneun commented May 15, 2016

In case you're still having trouble ... getting rid of any square brackets + specifying a attribute_set_id seems to work:

{
    "product": {
        "attribute_set_id": 4,
        "type_id": "simple",
        "sku": "B201-SKU",
        "name": "B201",
        "price": 25,
        "status": 1,
        "custom_attributes": {
            "description": "Heavy Duty Brake Cables",
            "meta_description": "Some describing text w00t"
        }
    }
}

@piotrekkaminski
Copy link
Contributor

@mamof if you still have this issue and @nimmneun solution does not work for you, please open a new issue.

pdohogne-magento pushed a commit that referenced this issue Mar 26, 2019
…-xss-fotorama-broken

[honey] MC-15033: Configurable product gallery does not prepend images with multiple attributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants