codefori / vscode-ibmi

🌍 IBM i development extension for VS Code
https://codefori.github.io/docs/#/
MIT License
284 stars 92 forks source link

Debug Walkthrough does not display #1625

Closed rogersonra closed 12 months ago

rogersonra commented 1 year ago

I have been trying to get the Debugger working thru vscode by following the documentation here.

I have applied the prerequisite PTFs 5770SS1 | V7R4M0 | SI81031 | APPLIED | 2023-10-24 14:06:10.000 5770SS1 | V7R4M0 | SI83683 | APPLIED | 2023-11-01 08:29:16.000

According to the doc After connecting to a system in Code for IBM i, if the PTFs are installed but the service is not configured (i.e. the certificates don’t exist) you will see a notice asking if you’d like to open the Walkthrough...

-bash-5.1$ cd '/QIBM/ProdData/IBMiDebugService/bin'
-bash-5.1$ ls
DebugService.env  EncryptPassword.class  encryptKeystorePassword.sh  startDebugService.sh  stopDebugService.sh

```<hr />

|Context|Version|
|-|-|
|Code for IBM i version|2.4.0|
|Visual Studio Code version|1.84.0|
|Operating System|win32_x64|

<details>
<summary>Active extensions</summary>

AutoHotkey Plus Plus (vscode-autohotkey-plus-plus): 5.0.3 Code for IBM i Walkthroughs (vscode-ibmi-walkthroughs): 0.4.0 Db2 for IBM i (vscode-db2i): 0.5.1 Emmet (emmet): 1.0.0 Error Lens (errorlens): 3.15.0 Git (git): 1.0.0 Git Base (git-base): 1.0.0 GitHub (github): 0.0.1 GitHub Authentication (github-authentication): 0.0.2 GitLens — Git supercharged (gitlens): 14.4.1 IBM i Debug (ibmidebug): 1.0.0 IBM i Notebooks (vscode-ibmi-notebooks): 0.0.6 IBM i Project Explorer (vscode-ibmi-projectexplorer): 1.2.4 JSON Language Features (json-language-features): 1.0.0 JavaScript Debugger (js-debug): 1.84.0 Merge Conflict (merge-conflict): 1.0.0 Node Debug Auto-attach (debug-auto-launch): 1.0.0 Pylance (vscode-pylance): 2023.10.50 Python (python): 2023.20.0 Server Ready Action (debug-server-ready): 1.0.0 TODO Highlight (vscode-todo-highlight): 1.0.5 TypeScript and JavaScript Language Features (typescript-language-features): 1.0.0 WSL: Recommender (remote-wsl-recommender): 0.0.19

</details>

<hr />

<details>
<summary>Remote system</summary>

|Setting|Value|
|-|-|
|IBM i OS|V7R4M0|
|Tech Refresh|n/a|
|CCSID|37|
|SQL|Enabled
|Source dates|Disabled

### Enabled features

|/QOpenSys/pkgs/bin|/usr/bin|/QSYS.lib/ILEDITOR.lib||/QSYS.LIB|/QIBM/ProdData/IBMiDebugService/bin|
|-|-|-|-|-|-|
|bash|attr|GENCMDXML.PGM|ILEDITOR.GETNEWLIBL|QZDFMDB2.PGM|startDebugService.sh|
|git|iconv|||||
|grep|setccsid|||||
|ls|tar|||||
|md5sum||||||
|sort||||||
|stat||||||
</details>

<details>
<summary>Shell env</summary>

```bash
BUILDLIB=RROGERSON
CURLIB=RROGERSON
HOME=/home/RROGERSON
HOST=10.10.10.106
LIBLS=LMIGOILIB RROGERSON1 WEBDTA COMDTA POSLIB WEBLIB COMLIB JRNLIB PGFILE PGLIB PGCLIB DBU10 WHSLIB WHSDTA MSGLIB QGPL2 QGPL MBXLIB QS36F CANLIB QTEMP RROGERSON
LOGIN=rrogerson
LOGNAME=rrogerson
MAIL=/var/spool/mail/rrogerson
OLDPWD=/home/RROGERSON
PASE_USRGRP_LIMITED=N
PATH=/QOpenSys/usr/bin:/usr/ccs/bin:/QOpenSys/usr/bin/X11:/usr/sbin:.:/usr/bin
PS1=\033[36m\W\033[0m $
PWD=/home/RROGERSON
SHELL=/QOpenSys/pkgs/bin/bash
SHLVL=1
SSH_CLIENT=10.10.10.55 55430 22
SSH_CONNECTION=10.10.10.55 55430 10.10.10.106 22
TERM=xterm
TZ=<PST>8<PDT>,M3.2.0,M11.1.0
USER=rrogerson
USERNAME=rrogerson
_=/QOpenSys/usr/bin/env

Variants ```json { "american": "#@$", "local": "#@$" } ```
Errors ```json [ { "command": "system \"CRTLIB LIB(ILEDITOR) TEXT('Code for i temporary objects. May be cleared.')\"", "code": 255, "stderr": "CPF2111: Library ILEDITOR already exists.", "cwd": "/home/RROGERSON" }, { "command": "ls -p /QIBM/ProdData/IBMiDebugService/bin/certs/debug_service.pfx", "code": 2, "stderr": "/QIBM/ProdData/IBMiDebugService/bin/certs/debug_service.pfx not found", "cwd": "/home/RROGERSON" } ] ```
worksofliam commented 1 year ago

Before connecting to your system, right click on the connection and select 'Connect and Reload' (or something along those lines, I forget the specific text). It might show then.

rogersonra commented 1 year ago

@worksofliam , I did as suggested and after the Connect and Reload I immediately see an error on the bottom right. Not connected to xxx.xxx.xxx.xxx read ECONNRESET (real ip hidden)

I restarted VSCode and get the same error. I can no longer connect to the IBM i.

worksofliam commented 1 year ago

@rogersonra Can you connect via SSH outside of VS Code?

rogersonra commented 1 year ago

Yes, I successfully connected with Putty

rogersonra commented 1 year ago

Wait, I reran Connect and Reload and I'm good

rogersonra commented 12 months ago

What I ended finding was that my user profile did not have the authority to /QIBM/ProdData/IBMiDebugService/bin to create the certs directory. I temporarily gave myself authority to the bin folder, ended the debug service (QSH CMD('/QIBM/ProdData/IBMiDebugService/bin/stopDebugService.sh')) and reconnected. (Connect and Reload). I was presented the Walkthru and after completing all the steps was able to step through a program in debug.

Easy Peasy. Thanks @worksofliam for the help