Written by

Software Architect at Visum
Question Yuri Marx · Nov 26, 2021

Debug IRIS docker instance

How can I do to debug IRIS docker instance into VSCode?

Product version: IRIS 2021.1

Comments

Yuri Marx  Nov 26, 2021 to Dmitry Maslennikov

A REST API call into a docker instance

0
Dmitry Maslennikov  Nov 26, 2021 to Yuri Marx

Unfortunately, there is no simple way of any debug for any web requests. And it does not really matter in docker or not.

0
Yuri Marx  Nov 26, 2021 to Dmitry Maslennikov

Studio too?

0
Sergey Mikhailenko  Nov 26, 2021 to Yuri Marx

In a studio it is possible.
1. I put a delay of a few seconds in the service code.
2. Start the service
3. I find the required process, connect to it

0
Robert Cemper  Nov 26, 2021 to Sergey Mikhailenko

BINGO! 
that''s the way to go.

I typically use from Terminal

>SET ^GO=0

and in code 

SET ^JOB($h)=$JOB FOR x=1:0 HANG 1 IF $GET(^GO) QUIT

and of course Studio to attach
or I use $system.CSP.Shell()  as described here
 

0
Dmitry Maslennikov  Nov 27, 2021 to Robert Cemper

Actually, this way may also work in VSCode as well. It does support Attach to a process.

0
Robert Cemper  Nov 27, 2021 to Dmitry Maslennikov

Good News! I was just not sure. Not to speed fake news smiley

0
Adam Coppola  Jan 31, 2022 to Dmitry Maslennikov

In VS Code, you can create a debugger launch configuration for your API endpoint. Set the "request" attribute to "attach" and the "processID" attribute to the job ID of the production component that services your API. Set breakpoints and run this configuration. Then when a request arrives, you can debug the service and endpoints while viewing the REST request contents.

Here is a reference video; example starts at 4:00.

https://www.youtube.com/watch?v=diLHwA0rlGM

0
Yuri Marx  Jan 31, 2022 to Adam Coppola

Classes extended from csp.rest class does not generate an objectscript jobid. So, is not possible debug rest services.

0
Adam Coppola  Jan 31, 2022 to Yuri Marx

Good point. In the example I gave, the request is forwarded to a business process which has a job ID.

0
Yuri Marx  Jan 31, 2022 to Adam Coppola

Yes, from Ensemble you have, but from csp.rest no. It is because web Gateway 

0