Open gibbotronic opened 4 years ago
Hi @gibbotronic. Thank you for your report. To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.3-develop instance
- upcoming 2.3.x release
For more details, please, review the Magento Contributor Assistant documentation.
@gibbotronic do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
@gibbotronic do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
* [x] yes * [ ] no
Yes this occurs on vanilla 2.3.2, honestly.
Hi @engcom-Charlie. 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:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.3-develop
branchDetails
- Add the comment @magento give me 2.3-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop
branch, please, add the label Reproduced on 2.3.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hello @gibbotronic I can't reproduce this issue on fresh Magento 2.3-develop. Manual testing scenario:
Please do not close this bug report!
You can clearly see from the code I mentioned in the report (app/code/Magento/ConfigurableProduct/Model/OptionRepository.php) that the exception handler is swallowing the exception thrown lower down. You can also clearly see this in the list of files I have included where this also happens. Respectfully, did you not look at the file I referenced??
This report is to highlight that the exception is being swallowed and no helpful message is being returned. Do you want me to provide a series of requests so that you can repeat this?
By closing this, are you saying that: a. you want unhelpful messages to be output when failures occur? b. you are are happy that Magento does not reveal the real cause of a failure?
@gibbotronic it looks like a feature request. So i think we need to transfer this issue to feature requests repository. @sdzhepa can you help with it?
Hi @sdzhepa. 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:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.3-develop
branchDetails
- Add the comment @magento give me 2.3-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop
branch, please, add the label Reproduced on 2.3.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
@gibbotronic it looks like a feature request. So i think we need to transfer this issue to feature requests repository.
@engcom-Charlie ok thanks. If this can get resolved somehow I would appreciate it because I think the messages should be more helpful and indicative of the underlying problem instead of the vague "it didn't work" messages. Someone else had this problem (https://magento.stackexchange.com/q/267855) but it is not clear if this is on 2.3.2 or 2.3.1.
I will try to write a series of curl requests at some point so this can be duplicated.
This issue affects a number of places as indicated in my original report. Thanks.
Based on the description and label feature request
the issue has been transferred to Magento Feature Request public repo.
Save failure exceptions are swallowed/hidden, leaving the poor end-user completely baffled as to why something is failing. The helpful exception message should be shown so that we know how to resolve it.
Preconditions (*)
Steps to reproduce (*)
Discover the options related to your product already, eg. a GET from http://127.0.0.1/rest/V1/configurable-products/14029/options/all returns
POST to this product's options with the same data, eg. a POST to with
This returns a HTTP 400 with the data:
As you can see this does not tell you what is wrong. It simply states that "An error occurred while saving the option.".
Tracing this through, the underlying file at lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php save tries to save the object but catches a DuplicateException exception ("Unique constraint violation found"). This is caught in app/code/Magento/ConfigurableProduct/Model/OptionRepository.php in the function
which has the very message we need to know ('unique constraint violation') in the exception that is has caught:
Instead of passing $e's message out, it just returns the very unhelpful message that it has failed. It should pass the appropriate exception message out so that the poor user (me) can work out what is going on without having to trace through all of this code just to find out what the problem is.
This problem occurs in other places across the codebase as a very casual
grep -R "throw new CouldNotSaveException" .
shows, eg.Expected result (*)
Actual result (*)