VS Code - Error while connecting to the openHAB REST API

Hi, everyone.

I’m running OH 4.3.1 on a Raspberry Pi (CENTOS 9).

For a while, I haven’t been able to connect to my OH from Visual Studio Code (macOS Tahoe 26.2), but I didn’t need it much before. Now I need it for code completion, but I can’t seem to get it to work. I keep getting the following errors:

openHAB Extension Output

openHAB vscode extension has been activated

[Error - 4:14:14 PM] Connection to server is erroring. Shutting down server.

[Error - 4:14:14 PM] Connection to server is erroring. Shutting down server.

Could not reload items for HoverProvider

Could not reload items for Items Explorer

Could not reload items for Things Explorer

---

    Error:

        Error while connecting to openHAB REST API.

    Message:

        Error: connect EHOSTUNREACH 10.18.18.102:8080 - Local (10.18.18.4:53185)

---

---

    Error:

        Error while connecting to openHAB REST API.

    Message:

        Error: connect EHOSTUNREACH 10.18.18.102:8080 - Local (10.18.18.4:53186)

---

openHAB Language Server Output

(node:11365) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

(Use `Code Helper (Plugin) --trace-deprecation ...` to show where the warning was created)

Error: getaddrinfo ENOTFOUND openhabianpi

    at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:122:26) {

  errno: -3008,

  code: 'ENOTFOUND',

  syscall: 'getaddrinfo',

  hostname: 'openhabianpi'

}

OH is running. I can connect via a web browser and via SSH from my Mac’s Terminal.

I have deleted all global (User) connection settings and left only the ones at the Workspace level (.vscode/settings.json), as suggested in VS Code OH5 - Error while connecting to openHAB REST API. I also tried the other way around, with the connection strings in the User configuration, to no avail.

"openhab.connection.host": "10.18.18.102",

"openhab.connection.authToken": "oh.VisualStudioCL.a0XXXXXXXXXXXXX”,

"openhab.connection.port": 8080

The other settings are not in the textual configuration, and adding them there doesn’t change the outcome.

I have checked that the ports are open in the firewall, and that they are listening using TCP

ss -tuln

Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port

tcp LISTEN 0 50 *:5007 *:*

tcp LISTEN 0 50 *:8080 *:*

tcp LISTEN 0 128 [::]:22 [::]:*

tcp LISTEN 0 50 *:8443 *:*

On OH, the LSP is listening on the same port:

I even deleted the old token and created a new one.

However, I have not configured any ‘openhabianpi’ anywhere, so I don’t know where the LSP is getting that from.

I have restarted VS Code multiple times, as well as deleted the extension and installed it again.

What else am I overlooking?

Any suggestions on what else to look at?