Open PieterJacob opened 3 months ago
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.
This issue has been linked to a new work item: W-16457498
Hi @PieterJacob, Thank you for filing this issue, and sorry for the inconvenience. Yes, this is a bug, and it's also a known issue. We have received it twice in the past, and as you stated as a workaround, both times the Apex Replay Debugger started working again after deleting the apex.db
file. I filed a bug in my team's backlog.
In the meantime, can we get some info from you to help us reproduce it on our end? We would like the following info:
Hi @daphne-sfdc, Thank you so much for taking your time and responding to this issue. See below for my input regarding your questions.
1. Org Id of your org This issue seems org unrelated. Like mentioned, this issue occurs for everyone in our team and for each newly created scratchOrg.
2. Org shape (how many Apex classes, Apex test classes, custom objects, size of each Apex class/test class) We have around 2500+ classes in our code base, 400 of these calsses are test classes. We have around 250 custom objects (including custom metadata types and custom settings).
3. How long is a typical Apex Replay Debugger session before you see that error and have to delete the apex.db? Is this value consistent across the developers on your team? Also this seems unrelated. It seems to happen for every .log file. The last example I could find was a debug file of around 2mb where the issue occurred.
Hi @PieterJacob, Thank you for providing the above details. I tried creating a project with 2400 Apex classes and 400 Apex test classes, but I was unable to reproduce your issue by running Apex Replay Debugger on that project. Our next step would be to ask you to share a zip file of your project and the credentials of your scratch org with us, but for security reasons, we don't work with credentials via unsecured channels like Github issues or email.
Can you file an official Salesforce support ticket and route that ticket to us, the IDE Experience Team? We'll continue working with you on this issue via the Investigation. Thank you.
Hi @PieterJacob, are you still seeing this issue?
Hi @daphne-sfdc and @diyer,
Sorry for my late response. The issue still occurs and I think that I now have a better understanding when the issues occurs. I noticed that when working on the same branch and scratchorg, and once I had removed the apex.db file the issues were resolved and I could create numerous new debug files and debug without the error occurring.
But... once I created a new branch and scratchorg and loaded my first debug file the error appeared again straight away. My colleagues also confirmed this. Important to add is that the the branch switch potentially causes a source code difference, since new classes and objects were added in the previous branch.
So it seems that the error is likely to show when you switch to a new branch and scratchorg - and possibly new objects such as classes and SObjects had been added in the previous branch - and start a new debug session. Hope this new insight helps to solve the issue.
Peter,
Hello @PieterJacob,
I tried creating a new branch and new scratch org, then running Apex Replay Debugger on a file only present in that branch and scratch org. I then switched to a branch and scratch org without the file that I ran the ARD on, and used the log generated from the first run to run ARD on the second branch and scratch org. Despite the file not being present, I was still not seeing the error that you're getting.
In this week's release v61.10.0, our team added additional telemetry to Apex Replay Debugger to aid in diagnosing issues such as yours. Can you please update your Salesforce Extensions for VSCode to the latest version and rerun the Apex Replay Debugger to get the error? And also, can we get your machine ID so that we can use it to find your info in our telemetry? (Please email the machine ID to us at svc_idee_bot@salesforce.com instead of posting it in a public Github issue.)
@PieterJacob we will need your help in providing details that @daphne-sfdc requested above.
Hello!
I'm also experiencing this issue, in my case, I have the sensation that is related to rapid changes in apex classes, for example changing branches that have a lot of changes between them
In our case we have a lot of classes, more than 7K
How do you get the machine id?
@daphne-sfdc, Thanks for your answer. I will update my cli and provide the information as soon as I receive the same error again, I will ask my colleagues as well.
Now do I get my machine Id?
@PieterJacob I recommend using the Salesforce CLI Id. The same value is sent in telemetry and it is easy to discover.
run sf telemetry
and the output will look like this
sf telemetry
Telemetry is enabled.
Telemetry tmp directory is .......
Telemetry cache directory is ........
Salesforce CLI ID is 7e...................................b1.
capture the hexadecimal string value for Salesforce CLI ID
and email it to the address noted earlier.
Hi @PieterJacob and @mnunezdm,
What is your current value in the Salesforcedx-vscode-apex › Java: Memory
setting? (If it's a blank value, the default is 512MB.)
If you have a blank value or lower, can you try increasing your memory allocation for the Apex Language Server to 1024 and see if that resolves the issue?
@daphne-sfdc,
Thanks for the tip. The value was blank and I changed it to 1024. I'll make sure to test this in the upcoming week and keep you posted about my experiences regarding debugging.
@daphne-sfdc,
I updated the value of Salesforcedx-vscode-apex › Java: Memory
to 1024, but unfortunately, as soon as I created a new branch and scratch org, bam! I received the error again.
It really seems that when you switch from one branch to the other and the new branch contains a reasonable amount of object differences, that it is more likely to have to error to occur.
Hi @PieterJacob, Sorry to hear that the workaround didn't work.
We're currently tracing back the error message in our codebase. To help us identify the correct path, can you please provide your Salesforce CLI ID by running sf telemetry
in your Terminal as @peternhale suggested in his earlier message? Please email it to us at svc_idee_bot@salesforce.com.
@daphne-sfdc,
Thanks a lot. I have just send svc_idee_bot@salesforce.com an email with my Salesforce CLI Id. Hope this helps, thanks.
Peter,
@PieterJacob We found this old issue where the error that you're getting is caused by the presence of both a static and non-static variable of the same name in the same scope. Using the code in the image below (image taken from the thread of that old issue), I was able to reproduce the issue when running Apex Replay Debugger from the anonymous Apex file.
Can you please verify that you don't have both a static and non-static variable of the same name in your code?
Hi @PieterJacob,
Another question: In a previous message I saw you wrote "The last example I could find was a debug file of around 2mb where the issue occurred."
From that statement, I was wondering: What is the size of the Apex classes that you are running the Apex Replay Debugger on? I'd like to get an approximate idea of the number of lines of code that you have in your Apex classes.
@PieterJacob Two more things:
Telemetry: Telemetry Level
in VSCode settings to all
.
b. Check the box for Salesforcedx-vscode-core > Telemetry: Enabled
.
c. Type sf telemetry
in your Terminal and make sure you see the "Telemetry is enabled" message.@daphne-sfdc, I highly doubt we have classes in our system that both have a static and instance specific variable that share the same name, I would have expected that the compiler would scream at you in this instance. Besides, I don't know a way to check this other than looking over all classes individually.
Regarding our class sizes. We try to keep classes small and concise. I would say by average classes have no more than 1000 lines, with an average of 200 lines.
Ill make sure to update my CLI version. Thanks.
Hi @PieterJacob, One more request: Please do the following steps:
Here's a short video of how to do the above instructions:
https://github.com/user-attachments/assets/627a2afc-3e6b-41de-96e7-3abb60c02cfa
This issue has not received a response in 3 days. It will auto-close in 2 days unless a response is posted.
@PieterJacob Thank you for your patience but we need one last thing from your end to try. Can you please refer to Daphne's comment above and share the contents of your output tab?
This issue has not received a response in 3 days. It will auto-close in 2 days unless a response is posted.
Hi!
I was having the error earlier this day
I sent requested info to svc_idee_bot@salesforce.com
@diyer @daphne-sfdc
Hi @daphne-sfdc — I'm seeing this error and deleting apex.db and then reloading VS Code seems to work around it. I sent a stack trace and CLI ID to svc_idee_bot@salesforce.com.
Summary
When trying to debug a .log file using the replay debugger, after right clicking on the .log file and choosing "SFDX: Launch Apex Replay Debugger With Current File", often an error is thrown: "Apex language server could not provide information about valid breakpoints". This happens to multiple developers in our team.
This issue is something that has already occurred for many months
Steps to Reproduce:
It is difficult to reproduce since it is unclear what causes this issue. But by describing the possible work around, it might clarify more what can cause this issue and how to fix it properly.
Workaround
My assumption is that deleting the apex.db file and starting the replay debugger again creates a new apex.db file that is correctly in sync with the project, what might also explain the underlying issue, i.d. that the apex.db after a while gets out of sync...
Expected Result
There should occur no error and the Replace Debugger should start without any errors.
Actual Result
After right clicking on the .log file and choosing "SFDX: Launch APex Replay Debugger With Current File" an error occurs: "Apex language server could not provide information about valid breakpoints".
Additional Information
Below screen shows how to activate the Replay Debugger Followed by error: The workaround is to delete the apex.db file:
Salesforce Extension Version in VS Code: v61.7 Salesforce CLI Version: @salesforce/cli/2.51.6 win32-x64 node-v20.15.0
OS and Version: Name: Windows 11 Edition: Windows 11 Enterprise Version: 23H2
VS Code Version: 1.92.0