vscode-openshift-tools icon indicating copy to clipboard operation
vscode-openshift-tools copied to clipboard

"message": "no deployable components found" when create a new component in vscode

Open d95776 opened this issue 3 years ago • 34 comments

I installed the openshift connector extension for vscode. I tried to deploy a spring boot restful api java application to openshift cluster. When I did "create a new component", get the following error. What settings I have to configure such that the extension can find a deployable component?

Command failed: "/Users/hchen/.vscode/extensions/redhat.vscode-openshift-connector-0.4.0-darwin-x64/out/tools/darwin/odo" catalog list components -o json { "kind": "Error", "apiVersion": "odo.dev/v1alpha1", "metadata": { "creationTimestamp": null }, "message": "no deployable components found" }

d95776 avatar Aug 02 '22 15:08 d95776

@d95776 thanks for raising this. Can you please help us with which OpenShift cluster you are connected to? (CRC, OpenShift DevConsole, Sandbox)

mohitsuman avatar Aug 02 '22 16:08 mohitsuman

I connected to our company's openshift cluster.

d95776 avatar Aug 02 '22 19:08 d95776

any comments?

d95776 avatar Aug 07 '22 04:08 d95776

@d95776 Do you see any items it Registries View? You should see the same item as on screenshot. Default registry URL is https://registry.devfile.io/viewer. You might have no access to it because you are behind proxy server and odo cli cannot fetch list of components form the registry server. image

dgolovin avatar Aug 08 '22 05:08 dgolovin

yes, I see the same items on the screen except I can't create or see components. I am able to login to our OCP server and see my namespace. is there a way to setup a proxy? Screen Shot 2022-08-18 at 9 26 48 AM

d95776 avatar Aug 18 '22 14:08 d95776

The only supported way right now is through env variables

  • HTTP_PROXY
  • HTTPS_PROXY

Just setup it globally and restart VSCode to pick it up.

dgolovin avatar Aug 19 '22 06:08 dgolovin

there's no proxy between the vscode ide and our openshift clusters. if I setup http proxy, the openshift clusters even can't be reached. without proxy, at least I can see my project on the cluster but just not see any component. I guess there's some issue with the extension. The kubernets extension works fine.

d95776 avatar Aug 19 '22 17:08 d95776

@d95776 That is a good point. I'll open issue for related project. Can you see the components from the registry with env variables set?

dgolovin avatar Aug 24 '22 21:08 dgolovin

@d95776 I forgot to mention you can also use NOPROXY env var to exclude your openshift cluster from being connected through proxy.

dgolovin avatar Aug 25 '22 18:08 dgolovin

May I ask what registry do you refer to? I can see the cluster and my namespace. But can't see any items under the namespace.

d95776 avatar Aug 26 '22 21:08 d95776

Do you refer to DefaultDevfileRegistry?

d95776 avatar Aug 26 '22 21:08 d95776

even set NO_PROXY, I get the same result. I think if we can connect to the openshift cluster and my namespace, then there would not be proxy issue and also Kubernetes extension works fine

d95776 avatar Aug 26 '22 21:08 d95776

Under namespace or project extension shows only 'Deployment' resources. There are two kinds of deployments:

  • created using 'odo create'
  • created with anything else (OpenShift Console for example)

So if you see nothing under namespace there are no Deployment resources in it.

In issue description you mentioned 'odo catalog list' reports "no deployable components available" that means extension cannot load so called components or devfiles from the registry here https://registry.devfile.io/viewer.

dgolovin avatar Aug 27 '22 03:08 dgolovin

If you click image do you see anything in opened editor?

dgolovin avatar Aug 27 '22 03:08 dgolovin

when I click on it, see message "Loading Registry View" and it hangs for long time. looks like I can't get registry view

d95776 avatar Aug 27 '22 18:08 d95776

once I setup https_proxy, we got error Devfile Registry is not accessible.

d95776 avatar Aug 27 '22 18:08 d95776

It seems that odo losing error info when requesting devfiles from registry could you run command from issue description with -v 10 and see if there are any errors related to communication with registry?

dgolovin avatar Aug 29 '22 21:08 dgolovin

could you please tell the command and from where to run it?

d95776 avatar Aug 29 '22 22:08 d95776

use terminal view in vscode and run this: "/Users/hchen/.vscode/extensions/redhat.vscode-openshift-connector-0.4.0-darwin-x64/out/tools/darwin/odo" catalog list components -o json -v 10

dgolovin avatar Aug 29 '22 22:08 dgolovin

The command I found is a little bit different from you provided. Here's the result "/Users/hchen/.vscode/extensions/redhat.vscode-openshift-connector-0.6.0-darwin-x64/out/tools/darwin/odo-darwin-amd64" catalog list components -o json -v 10 I0829 19:04:01.029677 92576 util.go:795] HTTPGetRequest: https://raw.githubusercontent.com/redhat-developer/odo/master/build/VERSION I0829 19:04:01.029790 92576 implem.go:107] The path for preference file is /Users/hchen/.odo/preference.yaml I0829 19:04:01.031362 92576 util.go:816] Response will be cached in /var/folders/1w/spg6p9ns2l71rt48yvkv107c7l6swt/T/odohttpcache for 1h0m0s ? Help odo improve by allowing it to collect usage data. Read about our privacy statement: https://developers.redhat.com/article/tool-data-collection. You can change your preference later by changing the ConsentTelemetry preference. (Y/n) I0829 19:04:01.616292 92576 version.go:143] Error checking if newer odo release is available: unable to get latest release tag: error getting latest release: fail to retrive https://raw.githubusercontent.com/redhat-developer/odo/master/build/VERSION: Not Found ? Help odo improve by allowing it to collect usage data. Read about our privacy statement: https://developers.redhat.com/article/tool-data-collection. You can change your preference later by changing the ConsentTelemetry preference. Yes I0829 19:05:03.759284 92576 segment.go:251] Checking telemetry enable status

{ "kind": "Error", "apiVersion": "odo.dev/v1alpha1", "metadata": { "creationTimestamp": null }, "message": "no deployable components found" }

d95776 avatar Aug 30 '22 00:08 d95776

I don't see anything specific to registry, it looks like registry literally has no components. What does command below print out?

"/Users/hchen/.vscode/extensions/redhat.vscode-openshift-connector-0.4.0-darwin-x64/out/tools/darwin/odo" registry list

dgolovin avatar Aug 30 '22 04:08 dgolovin

run /Users/hchen/.vscode/extensions/redhat.vscode-openshift-connector-0.6.0-darwin-x64/out/tools/darwin/odo-darwin-amd64 registry list get the following NAME URL SECURE DefaultDevfileRegistry https://registry.devfile.io No

d95776 avatar Sep 18 '22 04:09 d95776

any one could still look at the issue?

d95776 avatar Nov 03 '22 01:11 d95776

@d95776 yes. Please try latest release of the CLI we use under the hood.

https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/odo/v3.1.0/odo-darwin-amd64.tar.gz

odo-darwin-amd64 registry list

It supposed to show underlying cause when it cannot required info from the registry.

dgolovin avatar Nov 03 '22 17:11 dgolovin

./odo-darwin-amd64 registry list ⚠ Registry DefaultDevfileRegistry is not set up properly with error: Get "https://registry.devfile.io/index": context deadline exceeded (Client.Timeout exceeded while awaiting headers), please check the registry URL, and credential and remove add the registry again (refer to odo preference add registry --help)

✗ no deployable components found

d95776 avatar Nov 04 '22 03:11 d95776

there's a proxy and how to pass it

d95776 avatar Nov 04 '22 03:11 d95776

@d95776 thanks! At least it shows the error now not just saying 'no components found'.

Could you check if you can access the registry with HTTPS_PROXY env var set as it is shown below?

HTTPS_PROXY=https://url-to-proxy odo-darwin-amd64 registry list

If that works I'll provide the setting to setup proxy for accessing the registry and you would be able to use the extension.

dgolovin avatar Nov 04 '22 04:11 dgolovin

tried HTTPS_PROXY=https://url-to-proxy odo-darwin-amd64 registry list and get same error. our proxy also requires certificate. for this request, how to set it up?

d95776 avatar Nov 04 '22 13:11 d95776

@d95776 I have no solution for that yet. There seems not way to configure sert using env vars. How do you configure that in OS?

dgolovin avatar Nov 08 '22 05:11 dgolovin

proxy are not set at OS level. we set proxy for each application. However, a lot of applications use env var http_proxy and certificate store is set differently for different app. May I ask why we need to access registry even we use on prem openshift? also can registry be a file and can be uploaded into the plugin?

d95776 avatar Nov 08 '22 17:11 d95776