Error while opening Provisioning Policy in VS Code

Hi Team,

I am getting the below error when trying to open the Create Provisioning Policy through the SailPoint ISC VS Code extension:

“Unable to read file … provisioning-policies/Create … that is actually a directory”

Has anyone encountered this issue before? What could be causing it and how can it be resolved?

Thanks!

Hi @Rakesh_Singh_1234

This looks similar to an issue previously reported with the ISC VS Code extension.

Could you retrieve the provisioning policy using the SailPoint REST API and verify whether the “name” attribute is populated?

In a similar case, the provisioning policy created through the new ISC UI had an empty “name” attribute. Updating the name through the API resolved the issue.

Reference: Provisioning Policy Cannot Open in VSCode extension only for a Single Source

Could you also confirm the connector type?

Hello Rakesh. As Sowmya mentioned, this same VS Code error was previously traced to an empty provisioning policy name, so that is the first thing worth ruling out.

I would suggest checking:

  1. GET /sources/v1/{sourceId}/provisioning-policies/CREATE and look at the top-level name.
  2. If it is empty or null, save the response as a backup, then set the name with a PATCH on the same endpoint (header Content-Type: application/json-patch+json):
[
  { "op": "add", "path": "/name", "value": "CREATE" }
]
  1. GET it again to confirm name is set, then reopen the policy in VS Code.

If the name already comes back populated or the error persists, please share the connector type (as Sowmya asked) and the extension error logs.

i chked with postman name is coming but still cant open via VS code

Hi @Rakesh_Singh_1234

I noticed that the response in your screenshot shows “usageType” as “ENABLE”, which indicates that it is an ENABLE provisioning policy, not the CREATE provisioning policy. Could you please check the CREATE provisioning policy response as well and confirm whether the “name” attribute is populated there?

Name is there

Hi Rakesh,

could be the issue with the PAT token, have you tried to remove the tenant and add again with the new tokens?
if not then please try that as well

sometimes it resolves such issues in the VS Code.

Thanks
Deepak

Hello Rakesh, your CREATE policy has a populated name, so that is not the issue.

I checked the extension code. A provisioning policy is meant to open from a URI like .../provisioning-policies/{policyId}/{name}, and the extension decides file versus directory from the segment right before the last one. Your error URI ends in .../provisioning-policies/Create with no policy ID segment, so provisioning-policies lands in that position and the extension treats it as a directory. That is the “is actually a directory” message.

Possible causes include an older extension build or the current build receiving a policy without a usable id from the V2 listing. I would suggest:

  1. Check your installed SailPoint ISC extension version and update to 1.3.34 or newer. Close the affected tab, run Developer: Reload Window, refresh the source tree, and reopen the Create policy.
  2. If it still fails, run GET /sources/v2/{sourceId}/provisioning-policies with the header X-SailPoint-Experimental: true and confirm the Create policy has a non-empty id as well as name.
  3. If the id is present but the extension still builds an ID-less URI, share the extension version, error URI, and Extension Host logs in a GitHub issue.

You should not need to modify or recreate the policy until these checks are done. A token refresh or re-adding the tenant is unlikely to help here, since the problem is in how the path is built rather than auth.