Bulk status returning FINISHED_WITH_ERRORS status while is IN_PROGRESS
@parsoya is already working on this.
Since Sep 8, 2026.
- Dominant language
- PHP
- Stars
- 12.2k
- Forks
- 9.4k
- PR merge metrics
- No merged PRs in 30d
Description
### Preconditions and environment
- Magento version: 2.4.5-p1
- Anything else that would help a developer reproduce the bug
### Steps to reproduce
1. Schedule many operations under same bulk with `BulkManagementInterface::scheduleBulk`
2. Before all operations finish the execution get the status of the bulk with `BulkStatusInterface::getBulkStatus`
### Expected result
Bulk status is NOT_STARTED (0) when all operations are OPEN (4)
Bulk status is IN_PROGRESS (1) when at least one operation is OPEN(4)
In other words, bulk status is only in FINISHED_* (2,3) state when all operations are not OPEN(4)
### Actual result
Bulk status is FINISHED_WITH_FAILURE (3) when some operations are COMPLETE(1) and OPEN(4).
It returns FINISHED_SUCCESSFULLY (2) once all operations are COMPLETE (1).
### Additional information
Logic is implemented in this function: https://github.com/magento/magento2/blob/7c6b6365a3c099509d6f6e6c306cb1821910aab0/app/code/Magento/AsynchronousOperations/Model/BulkStatus.php#L140-L181
I created a dedicated magento module to reproduce the issue (see README file for details):
[magento2-gh-36911-main.zip](https://github.com/magento/magento2/files/10813352/magento2-gh-36911-main.zip)
The execution of the command provided in the module outputs the following log which confirms the issue:
```
[2023-02-23T12:03:32.740515+00:00] main.INFO: Bulk id created {"issue":"gh-36911","bulkId":"2e04e5a5-cfea-434b-95cc-33bb48eea1f3"} []
[2023-02-23T12:03:32.763650+00:00] main.INFO: Scheduled operation 1 {"issue":"gh-36911","bulkId":"2e04e5a5-cfea-434b-95cc-33bb48eea1f3"} []
[2023-02-23T12:03:32.771172+00:00] main.INFO: Scheduled operation 2 {"issue":"gh-36911","bulkId":"2e04e5a5-cfea-434b-95cc-33bb48eea1f3"} []
[2023-02-23T12:03:32.777690+00:00] main.INFO: Scheduled operation 3 {"issue":"gh-36911","bulkId":"2e04e5a5-cfea-434b-95cc-33bb48eea1f3"} []
[2023-02-23T12:03:32.779483+00:00] main.INFO: Bulk status before executing all operations is 3 {"issue":"gh-36911","bulkId":"2e04e5a5-cfea-434b-95cc-33bb48eea1f3"} []
[2023-02-23T12:03:32.793993+00:00] main.INFO: Bulk status before consuming operation 1 is 3 {"issue":"gh-36911","bulkId":"2e04e5a5-cfea-434b-95cc-33bb48eea1f3"} []
[2023-02-23T12:03:32.795633+00:00] main.INFO: Bulk status after consuming operation 1 is 3 {"issue":"gh-36911","bulkId":"2e04e5a5-cfea-434b-95cc-33bb48eea1f3"} []
[2023-02-23T12:03:32.800481+00:00] main.INFO: Bulk status before consuming operation 2 is 3 {"issue":"gh-36911","bulkId":"2e04e5a5-cfea-434b-95cc-33bb48eea1f3"} []
[2023-02-23T12:03:32.801980+00:00] main.INFO: Bulk status after consuming operation 2 is 3 {"issue":"gh-36911","bulkId":"2e04e5a5-cfea-434b-95cc-33bb48eea1f3"} []
[2023-02-23T12:03:32.806389+00:00] main.INFO: Bulk status before consuming operation 3 is 3 {"issue":"gh-36911","bulkId":"2e04e5a5-cfea-434b-95cc-33bb48eea1f3"} []
[2023-02-23T12:03:32.807890+00:00] main.INFO: Bulk status after consuming operation 3 is 3 {"issue":"gh-36911","bulkId":"2e04e5a5-cfea-434b-95cc-33bb48eea1f3"} []
```
### Release note
_No response_
### Triage and priority
- [ ] Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._
- [X] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._
- [ ] Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._
- [ ] Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._
- [ ] Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.