Skip to content

REST API "The product can't be saved" #26053

Open
@Zyles

Description

@Zyles

Another case of bad error message feedback.

No logs other than the REST API giving terrible error message and a whole bunch of Googling has to be done.

In my case I tried to upload an image through the rest API using POST to /rest/V1/products/<sku>/media

The issue has to do with products having required fields that are not filled in. This could arise after changing attribute sets and not going back to fix it on old products for example.

The solution is to go into admin, filling in the required fields for the product, then trying to upload the image again.

Preconditions (*)

  1. Magento 2.3.3

Steps to reproduce (*)

  1. Have required fields on product that are not filled in
  2. Try to upload image using REST API

Expected result (*)

  1. Better error message that is actually helpful.
  2. Log output in var/log

Actual result (*)

  1. Terrible error message.
  2. No logs
  3. Not being able to upload the product image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      Ready for Grooming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions