Debug RPGLE and COBOL with VS Code for IBM i
Our Twitter feeds recently rang out with this long-awaited news from Liam Allan:
“Debugging ILE COBOL and RPGLE inside @code like it’s any other day! I’m pumped for this release #ibmi.”
As reported by Alex Woodie in IBM i Debugger Comes to VS Code, IBM decoupled their RPG/COBOL debugger from RDi after years of encouragement from Liam. It’s now available as a Debug Service to the thousands of IBM i developers who have downloaded Visual Studio Code for IBM i.
In the following video, Liam demos how to use Code for IBM i’s Walkthrough utility to set up and start the Debug Service. He then goes on to write a quick program, set breakpoints, explain the debugging controls, and run a debug session—all in less than 5 minutes!
Check out the official documentation for ILE Debugging here.
For the most efficient way to get your entire team up and running with VS Code for IBM i, talk to us about training.
When I try to setup the IBM i debug service I recieve an error. I installed the PTFs, click on generate certificates, continue and I recieve the error message ” Failed to create certificates”. It created the sub-directories but didn’t create the certificates. Where can I look to see what is the problem?
Hi Gene, after consulting with Liam, we would suggest first trying to update the Code for i extension (instructions at https://www.seidengroup.com/2023/07/05/how-to-update-the-code-for-i-extension/.)
If that doesn’t resolve your issue, please report the details to the maintainers using the instructions here: https://www.seidengroup.com/2023/07/10/how-to-report-an-issue-with-vs-code-for-ibm-i/.
Hi Amy,
I’m encountering the issue as Gene Burns with the debug service on IBM i. Whenever it attempts to generate certificates, it fails and displays an error message stating “failed to create certificates.” Interestingly, it does successfully create the directory IBMiDebugService/bin/certs.
Someone suggested to setting my default shell to bash on my user profile to solve the issue but I’m not familiar on how to do this.
Andres, I don’t know if the bash solution will work, but here is how to set it: https://ibmi-oss-docs.readthedocs.io/en/latest/troubleshooting/SETTING_BASH.html
I ran the sql statement to set my default bash and then I did what Amy Lantz suggested and it worked. Thank you for your assistance.
1. Make sure you have bash and chsh installed: yum install bash chsh
2. chsh -s /QOpenSys/pkgs/bin/bash
3. Log out and log in.
Andres, Liam Allan suggests “Right click on the Connection in Code for IBM i and select ‘Connect and Reload Server Settings’ – it will prompt the user to set their default shell to bash if it is not.”
Hello, Facing the same issue, in our case it seems not to be an authority issue. However we get an error “An error occured” running the Walkthrough for setting up certificates during Debug Services setup. If I run the StartServices.sh script manually I get error “Environment variable DEBUG_SERVICE_KEYSTORE_PASSWORD is not set.”. Using i Navigator to start the Debug Server reveals: A popup “Debug Service Configuration” asking for a Keystore Password for keystore file: /QIBM/UserData/OS/Admininst/admin5/wlp/usr/servers/admin5/resources/security/merlin-keystore.p12.
Thanks in advance for any hints/workaround provided.
Thanks for your question, Stefan. This type of issue can be very individual and tough to track down. Our best advice would be to first check for/apply any updates to VS Code for i. If that doesn’t fix the issue, report it using the instructions here: https://www.seidengroup.com/2023/07/10/how-to-report-an-issue-with-vs-code-for-ibm-i/. If still no solution, consider our SmartSupport service so we can allocate the resources needed to help you track it down: https://www.seidengroup.com/open-source-support-for-ibm-i/. In the meantime, though, if a potential solution occurs to us, we’ll let you know.
Hi Team,
I work in CVS Health organization which has one of the biggest IBMi server and i am part of CI/CD discovery project with one of the objective is to evaluate VS code for different aspects of development and debug is crucial part of development, therefore we are exploring that as well on VS Code. We are currently not able to do debug on VS code yet.
As per documentation, there are below pre-requisites for debug to work :
1. Install Debug extension
2. Ensure all PTF’s installed
3. Generate Debug certificates
4. Start up the service.
We have completed Step1, Step2 and we are stuck on Step3 as we don’t have authority to create certificates. Our system team have authority but they don’t have VS code installed on their machine so they will not be able to do that.
We noticed as part of Generate step below 2 files are created at IFS location : /QIBM/ProdData/IBMiDebugService/bin/certs.
debug_service.pfx : is used to start up the service on the server.
debug_service.crt : which is used as a client certifcate. This can be downloaded and imported later.
By any chance can you provide us a downloadable files for these, so that we can share that with our system team to just download those files and upload on system at desired IFS location.
Please suggest if you have any other workaround for this situation.
HI, Sudhir, thanks for your detailed question. We understand what you arre asking. We’ll look into this and get back to you.
We discussed offline and provided a strategy to have the administrators run the commands separately on their systems.