-
Notifications
You must be signed in to change notification settings - Fork 78
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
Unexpected error while executing anonymous apex. Cannot read properties of undefined (reading 'DebuggingInfo') #2630
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
Are you able to repro this with another org? I looked at the library code and it always set this so the response the header containing the debug log, docs also mention there's a limit of 1000 request per day, after that request will work but not include the header. |
@cristiand391 I have noticed that error only manifests every now and again, but it is persistent once I start to hit it. It has become much more prevalent since I started using Illuminated Cloud for development. This link explains why it only happens sometimes and how to get it to go away (create a new scratch org). This seems like a bug if there is a chance that the soapenv:Header may not be included in every response. |
Agree, at least that's what the docs say if you pass that limit. I modified the library to make +1000 requests with the same org but it still gets the header so I can't exactly repro. Will mark as bug to add a warning to mention the API limit but there's no workaround to get the logs in those cases. |
This issue has been linked to a new work item: W-14750755 |
Thanks. I wish I had better info to reproduce it. I know I've seen it in at least two scratch orgs. |
Update: I am not getting the error today, same scratch org. I double-checked that my workaround was removed from the cli code. More strong evidence that this issue was caused by reaching a 24-hour rolling limit. |
Should have a fix in soon. forcedotcom/salesforcedx-apex#343 |
Summary
Whenever I execute anonymous apex via
sf apex run -f <file>
I get this error:Unexpected error while executing anonymous apex. Cannot read properties of undefined (reading 'DebuggingInfo')
JSON output of command
$ sf apex run -f ./scripts/apex/deleteScratchOrgData.apex --json
I was able to trace this issue to a specific line of code:
node_modules/@salesforce/apex-node/lib/src/execute/executeService.js:117:69
logs: soapResponse[types_1.soapEnv][types_1.soapHeader].DebuggingInfo.debugLog
When I JSON.stringify the soapResponse, I do not see any key called
soapenv:Header
. Here is the output I am seeing:I was able to workaround this issue by optional chaining
soapenv:Header
:logs: soapResponse[types_1.soapEnv][types_1.soapHeader]?.DebuggingInfo.debugLog
Steps To Reproduce
Execute anonymous apex against a scratch org using
sf apex run -f <file>
Expected result
Execution completed without error
Actual result
Execution throws an exception while parsing the soap response
System Information
Additional information
The text was updated successfully, but these errors were encountered: