cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BAS | Business Application Studio Debugger not working or not attaching

jbibal-pdc
Explorer

Hi,

As of last night, something weird happened to the SAP Business Application Studio.

The debugger no longer attaches to the debug configurations that I have created:

{
  "version": "0.2.0",
  "configurations": [
    {
      "command": "cds serve --with-mocks --in-memory?",
      "name": "cds serve",
      "request": "launch",
      "type": "node-terminal",
      "skipFiles": [
        "<node_internals>/**"
      ]
    },
    {
      "command": "cds watch --with-mocks --in-memory?",
      "name": "cds watch",
      "request": "launch",
      "type": "node-terminal",
      "skipFiles": [
        "<node_internals>/**"
      ]
    }
  ]
}

My breakpoints are now always "unbound" and the "WATCH" and "CALL STACK" Sections are also empty

Additionally, the terminal now shows as "openvscode-server$":

Before, it used to show the name of the folder / workspace, ie. like "test$":

This problem started around 12-14 hours ago. Was there any updates applied to SAP BAS?
Hoping for any assistance.

Thanks,

John

parthasaradhi
Explorer

Facing the same issue. Till yesterday Debugger used to work fine for me. But now I am also facing the sme issue as mentioned above. Do suggest any workaround to overcome this.

With Regards,

Partha.

We are having the same issues here. The problem must be related to the openvscode-server$ route because, even if I place the terminal in my projects root folder, when I execute the debuger it goes automatically to openvscode-server$ route.

For example. Here I am positioned in my projects folder:

When we click on the debuger it executes cds run in this route instead of our project:

Can anyone at SAP shed some light over this issue please?

Many thanks

glauco
Active Contributor

same here.

MikeDoyle
Active Contributor

Me too, thanks for raising John. I will raise an incident as well. I have noticed that the integrated terminal display has also changed, showing 'user: openvscode-server' instead of the folder name

MikeDoyle
Active Contributor

Raised incident 324677 / 2023

jbibal-pdc
Explorer

Thanks for raising the Incident Mike! Hopefully something SAP can fix soon.

sreehari_vpillai
Active Contributor

Facing the same. I also observed the change in terminal with "user: openvscode-server" . Perhaps, its something we will have to update in the launch.json .

Normal NdoeJS application can be debugged as usual . I raised a customer incident as well.

liat_b
Advisor
Advisor

Regarding the change in the terminal - It's another issue. Will be fixed too, but it shouldn't affect your work.

jbibal-pdc
Explorer
0 Kudos

Thank you for your feedback Liat (and Licam as well). Will keep this question open until a final fix is provided so that we may have a final resolution to the issue / concern.

Accepted Solutions (1)

Accepted Solutions (1)

jbibal-pdc
Explorer

Hi,

I think SAP finally fixed both issues after 2 weeks. The debugger now works again for type "node-terminal", as well as the "openvscode-server$" issue.

Really appreciate all the workarounds provided.

If the issue happens again, any of the workarounds provided in this thread should work:
https://answers.sap.com/answers/13872945/view.html
https://answers.sap.com/answers/13874671/view.html
https://answers.sap.com/answers/13877601/view.html

Thanks,
John

Answers (5)

Answers (5)

licam_oved
Advisor
Advisor

Hi,

There's currently a known issue with launch configuration of type: "node-terminal" which is the one used by default in CAP Node application template.

BAS dev team is checking this issue.

Meanwhile as a workaround please use this run configuration to debug your project:

{
"name": "cds serve",
"request": "launch",
"type": "node",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npx",
"args": [
"cds",
"serve",
"--with-mocks",
"--in-memory?"
],
"skipFiles": [
"<node_internals>/**"
]
}

Please copy paste the above launch configuration and pate it inside configurations array located in <Your project folder>/.vscode/launch.json.

If you didn't run npm install inside your project beofor, please run it now.

Thanks and best regards,
Licam

sreehari_vpillai
Active Contributor

tested this and working fine.

Sree

jbibal-pdc
Explorer
0 Kudos

Thank you for this work around. It does work fine for the time being. Will keep this question open until a final fix is provided so that we may have a final resolution to the issue / concern.

WonseokChoe
Explorer

Hi

# Show file `$HOME/.bashrc`

```bash

if [ -n "$SSH_CONNECTION" ]; then . $HOME/.dropbear_env

fi

```
The code checks if the length of the string "$SSH_CONNECTION" is greater than zero, and if so, it loads the file "$HOME/.dropbear_env". However, if you use $"SSH_CONNECTION", the value returned will be "SSH_CONNECTION", so the file "$HOME/.dropbear_env" will always be loaded even if you are not connected to a remote SSH. Therefore, the current path is displayed on the prompt as "$ openvscode-server", as defined in "$HOME/.dropbear_env".

It seems that the docker container interactive update caused an error while running the code.

Run the terminal code below to fix the file "$HOME/.bashrc".

```bash

sed 's#$"SSH_CONNECTION"#"$SSH_CONNECTION"#gi' -i $HOME/.bashrc

```


Thanks and best regards,

Wonseok

jbibal-pdc
Explorer
0 Kudos

Wow wonseok.choe. This seems to have done the trick!

It even fixed the "node-terminal" debugger.

At this point though, will this affect any official fixes from SAP BAS Team?

Hi liat.borenshtein and licam.oved, hoping to read your thoughts as well on the fix / workaround that Wonseok suggested.

liat_b
Advisor
Advisor
0 Kudos

alexander.gilin can you comment on this fix?

liat_b
Advisor
Advisor

Hi all,

BAS team identified the issue. In the meanwhile, until we provide a general fix, you can work around the issue if you define and run another launch configuration like this one:

{
“cwd”: “${workspaceFolder}“,
“runtimeExecutable”: “npx”,
“args”: [
“cds”,
“serve”,
“--with-mocks”,
“--in-memory?”
],
“name”: “cds serve”,
“request”: “launch”,
“type”: “node”,
“skipFiles”: [
“<node_internals>/**”
]
}

Thanks,

Liat

jbibal-pdc
Explorer
0 Kudos

Thank you for this work around. It does work fine for the time being. Will keep this question open until a final fix is provided so that we may have a final resolution to the issue / concern.

sanjothomas
Discoverer
0 Kudos

I was able to solve it, by first starting cds run in debug mode and then selecting Debug: Attach to Node Process in the command pallate.

jbibal-pdc
Explorer

Hi Sanjo,

This was actually my initial workaround as well, but didn't find it sustainable when using cds watch, as running it automatically redeploys / restarts the CAP server for any new code change.

This creates a new node process that you need to attach again and again; but sometimes it won't attach at all.

So hopefully you were able to make Liat's or Licam's suggestions to work.

Thanks,
John

sanjothomas
Discoverer
0 Kudos

This workaround is not working for me... it is still taking the path "openvscode-server$"

liat_b
Advisor
Advisor

Your workspace should be opened on the root folder of your project. Can you confirm this is how you ran it?