-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
FATAL ERROR: Database.executeBatch cannot be called from a batch start, batch execute, or future method. #615
Comments
@VigneshRS7101 do you have any additional information? I'm assuming you're using the most up-to-date version? With this sort of thing, it's going to be hard for me to assist without quite a bit more info - logs, with rollup logging enabled via the Org Default rollup control record, for instance. A good place to start is adding the parent recalc button to a parent record's flexipage and ensuring that for a singular record there are no issues recalculating. From there, we can work backwards to figuring out what the issue is. |
I am using v1.6.6 Example #1: There are 27 fields we need to run Rollup. If, we run a batch individually for every fields batch is successful, while for all fields it is failing. My assumption is, there is two execute methods in 'RollupAsyncProcessor' class. One is Database.batchable and other one is Queueable. In that second execute method (queueable) it is calling finish method. |
You're quite a few versions behind and I would recommend upgrading. From what you're saying, if singular recalcs are working, the issue is much more likely to be a CPU timing issue - which can occur when there is too much automation on the parent object(s) being updated. You might want to try lowering your Batch Chunk Size on the rollup control record to see if that helps. But again, I'd highly recommend upgrading to the latest version, as I am continually refining the performance of batch full recalculations and every little bit helps. Something else to note - enabling rollup logging consumes additional CPU time, and it should be disabled particularly for batch full recalcs when not debugging |
@jamessimone I've updated Package today, set rollup logging to false, and reduced Batch Chunk Size to 100. When I initiate Full Recalculation, it shows error "Batchable instance is too big". And, we don't have much automations on Parent object. Still hitting heap size limit. |
@VigneshRS7101 any chance you're able to reproduce this issue in a sandbox environment? It sounds like you'll need to increase the batch chunk size back up. Without being able to see logs, or getting a look at what's going in a lower environment, I can only guess at what the issue is. I will try to reproduce this issue, but I personally know of a few orgs running more rollups than what you've described without a problem. Hopefully we can work together to understand what's going on here |
@jamessimone |
@jamessimone I did run rollup batch for 350,000+ Parent records of 30, 100 & 1000 batch chunk sizes. It still throws error 'Batchable instance is too big'. Eventhough, for every batch heap size is around 5-6 MB. For single Parent, Maximum of 5000 child records are present. Can you help resolve me this. |
I don't think I'll be able to take a look at this issue this week. Try checking the box for |
@jamessimone Thanks for your help, I am attaching the logs from batch run. Also adding summary of our rollup process, which may help to find root cause.
Stack trace is not printed, you can take look in the logs. Logs are generated at Apex Finest level. apex-07LU7000006kyVZMAY (1).log |
Still looking into this. I've been running some full recalcs with 40+ rollups without issue so it's not at all the number of operations per batch chunk that's causing the issue. Yesterday I made some progress in investigating and at least now I have some hypotheses to test. I will keep you updated |
@VigneshRS7101 I've made progress on this issue, and I'm hopeful to soon wrap up that work and release it. Apologies that it's taken a while, but solving this particular problem in a scalable way has been my primary concern. I should have more details to share out on this soon. |
… batch chunks accessing state for parents that exist in multiple batch chunks
… batch chunks accessing state for parents that exist in multiple batch chunks
… batch chunks accessing state for parents that exist in multiple batch chunks
… batch chunks accessing state for parents that exist in multiple batch chunks
… batch chunks accessing state for parents that exist in multiple batch chunks
… batch chunks accessing state for parents that exist in multiple batch chunks
… batch chunks accessing state for parents that exist in multiple batch chunks
this is fixed in #636 |
Hi @jamessimone ,
I initiated "Start Rollup" from UI which is FULL RECALCULATION CMDT , batch apex 'RollupFullBatchRecalculator' is initiated but there are few failures occurs frequently. And, there was this error 'Database.executeBatch cannot be called from a batch start, batch execute, or future method.' Additionally, 'RollupAsyncProcessor' is queued multiple times. I see in one of your previous discussions Rollup "#139" it is not a expected behaviour. Even that is fixed, do you have solutions on why it is showing this error ?
I am experiencing much data mismatch issues because of this.
Thanks in advance
The text was updated successfully, but these errors were encountered: