codefori / vscode-ibmi

šŸŒ IBM i development extension for VS Code
https://codefori.github.io/docs/#/
MIT License
288 stars 95 forks source link

SEP debugger - communication failure when trying to add a SEP #2309

Open heymchri opened 1 month ago

heymchri commented 1 month ago

When trying to add an SEP, the UI briefly shows it's being added in the list of SEPs but then it is immediately removed. Error message shown: EQAVS1010E Communication required by Service Entry Point function dropped. Service Entry Point(s) set by user HEYMCHR on server USALID06.INFOR.COM will be removed.

The Debug Service job is active and stays active throughout this.

I'm using a valid CA signed cert because when using the internally generated one, I get the 'self-signed certificate' error (which I can't figure out either why that's happening as it works just fine on several of our other partitions).

Debug Console shows:

From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"IBMiDebug","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true,"supportsANSIStyling":true}) To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsEvaluateForHovers":true,"supportsSetVariable":true,"supportsValueFormattingOptions":true,"supportsModulesRequest":true,"supportTerminateDebuggee":true,"supportsFunctionBreakpoints":true,"supportsConfigurationDoneRequest":true}} From client: launch({"type":"IBMiDebug","request":"launch","subType":"sep","action":"set","name":"Service Entry Point","user":"HEYMCHR","password":"xxxxxx","host":"USALID06.INFOR.COM","port":8005,"sepDaemonPort":8008,"secure":true,"ignoreCertificateErrors":false,"library":"HEYMCHR","program":"CHGDECFMT","programType":"PGM","module":"ALL","procedure":"*ALL","trace":true,"workbenchSettings":{"updateProductionFiles":false,"enableDebugTracing":false},"__sessionId":"7a7e14fd-214d-4c9d-9bbe-0d828908c398"}) To client: {"type":"event","seq":2,"event":"initialized"} From client: setFunctionBreakpoints({"breakpoints":[]}) To client: {"type":"response","seq":0,"request_seq":3,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}} From client: configurationDone(undefined) To client: {"type":"response","seq":0,"request_seq":4,"success":true,"command":"configurationDone"} From client: threads(undefined) To client: {"type":"response","seq":0,"request_seq":5,"success":true,"command":"threads","body":{"threads":[]}} To client: {"type":"event","seq":7,"event":"terminated"} To client: {"type":"response","seq":0,"request_seq":2,"success":true,"command":"launch"} To client: {"type":"response","seq":0,"request_seq":4,"success":false,"command":"configurationDone","body":{"error":{"id":"8999","format":"java.lang.NullPointerException\n\tat com.ibm.debug.pdt.daas.internal.dap.DAPSession.getVersionJSON(DAPSession.java:439)\n\tat com.ibm.debug.pdt.daas.internal.dap.events.DAPEvent.getEvent(DAPEvent.java:117)\n\tat com.ibm.debug.pdt.daas.internal.dap.requests.DAPConfigurationDoneRequest.generateEvents(DAPConfigurationDoneRequest.java:123)\n\tat com.ibm.debug.pdt.daas.internal.dap.requests.DAPRequest.process(DAPRequest.java:139)\n\tat com.ibm.debug.pdt.daas.internal.dap.requests.DAPRequest.process(DAPRequest.java:97)\n\tat com.ibm.debug.pdt.daas.internal.dap.DAPRequestProcessor$1.run(DAPRequestProcessor.java:119)\n\tat org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)\n"}}} From client: disconnect({"restart":false,"terminateDebuggee":false})


Context Version
Code for IBM i version 2.13.5
Visual Studio Code version 1.94.2
Operating System darwin_arm64
Active extensions ``` .NET Install Tool (vscode-dotnet-runtime): 2.2.1 CL (vscode-clle): 1.1.7 COBOL (cobol): 24.10.22 Code for IBM i Walkthroughs (vscode-ibmi-walkthroughs): 0.5.0 Configuration Editing (configuration-editing): 1.0.0 Db2 for IBM i (vscode-db2i): 1.6.1 Dev Containers (remote-containers): 0.388.0 Emmet (emmet): 1.0.0 Error Lens (errorlens): 3.20.0 Excel Viewer (gc-excelviewer): 4.2.62 Git (git): 1.0.0 Git Base (git-base): 1.0.0 GitHub (github): 0.0.1 IBM i Debug (ibmidebug): 2.0.1 JSON Language Features (json-language-features): 1.0.0 Merge Conflict (merge-conflict): 1.0.0 Node Debug Auto-attach (debug-auto-launch): 1.0.0 Overtype (overtype): 0.5.0 Prettier - Code formatter (prettier-vscode): 11.0.0 Print (vscode-print): 0.13.2 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 vscode-icons (vscode-icons): 12.9.0 ```

Remote system |Setting|Value| |-|-| |IBM i OS|V7R4M0| |Tech Refresh|10| |CCSID Origin|65535| |Runtime CCSID|65535| |Default CCSID|37| |SQL|Enabled |Source dates|Enabled ### Enabled features |/QOpenSys/pkgs/bin|/usr/bin|/QSYS.lib/ILEDITOR.lib|/QSYS.LIB|/QIBM/ProdData/IBMiDebugService/bin|/QOpenSys/QIBM/ProdData/JavaVM/jdk80|/QOpenSys/QIBM/ProdData/JavaVM/jdk11| |-|-|-|-|-|-|-| |bash|attr|GETNEWLIBL.PGM|QZDFMDB2.PGM|startDebugService.sh|64bit|64bit| |chsh|iconv|||||| |ls|setccsid|||||| |md5sum|tar|||||| |sort||||||| |stat||||||| |tn5250|||||||
Shell env ```bash BUILDLIB=HEYMCHR CURLIB=HEYMCHR HOME=/home/HEYMCHR HOST=usalid06.infor.com LIBLS=HEYMCHR QTEMP QGPL LOGIN=heymchr LOGNAME=heymchr MAIL=/var/spool/mail/heymchr OLDPWD=/home/heymchr PATH=/QOpenSys/pkgs/bin:/QOpenSys/usr/bin:/usr/ccs/bin:/QOpenSys/usr/bin/X11:/usr/sbin:.:/usr/bin PWD=/home/HEYMCHR SHELL=/QOpenSys/pkgs/bin/bash SHLVL=1 SSH_CLIENT=10.61.5.49 60045 22 SSH_CONNECTION=10.61.5.49 60045 10.39.80.55 22 TZ=5,M3.2.0,M11.1.0 USER=heymchr USERNAME=heymchr WORKDIR=/home/HEYMCHR _=/QOpenSys/pkgs/bin/env ```
Variants ```json { "american": "#@$", "local": "#@$" } ```
Errors ```json [ { "command": "/QOpenSys/usr/bin/qsh", "code": 1, "stderr": "CPF2111: Library ILEDITOR already exists.", "cwd": "/home/HEYMCHR" } ] ```
heymchri commented 1 month ago

This may be the same issue as https://github.com/codefori/vscode-ibmi/issues/2247 ?

mkwan01 commented 1 week ago

@heymchri Please include the contents of the following files for further diagnosis:

  1. /QIBM/UserData/IBMiDebugService/DebugService_log.txt
  2. /QIBM/UserData/IBMiDebugService/startDebugService_workspace/.metadata/.log

Please note that the second file (.log) is a hidden file. We need to use "ls -a" to show the file in Unix file system.

heymchri commented 1 week ago

@mkwan01 Tried to reproduce but couldn't due to 'Self signed certificate in certificate chain' error - see https://github.com/codefori/vscode-ibmi/issues/2320 Tried on 2 different partitions - same issue on both.

heymchri commented 5 days ago

@mkwan01 Not sure what changed now, but in any case, as I was testing CA signed vs. internal certs, I managed to get the CA cert installed without the 'Self signed certificate in certificate chain' error. When setting the SEP (with the CA signed cert in place), I get the following error message:

image

Log files show the following:

.log:

!ENTRY com.ibm.debug.pdt.daas.application 2 0 2024-11-25 10:16:33.275
!MESSAGE unable to configure termination, default termination used

!ENTRY com.ibm.debug.pdt.daas.application 4 0 2024-11-25 10:16:33.351
!MESSAGE NullPointerException
!STACK 0
java.lang.NullPointerException
        at com.ibm.debug.pdt.daas.internal.dap.DAPSession.getVersionJSON(DAPSession.java:439)
        at com.ibm.debug.pdt.daas.internal.dap.events.DAPEvent.getEvent(DAPEvent.java:117)
        at com.ibm.debug.pdt.daas.internal.dap.requests.DAPConfigurationDoneRequest.generateEvents(DAPConfigurationDoneRequest.java:123)
        at com.ibm.debug.pdt.daas.internal.dap.requests.DAPRequest.process(DAPRequest.java:139)
        at com.ibm.debug.pdt.daas.internal.dap.requests.DAPRequest.process(DAPRequest.java:97)
        at com.ibm.debug.pdt.daas.internal.dap.DAPRequestProcessor$1.run(DAPRequestProcessor.java:119)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

DebugService_log.txt:

DBGM0007I Created service entry point on AEALIB/CRTOBJEDN *PGM.
The following conflicting service entry point(s) are removed:
AEALIB/CRTOBJEDN/*ALL/*ALL

SEP daemon socket connection disconnected for user: null
heymchri commented 5 days ago

Also note that regular 'Debug as Batch' debugging works OK with this same CA signed cert.

mkwan01 commented 5 days ago

@heymchri The NPE at DAPSession.getVersionJSON() is harmless. The communication dropped message usually indicates a connection drop between the client and host. You can restart the debug service and try to set the SEP again. If you can reproduce the communication dropped issue consistently when setting a SEP, please also include the Debug Adapter Protocol trace from the Debug Console when you set the SEP.

heymchri commented 3 days ago

Hi @mkwan01 the communication drops consistently when setting a SEP. Nothing much is reported in the Debug Console (other than that NPE). I do have Debug Tracing turned on. Where should I see the Debug Adapter Protocol trace? Not sure if this helps, but here's a link to a video where I'm trying to set the SEP twice - https://www.dropbox.com/scl/fi/0l36e3qakj61tr7mcabqm/SEP.mp4?rlkey=4bimbhhsckqai8ohrxuplhgxe&dl=0

mkwan01 commented 3 days ago

@heymchri The text in the video is very small. I can hardly read any text there. I can see that you use the "Create Service Entry Point" toolbar action to create a SEP, but I cannot see the text you entered into the prompt. Please try to use the integrated action from the Object Browser view to set a SEP and report whether this action works for you.

image

mkwan01 commented 3 days ago

For the DAP trace, we will try to look for a message like the following:

From client: launch({"type":"IBMiDebug","request":"launch","subType":"sep","action":"set","name":"Service Entry Point","user":"my_user_id","password":"xxxx","host":"my_host_name","port":8005,"sepDaemonPort":8008,"secure":true,"ignoreCertificateErrors":false,"library":"MERDBGTEST","program":"SRVTESTP2","programType":"*PGM","module":"*ALL","procedure":"*ALL","trace":true,"workbenchSettings":{"updateProductionFiles":false,"enableDebugTracing":false},"__sessionId":"543c04f9-5547-4d26-ba87-952befe6ce69"})

mkwan01 commented 3 days ago

Please remove the password when copying the DAP text and include the other statements after the launch request, so that we can see what happens next.

heymchri commented 3 days ago

Hi @mkwan01 I didn't even see that DAP trace message you pointed me to at all, until I disconnected from the system and reconnected. Even without me setting any kind of SEP at all, so just the mere fact of connecting to my system, spits out the entries shown below in the Debug Console. So to be clear, that's BEFORE I even attempt to set the SEP.

From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"IBMiDebug","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true,"supportsANSIStyling":true})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsEvaluateForHovers":true,"supportsSetVariable":true,"supportsValueFormattingOptions":true,"supportsModulesRequest":true,"supportTerminateDebuggee":true,"supportsFunctionBreakpoints":true,"supportsConfigurationDoneRequest":true}}
From client: launch({"type":"IBMiDebug","request":"launch","subType":"sep","action":"get_list","name":"Service Entry Point","user":"heymchr","password":"xxxxxxxx","host":"usalid06.infor.com","port":8005,"secure":true,"ignoreCertificateErrors":false,"trace":true,"workbenchSettings":{"updateProductionFiles":false,"enableDebugTracing":false},"__sessionId":"6b1f8025-3f48-463f-b537-6c043b9c978b"})
To client: {"type":"event","seq":2,"event":"initialized"}
From client: setFunctionBreakpoints({"breakpoints":[]})
To client: {"type":"response","seq":0,"request_seq":3,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
From client: configurationDone(undefined)
To client: {"type":"response","seq":0,"request_seq":4,"success":true,"command":"configurationDone"}
From client: threads(undefined)
To client: {"type":"response","seq":0,"request_seq":5,"success":true,"command":"threads","body":{"threads":[]}}
From client: disconnect({"restart":false,"terminateDebuggee":false})
To client: {"type":"response","seq":0,"request_seq":4,"success":false,"command":"configurationDone","body":{"error":{"id":"8999","format":"java.lang.NullPointerException\n\tat com.ibm.debug.pdt.daas.internal.dap.DAPSession.getVersionJSON(DAPSession.java:439)\n\tat com.ibm.debug.pdt.daas.internal.dap.events.DAPEvent.getEvent(DAPEvent.java:117)\n\tat com.ibm.debug.pdt.daas.internal.dap.requests.DAPConfigurationDoneRequest.generateEvents(DAPConfigurationDoneRequest.java:123)\n\tat com.ibm.debug.pdt.daas.internal.dap.requests.DAPRequest.process(DAPRequest.java:139)\n\tat com.ibm.debug.pdt.daas.internal.dap.requests.DAPRequest.process(DAPRequest.java:97)\n\tat com.ibm.debug.pdt.daas.internal.dap.DAPRequestProcessor$1.run(DAPRequestProcessor.java:119)\n\tat org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)\n"}}}

Then, when I set the SEP from the object browser like in your screenshot, it generates the following in the Debug console:

From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"IBMiDebug","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true,"supportsANSIStyling":true})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsEvaluateForHovers":true,"supportsSetVariable":true,"supportsValueFormattingOptions":true,"supportsModulesRequest":true,"supportTerminateDebuggee":true,"supportsFunctionBreakpoints":true,"supportsConfigurationDoneRequest":true}}
From client: launch({"type":"IBMiDebug","request":"launch","subType":"sep","action":"set","name":"Service Entry Point","user":"HEYMCHR","password":"xxxxxxxx","host":"USALID06.INFOR.COM","port":8005,"sepDaemonPort":8008,"secure":true,"ignoreCertificateErrors":false,"library":"HEYMCHR","program":"CHGDECFMT","programType":"*PGM","module":"*ALL","procedure":"*ALL","trace":true,"workbenchSettings":{"updateProductionFiles":false,"enableDebugTracing":false},"__sessionId":"3c6780e5-ebfa-4ae6-9360-a12ecc025cb9"})
To client: {"type":"event","seq":2,"event":"initialized"}
From client: setFunctionBreakpoints({"breakpoints":[]})
To client: {"type":"response","seq":0,"request_seq":3,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
From client: configurationDone(undefined)
To client: {"type":"response","seq":0,"request_seq":4,"success":true,"command":"configurationDone"}
From client: threads(undefined)
To client: {"type":"response","seq":0,"request_seq":5,"success":true,"command":"threads","body":{"threads":[]}}
To client: {"type":"event","seq":7,"event":"terminated"}
To client: {"type":"response","seq":0,"request_seq":2,"success":true,"command":"launch"}
To client: {"type":"response","seq":0,"request_seq":4,"success":false,"command":"configurationDone","body":{"error":{"id":"8999","format":"java.lang.NullPointerException\n\tat com.ibm.debug.pdt.daas.internal.dap.DAPSession.getVersionJSON(DAPSession.java:439)\n\tat com.ibm.debug.pdt.daas.internal.dap.events.DAPEvent.getEvent(DAPEvent.java:117)\n\tat com.ibm.debug.pdt.daas.internal.dap.requests.DAPConfigurationDoneRequest.generateEvents(DAPConfigurationDoneRequest.java:123)\n\tat com.ibm.debug.pdt.daas.internal.dap.requests.DAPRequest.process(DAPRequest.java:139)\n\tat com.ibm.debug.pdt.daas.internal.dap.requests.DAPRequest.process(DAPRequest.java:97)\n\tat com.ibm.debug.pdt.daas.internal.dap.DAPRequestProcessor$1.run(DAPRequestProcessor.java:119)\n\tat org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)\n"}}}
From client: disconnect({"restart":false,"terminateDebuggee":false})

If this doesn't show what you're looking for, maybe a screen share session might be useful?