Written by

Question Matjaz Murko · Jun 15, 2025

VS Code

Hi.

I want to save and compile a class in VS Code, but I get the error:

Failed to save 'Utils.cls': Unable to write file 'isfs://mip:mz/API/Utils.cls?project=MZ' (Unknown (FileSystemError): Unknown Error).

Any ideas what is wrong?

Regards,
Matjaž

Product version: IRIS 2023.2
$ZV: IRIS for Windows (x86-64) 2023.2 (Build 227U) Mon Jul 31 2023 17:45:52 EDT

Comments

DC AI Bot · Jun 15, 2025 Bot

You may encounter the error Failed to save 'Utils.cls': Unable to write file 'isfs://mip:mz/API/Utils.cls?project=MZ' (Unknown (FileSystemError): Unknown Error) when trying to save or compile a class in Visual Studio Code due to several potential reasons.

Here are some troubleshooting steps based on relevant information:

  1. Do Not Alter First Line of New Files: If you are creating a new file in the Explorer tree in VS Code and modify or delete the first automatically generated line after naming the file (e.g., foo.cls), it may cause issues saving the file. Always start coding on the second line and retain the first untouched [1].

  2. Namespace and Server Connection Issues: Ensure your connection to the server is functional:

    • Check if you have configured the namespace and server connection properly in VS Code.
    • Use PuTTY or the browser-based management portal to verify connectivity to the server and test your file import or routine executions, as they should work without errors if connectivity is valid [1].
  3. Correct Permissions: Make sure that the user configured for your VS Code ObjectScript plugin has the necessary privileges to write to the namespace or specific filesystems in InterSystems IRIS.

  4. VS Code Plugin Setup: Ensure the required InterSystems ObjectScript extensions, such as the ObjectScript Extension Pack and Server Manager, are installed and properly configured [1].

If this doesn't resolve the problem, it may be useful to look at the server logs or other error details in the Audit Trail (%SYS.Audit) to get more information.

Sources:

0
Carol Porter · Jun 16, 2025

Hi Matjaž,

This error usually means the VS Code InterSystems Server Manager isn’t properly connected. Check your server settings in VS Code, ensure you're authenticated, and that the namespace mip:mz is reachable. Restarting VS Code might helps here.

0
Matjaz Murko  Jun 16, 2025 to Stefano Cairoli

Hi.

I just restarted the Intersystems ObjectScript extension from InterSystems ObjectScript Extension Pack to activate the updates (restart was proposed by VS Code) and now it is working without any error.

Tnx all for your replies.

Regards, 
Matjaž

0
Simone Arvieri · Jun 16, 2025

Hi Matjaz,


I've encountered a similar issue several times with source code that was correctly saved and compiled using the "old" InterSystems Studio, but not with VS Code.

In my case, it turned out that certain lines of code were causing the saving process to fail.
Specifically, I had to:

  • Add parentheses in conditional or loop statements when there's a dot (.) in the condition (e.g., if obj.myProperty = "something"if (obj.myProperty = "something"))
  • In embedded SQL, when using INSERT in conjunction with INTO, I had to place INTO on a new line.

I've also noticed that this doesn't happen in the newest versions of IRIS.

Hope this helps!
Simone

0
Brett Saviano · Jun 16, 2025

@Matjaz Murko 
I just released version 3.0.3 of the vscode-objectscript extension, which contains a fix for this issue.

0