Question
· Jul 18

Can't connect VSCode to IRIS4Health 2024.1

Hi

With this servers definition in VSCode:

"intersystems.servers": {
        "iris4health202312_local": {
            "webServer": {
                "scheme": "http",
                "host": "localhost",
                "port": 52773
            },
            "username": "_system"
        },
        "iris4health20241_local": {
            "webServer": {
                "scheme": "http",
                "host": "localhost",
                "port": 80
            },
            "username": "_system"
        }
    },

Access to 2023.1.2 works just fine, 2024.1 stubbornly refuses to connect ("Unavailable at <time>", says "server could not be accessed by <user>" - I tried several users, all with the %All and %Development roles).

I can access the SMP just fine, even from the "Open Management Portal in External Browser" button in VSCode, which proves the configuration is correct. I can access the 2024.1 instance from Studio (2024.1) just fine, and the terminal works (for what it's worth). So all is good, except VSCode won't connect.

This is a plain vanilla, fresh install of 2024.1. I checked the CSP app definitions, I can see no difference from 2023.1. I checked resources, services, user privileges, etc. Nothing jumps out. And the instance works just fine as far as I can tell. The only difference is that 2023.1 is using the internal web server, 2024.1 is using an external Apache (no choice there in 2024). The Apache web server is a local XAMPP install, which I use for CSP, simple HTML, REST etc. I all works just fine. I compared the Web Gateway settings between 2023.1 and 2024.1, they are virtually identical.

I think I've exhausted my options here. Any ideas anyone?

Thanks in advance.

Product version: IRIS 2024.1
$ZV: IRIS for Windows (x86-64) 2024.1 (Build 263U) Wed Mar 13 2024 15:53:34 EDT
Discussion (13)3
Log in or sign up to continue

Hi Timo

Thanks for your feedback. Yes, I checked all /api endpoints are enabled and their settings are identical to the 2023.1 instance (they are the installation defaults anyway). They are also declared and active in the web gateway.

Apache's access log gives me this: "HEAD /api/atelier/ HTTP/1.1" 404 - "-" "axios/1.7.2". There's nothing in Apache's error and other logs. I can't find any error in the web gateway's csp.log either. The audit database is clean.

The only thing remotely suspicious on the system is an error message repeated several times in the message log, related to the license server:

LMF Warning:  Could not send login/logout messages to license server (unknown reason = -10|Unknown Server)

But since the portal, Studio and the terminal all work fine I see no reason for this to have any bearing on the issue. To be on the safe side, I changed the license server port and restarted the instance. I'm not seeing that error anymore (for now). But VSCode still won't connect.

The fact that VSCode is getting a 404 (and not a 400, 401, 403 or 5xx) is a bit strange, but I believe I've seen other instances where IRIS returns a 404 when, say, a 401 would make more sense, so I won't get hung up on this being a "not found" error.

FWIW, the InterSystems extension pack for VScode is updated regularly; it is currently on version 1.0.3.

The plot thickens... After activating traces (v9r), I don't see anything being logged on the HTTP trace of the csp GW for VSCode's attempts to access the instance. I do see all the traces for accessing the management portal. It must be something with VSCode's configuration then, but I can't figure out what; after all InterSystems server configuration is very trivial... I restarted VSCode again to be safe, still no cigar. And I can open the SMP in an external browser from VSCode, so the server connection settings must be correct. "Open management portal in tab" does nothing, which is perhaps also significant? (the /csp/sys* apps "use cookie for session" are all on "autodetect", FWIW)

I even tried to disable the windows firewall (since it's all local I don't expect that could be a cause, but you never know...), to no avail.

Here's one way to verify from VS Code (but independent of the InterSystems ObjectScript extension) that the /api/atelier REST APIs are available on that server.

  1. Start a new VS Code window (no workspace open)
  2. In Extensions view, use the filter @id:humao.rest-client to find and install the REST Client extension.
  3. From the File menu create a New Text Document, setting its language to http.
  4. Paste this content:
GET http://localhost/api/atelier/v1/%25SYS HTTP/1.1
Authorization: Basic _system:SYS

Now click on the "Send Request" codelens that appears above the first line.

Hi John

I got a 404 again, but then that gave me an epiphany... I realized that the /api path did not have "CSP On" on httpd.conf. Added it, restarted Apache, all works! ☺

Too bad there's no IRIS installation tool for Apache on Windows as far as I know (or any Windows-specific documentation for connecting Apache to IRIS, for that matter) - but anyway, problem solved!

Many thanks for your support!