-
Notifications
You must be signed in to change notification settings - Fork 407
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
Using "SFDX: Launch Apex Replay Debugger With Current File" often throws error "Apex language server could not provide information about valid breakpoints" #5717
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. |
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 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, 1. Org Id of your org 2. Org shape (how many Apex classes, Apex test classes, custom objects, size of each Apex class/test class) 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? |
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. 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. 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 [email protected] 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, 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
capture the hexadecimal string value for |
Hi @PieterJacob and @mnunezdm, What is your current value in the 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? |
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. |
I updated the value of 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 |
Thanks a lot. I have just send [email protected] an email with my Salesforce CLI Id. 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:
|
@daphne-sfdc, 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,
Here's a short video of how to do the above instructions: Screen.Recording.2024-09-06.at.3.45.01.PM.mov |
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 [email protected] |
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 [email protected]. |
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
The text was updated successfully, but these errors were encountered: