Extra "h" added to base URL when creating an initial environment with SailPoint CLI

I was setting up an environment using the SailPoint CLI, and I ran into an issue when using the shorthand version of “sail env ENV_NAME” where it added an additional “h” to the base URL, as shown below.

I upgraded to the latest 2.15 and it would not let me use the shorthand, but I did use the full version, “sail env create ENV_NAME” and it worked and this issue was not present, but I can’t retest after updating.

I first ran into this when setting up a new connection:

➜  colab-saas-conn-identitynow-management git:(main) sail env devrel-gm
Tenant URL (ex. https://tenant.identitynow.com): https://devrel-TENANT.identitynow-demo.com                 
API Base URL (ex. https://tenant.api.identitynow.com): https://devrel-TENANT.api.identitynow-demo.com                D ➜  colab-saas-conn-identitynow-management git:(main) sail env          
2024/08/06 13:48:03 INFO <environment/environment.go:60> Environment changed env=devrel-gm
➜  colab-saas-conn-identitynow-management git:(main) sail set pat
Personal Access Token Client ID:
Personal Access Token Client Secret:
➜  colab-saas-conn-identitynow-management git:(main) sail set auth pat
2024/08/06 13:49:09 INFO <set/auth.go:50> Authentication method set to PAT

➜  colab-saas-conn-identitynow-management git:(main) sail va list
2024/08/06 13:49:32 DEBU <config/config.go:162> unable to retrieve accesstoken error="Post \"hhttps://devrel-TENANT.api.identitynow-demo.com/oauth/token?grant_type=client_credentials\": unsupported protocol scheme \"hhttps\""
2024/08/06 13:49:32 DEBU <[email protected]/client.go:599> [DEBUG] GET hhttps://devrel-TENANT.api.identitynow-demo.com/beta/managed-clusters?limit=250&offset=0
2024/08/06 13:49:32 DEBU <[email protected]/client.go:656> [ERR] GET hhttps://devrel-TENANT.api.identitynow-demo.com/beta/managed-clusters?limit=250&offset=0 request failed: Get "hhttps://devrel-TENANT.api.identitynow-demo.com/beta/managed-clusters?limit=250&offset=0": unsupported protocol scheme "hhttps"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x207ca0b]

goroutine 1 [running]:
github.com/sailpoint-oss/sailpoint-cli/internal/sdk.HandleSDKError(0x0, {0x2461e80?, 0xc000613440?})
	/home/runner/work/sailpoint-cli/sailpoint-cli/internal/sdk/sdk.go:20 +0x4b
github.com/sailpoint-oss/sailpoint-cli/cmd/va.newListCommand.func1(0xc000977800?, {0x336a790?, 0x0?, 0x0?})
	/home/runner/work/sailpoint-cli/sailpoint-cli/cmd/va/list.go:36 +0xfb
github.com/spf13/cobra.(*Command).execute(0xc000977800, {0x336a790, 0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:940 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc0002bc900)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:992
main.main()
	/home/runner/work/sailpoint-cli/sailpoint-cli/main.go:26 +0x25

If someone could test this and determine if it still exists in the latest 2.15, that would be great.

It doesn’t look as though this bug exists in 2.15. I ran through the exact steps that you did above and did not run into any problem with the url. It is likely this environment is somehow leftover from a prior version

@philip-ellis Thanks for checking and verifying.

I was unable to re-test using the format “sail env <NEW_ENVIRONMENT_NAME>”, which is where the issue seemed to be introduced, so I was not sure if that still existed. I was on a previous version when I set that one up, so it is likely an artifact from that environment, and has been corrected in 2.15 as you mentioned.