Skip to content

Can't cancel the order #4567

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

Closed
jsakars opened this issue May 19, 2016 · 26 comments
Closed

Can't cancel the order #4567

jsakars opened this issue May 19, 2016 · 26 comments
Assignees
Labels
Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed

Comments

@jsakars
Copy link

jsakars commented May 19, 2016

Steps to reproduce

  1. Install Magento 2.0.6
  2. Place an order
  3. Try to cancel it via admin

Expected result

  1. Order is cancelled

Actual result

  1. Error is shown: "You have not canceled the item."

There is no button or anything else to cancel item(s) ordered. How should order normally be cancelled?

@NadiyaS
Copy link
Contributor

NadiyaS commented Jun 1, 2016

Hi @werdlv ,
This bug is not reproducible neither on 2.0.6 nor on 2.0.7 versions.
Please provide more detailed steps to reproduce. E.g. ordered product type, shipping method, payment method, etc.

@jsakars
Copy link
Author

jsakars commented Jun 1, 2016

@NadiyaS there isn't much to add really - simple product, any of standard shipping, payment option. I am not able to reproduce it on 2.0.7

@NadiyaS
Copy link
Contributor

NadiyaS commented Jun 2, 2016

@werdlv ,
so if this bug does not exist on latest Magento version then we can close this issue.
Feel free to reopen this issue if you think you have encountered a bug on latest Magento version.

@NadiyaS NadiyaS closed this as completed Jun 2, 2016
@romeof1980
Copy link

hi @werdlv ,
we were able to reproduce it in Magento 2.1.2
It's not really an issue, because you probably tried to cancel an order with status "processing".
you can indeed cancel an order with status "pending" but not with status processing, because that means you've probably already printed some docs (i.e. the invoice) or there has been a transaction.

try to check if that can be the problem. It's a normal behaviour.

cheers!

@franciskim
Copy link

I've been able to reproduce it in 2.1.7 and have recorded it as an animated gif here: Magento 2 Issue – Can’t Cancel Orders

@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Nov 13, 2017
@germaike
Copy link

germaike commented Feb 8, 2018

@franciskim Did you get an answer on your problem. Having the same issue on my install as well. It is also a 2.1.7.

@LiamKarlMitchell
Copy link

LiamKarlMitchell commented Jun 18, 2018

Still happening. Magento 2.2.0
Trying to cancel a Processing order. (Same if it's Held).
User does have cancel permission.

If it helps any.
Order is in processing stage, to be canceled.
Payment Method: Paystation

@sarfarazbheda
Copy link
Contributor

Also facing the same issue.
Order status: Processing
Cart price rule was applied while placing an order.

When tried to cancel the order from the Mass action, Magento throws below error:

-- SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (production.salesrule_customer, CONSTRAINT SALESRULE_CUSTOMER_RULE_ID_SEQUENCE_SALESRULE_SEQUENCE_VALUE FOREIGN KEY (rule_id) REFERENCES sequence_salesrule (sequence_value) ON DELET), query was: INSERT INTO salesrule_customer () VALUES ()

When tried to cancel the order from the order detail page, showing below error:
-- You have not canceled the item.

Temporary solution:
Deleted applied_rule_ids field's data from sales_order table and canceled order.

Please look into this and resolve it.

Thanks.

@sarfarazbheda sarfarazbheda reopened this Dec 17, 2018
@ghost
Copy link

ghost commented Dec 24, 2018

@sarfarazbheda, could you provide more details? Which Magento version do you use? How did you set up cart price rules? Please provide verbal description or at least screenshots.

@ghost ghost removed the Progress: needs update label Dec 24, 2018
@ghost ghost self-assigned this Dec 24, 2018
@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-andrii. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf 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 branch

    Details- Add the comment @magento-engcom-team 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. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@sarfarazbheda
Copy link
Contributor

Using Magento Version: 2.2.5 [Upgraded from Magento 2.1.8]

Find the screenshots for reference:
screenshot2018-12-14at10 40 20am
cart-price-rule

@ghost
Copy link

ghost commented Dec 24, 2018

@magento-engcom-team give me 2.3.0 instance

@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-andrii. Thank you for your request. I'm working on Magento 2.3.0 instance for you

@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-andrii, here is your Magento instance.
Admin access: https://i-4567-2-3-0.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@ghost
Copy link

ghost commented Dec 24, 2018

@magento-engcom-team give me 2.2.7 instance

@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-andrii. Thank you for your request. I'm working on Magento 2.2.7 instance for you

@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-andrii, here is your Magento instance.
Admin access: https://i-4567-2-2-7.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@ghost
Copy link

ghost commented Dec 24, 2018

@sarfarazbheda, thank you for details that you provided. Unfortunately, I was not able to reproduce it on 2.3.0.

@ghost ghost closed this as completed Dec 24, 2018
@ghost ghost removed their assignment Jan 9, 2019
@LiamKarlMitchell
Copy link

@magento-engcom-team give me 2.2.0 instance

@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

Hi @LiamKarlMitchell, here is your Magento instance.
Admin access: https://i-4567-2-2-0.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@LiamKarlMitchell
Copy link

LiamKarlMitchell commented Jan 17, 2019

@magento-engcom-team How can I add a processing status to the order and partial payment?
Is there a way to install plugins or access the DB?

@elioermini
Copy link
Member

I've recently had the same issue on 2.2.7 when a promo rule was applied and the order was in processing status, deleting the value in the sales_order table as suggested by @sarfarazbheda fixed it but of course, should be fixed the issue in the code.

@elioermini elioermini reopened this Mar 1, 2019
@ghost
Copy link

ghost commented Mar 7, 2019

HI @elioermini this is expected behavior, if you have order in status processing, please do the credit memo.
note: also not able to reproduce on 2.2-develop and 2.3-develop branches

@ghost ghost closed this as completed Mar 7, 2019
@elioermini
Copy link
Member

@engcom-backlog-nazar looks like this issue has been fixed here, thanks #19230

magento-engcom-team pushed a commit that referenced this issue Aug 13, 2019
MC-16684: Shipping Calculation In Cart Does Not Always Load Correctly
@adarshkhatri
Copy link
Contributor

It happened in 2.3.3-p1 too.

The order had invoice and the invoice was in pending mode. I could cancel the invoice then the "Cancel" button was populated for that order. Then I hit the cancel button then the above error thrown. In exception.log I see this:

[2020-05-20 23:29:38] report.CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (db.salesrule_customer, CONSTRAINT SALESRULE_CUSTOMER_RULE_ID_SEQUENCE_SALESRULE_SEQUENCE_VALUE FOREIGN KEY (rule_id) REFERENCES sequence_salesrule (sequence_), query was: INSERT INTO salesrule_customer () VALUES () {"exception":"[object] (Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (db.salesrule_customer, CONSTRAINT SALESRULE_CUSTOMER_RULE_ID_SEQUENCE_SALESRULE_SEQUENCE_VALUE FOREIGN KEY (rule_id) REFERENCES sequence_salesrule (sequence_), query was: INSERT INTO salesrule_customer () VALUES () at /vendor/magento/framework/DB/Statement/Pdo/Mysql.php:110, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (db.salesrule_customer, CONSTRAINT SALESRULE_CUSTOMER_RULE_ID_SEQUENCE_SALESRULE_SEQUENCE_VALUE FOREIGN KEY (rule_id) REFERENCES sequence_salesrule (`sequence_) at /vendor/magento/framework/DB/Statement/Pdo/Mysql.php:91)"} []

Upon checking the sales_order table, I see that applied_rule_ids had 25. Upon checking in the system for any catalog rule or cart rule with that ID, it looks like it's already deleted.

Also, I see that 25 does exist in sequence_salesrule table. Is this mean when deleting the cart/catalog rule it supposed to delete from sequence_salesrule table too?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed
Projects
None yet
Development

No branches or pull requests