cloudfoundry / cli

The official command line client for Cloud Foundry
https://docs.cloudfoundry.org/cf-cli
Apache License 2.0
1.75k stars 927 forks source link

"cf router-groups" fails with "unsupported protocol scheme" error #2577

Closed SeanKilleen closed 11 months ago

SeanKilleen commented 11 months ago

Please fill out the issue checklist below and provide ALL the requested information.

Describe the bug and the command you saw an issue with

Goal: I am in the context of an SAP BTP environment CloudFoundry environment, which uses standard CF CLI tooilng. I am attempting to create a new internal TCP route for a clustering scenario. My understanding is that upon creating this shared internal TCP route and mentioning it in my manifest, the cf push command will apply index-based routing.

I am logged in to the CF cli via cf login and can execute other commands successfully.

However, whenever I run cf router-groups or cf create-shared-domain tcp.apps.internal --router-group default-tcp --internal

I see output similar to the following (with CF_TRACE=1):

For getting the routes:

cf router-groups
Getting router groups as skilleen@sctsoftware.com...

REQUEST: [2023-09-12T21:40:37-04:00]
GET /v1/router_groups HTTP/1.1
Host:
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Connection: close
Content-Type: application/json
User-Agent: cf.exe/8.7.2+501652fec.2023-08-30 (go1.20.7; amd64 windows)
[application/json Content Hidden]

Request error: Get "/v1/router_groups": unsupported protocol scheme ""
TIP: If you are behind a firewall and require an HTTP proxy, verify the https_proxy environment variable is correctly set. Else, check your network connection.
FAILED
cf create-shared-domain tcp.apps.internal --router-group default-tcp --internal

Creating shared domain tcp.apps.internal as skilleen@sctsoftware.com...
REQUEST: [2023-09-12T21:33:43-04:00]
GET /v1/router_groups?name=default-tcp HTTP/1.1
Host:
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Connection: close
Content-Type: application/json
User-Agent: cf.exe/8.7.2+501652fec.2023-08-30 (go1.20.7; amd64 windows)
[application/json Content Hidden]

Request error: Get "/v1/router_groups?name=default-tcp": unsupported protocol scheme ""
TIP: If you are behind a firewall and require an HTTP proxy, verify the https_proxy environment variable is correctly set. Else, check your network connection.
FAILED

This also hinders my ability to create a domain via the CloudFoundry Terraform provider (I see similar errors when it attempts to run terraform plan and calls the CLI.)

Expected behavior

I can list the router-groups and create a TCP-based internal route.

Exact Steps To Reproduce Steps to reproduce the behavior; include the exact CLI commands and verbose output:

  1. Run cf login
  2. Select BTP account & CF space for context
  3. Run cf router-groups to attempt to see (presumably) the default-tcp router.
  4. See error

Provide more context

Notes regarding V6 and V7 CLI support:

SeanKilleen commented 11 months ago

Just as a follow up to this -- after some deeper reading on the syntax and based on the V3 API docs, I see that I might need to not specify a router group when attempting to create a shared internal TCP domain.

Once I understood the V3 API syntax enough to call it directly via cf curl, I realized that the request requires full admin permissions, so I'll need to obtain those or have someone else execute. Once I attempt that, I'll add more notes here on whether my permissions issue affected the output here.

My guess is that the CLI v8 is still hitting an old endpoint since it looks like it's looking for a /v1 URL rather than a /v3. But I'm also very new and so am more inclined to believe it's my fault first. 😄

SeanKilleen commented 11 months ago

I finally found some documentation on the SAP side that shows it wasn't a CF issue at all.

https://help.sap.com/docs/btp/sap-business-technology-platform/cloud-foundry-environment

TCP based networking and internal routes are supported in CloudFoundry but not SAP BTP.

That's a bummer for me personally, but it's not CF's fault 😆 I wanted to follow up on this and close it before anyone spent too much time on it.