#Debugging

5 Followers · 174 Posts

Debugging is the process of finding and resolving defects or problems within a computer program that prevents the correct operation of computer software or a system.

Question Donna Edwards · Jun 30, 2023

Hi I am trying to run a debugger in VS Code.  I have the settings.json file and the launch.json file.  I am trying to debug code using the attach to a process method, however when I run the debugger I get the following error. 

Launch.json code 

{

    // Use IntelliSense to learn about possible attributes.

    // Hover to view descriptions of existing attributes.

    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387

    "version": "0.2.0",

    "configurations": [  

        {

            "type": "objectscript",

            "request": "attach",

1
0 513
Article Pietro Montorfano · May 23, 2023 3m read

Intro

If you ever wondered how to debug some requests that are being made to or from IRIS, well here is a little tutorial on how to do that.

During a complex project, usually you get the specifications and implement the communication between IRIS and other things based on that. But from the paper to the real world there's usually a huge gap and you need to know why you are receiving an error on a parameter, on a header, you are not receiving the data and so on.

1
2 624
Question Colin Brough · Apr 5, 2023

Exported contents of a namespace on one server (classes, include files and lookup tables). Importing that code into a newly created namespace on another server. Both servers Ensemble 2018.1, same build. Export was via InterSystems Studio. Export is around 18Mb in total (XML file sizes).
When importing and compiling on the new server, getting errors as below - with #6301: SAX XML Parser error prominent - on a number of the imported files, all containing data transformations or business processes.

1
0 890
Article Eduard Lebedyuk · Apr 17, 2017 4m read

In this article I'll cover testing and debugging Caché web applications (mainly REST) with external tools. Second part covers Caché tools.

You wrote server-side code and want to test it from a client or already have a web application and it doesn't work. Here comes debugging. In this article I'll go from the easiest to use tools (browser) to the most comprehensive (packet analyzer), but first let's talk a little about most common errors and how they can be resolved.

2
5 3884
Question Colin Brough · Apr 20, 2023

On a developer's laptop, having had two or three Ensemble installs with different settings/config changes made, and encountering unexplained errors compiling classes, wanting to scrub as much of the previous installs off the machine before doing any fresh installation... But can't find clear documentation on doing a complete uninstall!

Have stopped the server.

Am I safe to remove C:\InterSystems\Ensemble (for the instance installed into that folder)?

What other files/Registry/locations contain references to an Ensemble install, and are there tools or documentation on clearing those out?

6
0 686
Article Yuri Marx · Sep 26, 2022 9m read

Visual Studio Code (VSCode) is the most popular code editor on the market. It was created by Microsoft and distributed as a free IDE. VSCode supports dozens of programming languages, including ObjectScript, Until 2018, Atelier (based on Eclipse). It was considered as one of the main options to develop InterSystems products. However, in December 2018, when the InterSystems Developer Community launched support for VSCode, a relevant portion of InterSystems professionals started actually using this editor and have been doing it ever since, especially the developers working with new technologies

4
5 2390
Question Jordan Everett · Mar 13, 2023

Hey all!

I was wondering if anyone had any input on how to troubleshoot classes in a terminal session? I'm currently writing an "adapter" so that way we can encrypt and decrypt files through GNUPG (PGP keys).

I currently have a %RegisteredObject class for this and am running into the excruciating pain of testing this. Every time I make a change on the RegisteredObject I have to renew the class and all of its properties in order to test the newly compiled code that I have written. I know that this doesn't seem like too much of a hassle, but after doing it multiple times it becomes tiring.

3
0 471
Question Colin Brough · Feb 15, 2023

Is there a way of comparing code running on two Ensemble servers - ideally excluding certain types of difference?We are a new team working in HealthCare (lots of HL7, some web-services). As well as doing new development on local servers with suitable source control, we have a large code base we've inherited from an external supplier for which we have no log of versions or differences. We have a live server and test server - and we've stumbled across a couple of places where there are differences in logic in addition to the expected differences in endpoints. Is there any way of systematically

9
0 503
Question Jordan Everett · Dec 30, 2022

I am currently trying to better my development process by using Visual Studio Code because I'm more familiar and comfortable with it than Studio.

I've followed the guide here, but I'm still having issues. I initially didn't have the Web Socket protocol allowed on my Web Gateway server, but I enabled that and restarted the server with no luck.

Am I just on too old of a version? Is there any way I'd be able to use Visual Studio Code and be able to debug with what I currently have? I wish I could upgrade to IRIS, but that doesn't seem to be an option.

15
1 901
Question Evgeny Shvarov · Oct 8, 2022

Folks!

Could you please share any best practices on how to debug Embedded Python code?

Given I have the following class method:

ClassMethod HideShip() As %Status [ Language = python ]
{
    import iris
    shipsgl=iris.gref(iris.cls(__name__)._GetParameter("BoardStorage"))
    shipsgl.kill()
    from random import Random
    board=iris.cls(__name__)._GetParameter("BoardRange")
    x=random.randint(0,board+1)
    y=random.randint(0,board+1)
    shipsgl.set([x,y],1)
}

And when I run it shows the following error:

5
0 997
Announcement Laurel James (GJS) · Sep 20, 2021

Hi developers, 

We're excited to let you know about the latest release of Serenji, your on-the-spot debugger from George James Software. Version 3.2.0 focuses on the debug experience and introduces zero configuration for users. No matter where you are or what you're doing, Serenji is always ready to go in just one click, so you won't lose focus by spending time setting up a launch configuration. 

This enhanced debugger also takes advantage of the latest features of VS Code itself. With this powerful combination you'll be able to smoothly identify and quickly fix errors in your code, contributing to the production of quality, maintainable code... and isn't that what everyone wants?! 

   

In this latest release you will experience: 

  • Debugging in just one click with zero configuration. 
  • Navigation directly to the source of an error using our gj :: locate technology.
  • Intuitive prompting for entrypoint and arguments.
  • Configurable break on error.
  • Program output in debug console. 
  • Run and Debug CodeLenses.
  • Run multiple concurrent debug sessions and consoles. 
  • Shaded background for read-only documents. 

If you're a new user, it's now easier for you to get started. The introduction of a welcome page Walkthrough and guidance on the Explorer and Run and Debug views means you can effortlessly create your initial workspace and start debugging. 

Download Serenji directly from the VS Code marketplace and take a look at our release notes to find out more about these new features and how to use them. 

We offer a free 30 day trial so if you're not yet a user of Serenji but you're interested in how it can help you, drop me a message through the Developer Community or email us at info@georgejames.com.

Happy debugging! 

1
4 408
Question Zach McKinney · Sep 30, 2022

Issue

Breakpoints do not work when using VS Code Debug this method feature on a ClassMethod. Debug runs like normal and I can sometimes see 'running' on the CALL STACK menu. In the BREAKPOINTS menu, the breakpoints will start red, like normal, but eventually turn gray. On-hover for a grey breakpoint is the message "Breakpoint Cannot Be Mapped". After the method finishes, the breakpoint turns red again. No error messages appear. This is an intermittent issue, as sometimes it runs fine. So far, I have not been able to figure out the conditions to re-create this issue.

Any suggestions?

Edit: 

6
0 595
Question Jonathan Lent · Aug 4, 2022

I've faced a problem that happens while debugging a process in VSCode. It doesn't seem to matter if this is in a container, on my development VM, or against a locally installed version of IRIS. The problem seems to be mostly with X12 Documents.

So, in a debug session, I can dump out a value to the debug console and it loos correct. The same variable in VSCode appears to be some uninitialized memory location.

In the interactive debugger window:

In the Variables Window:

Host Workstation:

4
0 471
Article Fabio Goncalves · Jan 8, 2018 2m read

Hi Community,

I would like to share with you my experience regarding  to debugging via Atelier.

I'm developing a REST API and would like to attach to a process when I call the API via a REST Client tool, for example Postman. The purpose is to inspect values from HEADER and BODY of the HTTP request during the debugging process.

Come on! How am I doing? I am going to demonstrate that by using a class from SAMPLES namespace.

1 - Open Atelier;

2 - Open your REST Service class;

3 - Go to the method related to the URI that you need to debug;

3
0 1435
Announcement Laurel James (GJS) · Jun 16, 2022

Only a few days to go until the Global Summit! George James Software will be on hand to talk about any projects you may have on the horizon, such as application development, data and platform migration, system integration, training, and support – we can work with you to find practical and maintainable solutions that support the growing needs of your organization. 

We're also running a User Group Session on Wednesday, July 22nd at 12pm. It's a great opportunity to find out more about our tools and ask us (and current users!) any questions. 

0
0 230
Announcement Laurel James (GJS) · Jun 7, 2022

Come and say hi to us in the Partner Pavilion at the Global Summit! 
We’ll be showcasing our Serenji on-the-spot debugger which has undergone some big changes in the last year—users can now enjoy a seamless debugging experience with zero configuration, along with taking advantage of the latest features in VS Code itself, enabling users to smoothly identify and quickly fix errors in your code, contributing to the production of quality, maintainable code.
If you want to see Serenji in action look for us in the Partner Pavilion, we'll be on hand to show you a demo.  Prospective users are also welcome to join our User Group Session during the lunchtime session on Wednesday, June 22nd. Email laurelj@georgejames.com to let us know you'll be there.
 

 

0
0 265
Article Mario Sanchez Macias · Apr 27, 2022 3m read

From time to time, we get the previous question in support, something or someone is using more licenses than expected, and we need to find what. 

We have two scenarios. The first scenario is when we realize that the licenses are exhausted when the application does not work or when we try to connect through the terminal and get the "lovely"

<LICENSE LIMIT EXCEEDED> message: 

1
0 981
Question Lorenzo Scalese · Apr 16, 2022

Hi Community,

When we terminate a process that is in a transaction, the system (fortunately) performs a rollback.

As part of some troubleshooting, I'm wondering if there's a way around this behavior to avoid rollback (or force commit) before termination.

Recently we had an issue on a test server with a process stuck in a huge transaction (around 100GB).

The out-of-control process was suspended and then terminated causing a rollback.

In the case of a test server, this is not really a problem.

6
1 734
Question Jonathan Lent · Apr 15, 2022

While I love using VSCode for IRIS development work, one of the persistent frustrations with it has been the inability to display an object hierarch in the variables window while debugging. Only the object's reference identifier is displayed. Cache Studio's handling of the same issue is a little clunky, but it does at least have the option to display something as an object.

For now, I make do with a combination of the watch window and the command line in the debugging console -- but this feels just a step away from log.debug()/console.log() level debugging sometimes.

2
0 786
Article Evgeny Shvarov · Jun 13, 2016 1m read

Hi, Community!

Want to share with you one debugging approach from the Russian forum.

Suppose I want to debug the application  and I want it to stop the execution on a particular line.

I add in code this line:

l +d,-d

When I want to start debugging in this line I block d in terminal

USER> l +d

And execute the app.

The app stops on this line and lets me connect to it with Studio debugger.

To release lock I do in terminal

USER> l -d

And what are your debugging practices?

8
1 776
Question James Woo · Mar 17, 2022

SET ^||fruit(1)="apple",^||fruit(4)="banana",^||fruit(8)="cherry"
SET ^||fruit(1,1)="Macintosh",^||fruit(1,2)="Delicious",^||fruit(1,3)="Granny Smith"
SET ^||fruit(1,2,1)="Red Delicious",^||fruit(1,2,2)="Golden Delicious"
SET ^||fruit="Fruits"
ZWRITE ^||fruit

^||fruit="Fruits"
^||fruit(1)="apple"
^||fruit(1,1)="Macintosh"
^||fruit(1,2)="Delicious"
^||fruit(1,2,1)="Red Delicious"
^||fruit(1,2,2)="Golden Delicious"
^||fruit(1,3)="Granny Smith"
^||fruit(4)="banana"
^||fruit(8)="cherry"


How I do send the output of zwrite to $$$TRACE()?

4
0 795
Question Warren Grob · Oct 10, 2019

I am experiencing a problem with an EDI process that uses a SQL Batch Service to connect to our DEV environment.  However, when we point the EDI service to our TEST server, it errors out.

I have checked every single property on our TEST and DEV servers as well as the properties on the associated tables.  They are identical.  Nothing has changed in the SQL either. 

1
0 369