Giter VIP home page Giter VIP logo

Comments (48)

CristiCanizales avatar CristiCanizales commented on July 19, 2024 2

As discussed with @angielaz, After a lot of debugging and tests, we came up with the conclusion that the issue is server side and suggested to file an investigation on Apex Team. Thank you again for your patience!

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024 1

This is very helpful @angielaz ! Our team will continue to dig into this and get back to you. The information you provided will be helpful to dig deeper. We will reach out to you if we need more information.

from salesforcedx-vscode.

CristiCanizales avatar CristiCanizales commented on July 19, 2024 1

Hi @angielaz, could you try the following steps:

  1. Log out from all authorized orgs
  2. Delete .sf/.sfdx folders
  3. Clone dreamhouse-lwc repo
  4. Open dreamhouse-lwc in VS Code and set up debugger in launch.json (with "trace": true)
  5. Re-auth to your org
  6. Launch debugger and try again
  7. Share logs

from salesforcedx-vscode.

CristiCanizales avatar CristiCanizales commented on July 19, 2024

Hi @angielaz, did you follow these steps to set up the debugger?

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

Hi @angielaz, did you follow these steps to set up the debugger?

Hey @CristiCanizales, yes I did. All sub steps of step number 4 of that page. Since I'm not using a scratch org, I'm using a developer sandbox, I jumped the steps to create a scratch org. Is this a correct assumption?

Let me know and thanks!

from salesforcedx-vscode.

CristiCanizales avatar CristiCanizales commented on July 19, 2024

I believe you're missing the DebugApex permission, since you started in step 4.
Can you check that?? There's related info in #2737

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

Hi @CristiCanizales, step 1-3 is related to create scratch orgs and yes.. I skipped those steps. I'm using a developer sandbox instead.
Step 4 is all about creating the Debug Apex permission set and yes.. I did that.
Here are some screen shots.
Debug Apex permission set details,
image

image

I can also guarantee that I have just been upgraded to a Salesforce Unlimited, so, I should be able to use Apex Interactive Debugger. Right?

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

@angielaz can you provide the org id of the sandbox org you are trying to debug?

from salesforcedx-vscode.

git2gus avatar git2gus commented on July 19, 2024

This issue has been linked to a new work item: W-15137334

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

@angielaz can you provide the org id of the sandbox org you are trying to debug?

Hi @diyer, thanks for your attention.
My sandbox org Id is: 00DTA000000fVgN

Let me know if anything else is needed.

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

@angielaz could not find anything suspicious in the logs. Are you consistently seeing this? Did you retry debugging?

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

@angielaz could not find anything suspicious in the logs. Are you consistently seeing this? Did you retry debugging?

Hey @diyer, sorry, I haven't been using it since I have this sandbox just to test Apex Interactive debugger.
But this error has been consistently appearing. I couldn't go further the first line where I've my first breakpoint.

Some recap, I start a session and this is how it looks,
image

Change a contact on my sandbox. Add a phone number and although I can see several messages appearing on the debug console, even my first breakpoint on line 35, the vars are not loaded and have no visual indication of the debugger in VS Code like the line it should have stop etc and the debugger panel is completely empty

image

I click step over and it was able to load the vars and I can inspect them, but when I click step over again the error appears and I can't move forward. It gets stuck in here.
image

Sometimes I can't even stop on a line. And have to stop the session from vscode and from the sandbox as well.
I have the impression, from the messages I get from the debug console, that the debugger seems to be there and move on when I click play, is just that it doesn't load the info on VS Code debugger.. if that makes sense..

Let me know and thanks!

[EDIT] If it helps I tried this today around 10:40 (UTC+00:00)

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

Thanks @angielaz, while we continue to look into this, do you see anything in logs on your end?
F1 -> Show logs

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

Sure @diyer, those were the only ones throwing errors,
image

Let me know if other logs are needed.. and if that explains something. Thanks!

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

Can you check if there is something in Extension Host logs?

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

have a few warnings,
image

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

Thanks @angielaz , one last ask, do you see any logs for Apex Debugger extension itself?

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

so, not sure I got it, but I've started the debugger from vs code and this was the only message that appeared on the Extension Host logs (the last line)

image

let me know if this corresponds with what you asked

[EDIT] When I killed the debugger session this error appeared (in case it helps)
image

from salesforcedx-vscode.

CristiCanizales avatar CristiCanizales commented on July 19, 2024

Hi @angielaz could you share the code you're trying to debug? We're trying to replicate issue with a very similar context than yours 🙌

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

@angielaz As Cristi said, it will be good if you could provide us the triggerHandler and the code that calls it (atleast the snippet where it is gets blocked) so we can reproduce it.

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

Hey @diyer @CristiCanizales, don't think is specific of that code since even a simple unit tests fail do work.
If I run the unit test from VS code I get the error: "You cannot debug async requests".
If I run the unit test from the org, I get the same behaviour reported so far. See things in the debug console that seems to indicate that the debugger should be showing something but it doesn't and the error appears: "An unknown error occurred. Please consult the log for more details".
So, created a simple Unit Test, here is the code:
`
@istest
public with sharing class ApexDebuggerTest {

@isTest
private static void someTest() {

    Account acc = new Account(Name = 'Apex Debugger test');
    insert acc;

    Account accRetrieved = [SELECT Id, Name FROM Account WHERE Name = 'Apex Debugger test'];

    Assert.isNotNull(acc, 'An account should have been retrieved');
}

}`

Run the tests from the developer console, since from VS Code I only get the error: "You cannot debug async requests".

And the same behaviour happens. Stops on the first line but doesn't go further than that and the error appears: "An unknown error occurred. Please consult the log for more details"

Debug console shows this (I've "trace": "all" on my launch.json file):
image

And this is what I see in the Extension Host Logs:
image

The ones at 9h23 was using that test class.

Let me know and thanks.

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

@angielaz you mentioned you get the same error from Developer Console. Can you please attach a screenshot of that error?

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

Hi @diyer, I might not have been very clear here. When I say I get the same error, I mean I get the same error I've reported since I opened this issue in VS Code (first image from my previous comment) also when I run the unit tests from developer console.
Why I had to do that? Because if I run the test from VS Code I get the "You cannot debug async requests" error instead (and in VS Code).

Hope this clarifies.

from salesforcedx-vscode.

CristiCanizales avatar CristiCanizales commented on July 19, 2024

@angielaz so having the debugging session in VSCode, you run the tests from the Developer Console and you get the same old error IN VSCode?

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

@angielaz so having the debugging session in VSCode, you run the tests from the Developer Console and you get the same old error IN VSCode?

@CristiCanizales Yes, exactly. Because if I run the test from VSCode I get "You cannot debug async requests" error instead (and in VSCode). like a pop up on the right bottom corner.

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

@diyer @CristiCanizales We have just been upgraded to Salesforce Unlimited (which comes with the Apex interactive Debugger among other things) and we never use it before. I'm the first one in my team trying to use it. Could it be that we are missing some configuration? Something else? I don't know... it's weird... just a thought.

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

@angielaz Can you take a look at this doc and make sure you have followed all the required steps. https://code.visualstudio.com/docs/editor/debugging

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

@diyer Can't see anything there that I should have done and didn't. I've the Salesforce Extension Pack installed. Can see the Apex Interactive Debugger extension that came with the Pack. Created a launch.json file like it's mentioned here: https://developer.salesforce.com/tools/vscode/en/apex/interactive-debugger#set-up-apex-debugger

Here is my launch.json generated:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Apex Debugger",
"type": "apex",
"request": "launch",
"userIdFilter": [],
"requestTypeFilter": [],
"entryPointFilter": "",
"sfdxProject": "${workspaceRoot}",
"trace": "all"
}
]
}

I just changed sfdxProject to "${workspaceRoot}" as it's mentioned on salesforce apex debugger official site and add the trace:"all" because this debugger never worked for me and always retrieving the same old error and thought it could help me understand the problem.

Any other step that you think I might have missed from that page?

from salesforcedx-vscode.

CristiCanizales avatar CristiCanizales commented on July 19, 2024

Hi @angielaz, we're waiting for confirmation from owners but we think it actually has to do with the fact that you're not using a Scratch Org. Could you please try just following all steps here and let us know if you are able to debug in a scratch org? That way we can confirm this is nothing to do with your environment.
If you run into issues with steps 4.13, go to Home > Setup > Users and add the Permission Set there
image

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

@angielaz Just noticed that in the screenshot you attached here #5454 (comment) , the debugger seems to have hit the breakpoint you set at line 35 and has also loaded the variables. From what I understand you were not able to do that before?

from salesforcedx-vscode.

CristiCanizales avatar CristiCanizales commented on July 19, 2024

hi @angielaz, just following up to check if you were able to successfully use the apex debugger with a scratch org?

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

@angielaz did you get a chance to take a look at above questions and suggestions?

  1. try to use this on a scratch org following the steps here https://developer.salesforce.com/tools/vscode/en/apex/interactive-debugger#set-up-apex-debugger
  2. In the screenshot you attached here #5454 (comment) , the debugger seems to have hit the breakpoint you set at line 35 and has also loaded the variables. From what I understand you were not able to do that before?

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

Hi @diyer @CristiCanizales I haven’t got the chance to try with a scratch org yet. Sorry. Will let you know once I do. Regarding suggestion/question 2 sometimes I can see all the bars etc but it’s just once and when I try to go further the same error appears. That’s is why I mention instanbility in this issue. But I could never fully debug a simple method. Hope this clarifies

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

Thanks for getting back @angielaz . I was looking for telemetry data fro your org but did not find any. Can you please ensure telemetry is turned on and run debugger again? that way we can get more information.

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

Hi @diyer and @CristiCanizales I've tried with a scratch org and running the unit tests from VS Code returns this error:
image

If I run the unit tests from the scratch org I get the same old error,
image

If I go back to my sandbox and turn Telemetry on, I tried:

  1. to run the unit tests from VS Code and got the same,
    I get the same error (You cannot debug async requests).
    image

  2. then I tried to run the unit test from the developer console and I got the same old error
    image

let me know what you were able to see on the metrics. Thanks!

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

@angielaz Thank you for trying the suggested things! Can you provide the orgid of your scratch org please?

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

removed

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

@angielaz Continuing to debug on this one, can you please try one thing. To see any errors that we aren't handling you can toggle the Developer console via the command pallet: 'Developer: Toggle Developer Tools'. That will open the dev tools where you can view the console for any errors being thrown. Can you please run apex debugger and copy paste this error that you see on Dev Tools Console?

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

Hi @diyer, this was all I saw,
image

Looking at the entire log on the Dev Tools Console since I open VS Code, starter the debugger session and run the unit test, if I filter by that error appears nothing.

The only thing I saw was this error when I stop the debug session from vscode,
image

ERR Invalid debug adapter: Error: Invalid debug adapter

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

@angielaz The above steps by @CristiCanizales will help us understand if this is a project specific issue. Dreamhouse-lwc is a sample app by Salesforce that we use for testing. If you can try the above steps on your scratch org and let us know the results, that would be great. Thank you so much for your patience 🙏

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

Hey @diyer @CristiCanizales,
I'm using the scratch org that does not contain any of the code in my repository and deployed the code from the dreamhouse-lwc repository
I did what you requested and if I try to run a unit test in that code from vs code I get the same error "You cannot debug async requests"
image

If I run the unit test from the dev console I get the same old error,
image

I ran it again at the same happens.. it seems it's stuck but shows nothing on the debugger
image

and when I click step over it shows the old error again.

This is the logs,
image

The latest error appears when I stop the debugger from vscode.

Don't think this is related to the project and I really appreciate your efforts, but maybe this is something on the org. If this is something over you reach, I'm happy to open a case directly with salesforce.

Let me know and thanks!

from salesforcedx-vscode.

diyer avatar diyer commented on July 19, 2024

@angielaz thank you for trying this with the project we suggested that helps us eliminate the possibility that this is project specific issue. Since you are seeing this on a scratch org as well (in addition to your sandbox org), we doubt if this is a org specific issue. And with all the experiments done, it alludes to more of an environment issue. Has any one on your team been able to use the debugger?

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

Hi @diyer, no, another colleague tried and got the same error.

from salesforcedx-vscode.

CristiCanizales avatar CristiCanizales commented on July 19, 2024

hi @angielaz, did the other colleague use the same org to try?

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

Hi @CristiCanizales, no, he use his sandbox and laptop and vscode etc

from salesforcedx-vscode.

CristiCanizales avatar CristiCanizales commented on July 19, 2024

Hi once more @angielaz! Thanks for working with us to debug your issue. We need to dig into your situation a bit more deeper, so we’d like to add you to our IDE Friends Slack channel to collaborate more efficiently. Email our team at [email protected] and we’ll get you added to our customer channel.
If you’d like to continue working with us via GH instead, feel free to continue the conversation here. Thanks!

from salesforcedx-vscode.

angielaz avatar angielaz commented on July 19, 2024

Hey @CristiCanizales, email sent. Thanks!

from salesforcedx-vscode.

github-actions avatar github-actions commented on July 19, 2024

This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.

from salesforcedx-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.