redhat-developer / odo

odo - Developer-focused CLI for fast & iterative container-based application development on Podman and Kubernetes. Implementation of the open Devfile standard.
https://odo.dev
Apache License 2.0
792 stars 244 forks source link

Registry not setup properly error when listing registry components #4855

Closed mezarin closed 1 year ago

mezarin commented 3 years ago

/kind bug

What versions of software are you using?

Operating System: MAC

Output of odo version: v2.2.2

How did you run odo exactly?

  1. Install the devfile registry operator (https://github.com/devfile/registry-operator).

  2. Deploy the custom registry using the DevfileRegistry resource. Note that you can also recreate the issue with the default image as shown below:

    apiVersion: registry.devfile.io/v1alpha1
    kind: DevfileRegistry
    metadata:
    name: my-devfile-registry
    spec:
    devfileIndexImage: quay.io/devfile/devfile-index:next
    tls:
    enabled: false

    Once deployed, i can see that the registry index is being served by going to the created route location. I could also access the index using a curl command.

  3. Add the custom registry URL to odo's registry list:

    odo registry add test http://<ROUTE-location-to-custom-registry-by-registry-opeator>
    odo registry list
    NAME                       URL                                                                                SECURE
    test                       http://<ROUTE-location-to-custom-registry-by-registry-opeator>                     No
    DefaultDevfileRegistry     https://registry.devfile.io                                                        No
  4. Display the components associated with registries known to odo:

odo catalog list components

Actual behavior

When listing odo components, the components for registry test are not listed.

See:

Registry test is not set up properly with error: Get "http://<ROUTE-location-to-custom-registry-by-registry-opeator>/index": dial tcp: lookup <ROUTE-location-to-custom-registry-by-registry-opeator> on www.xxx.y.z:53: no such host, please check the registry URL and credential (refer `odo registry update --help`)

Here:

odo catalog list components

 ⚠  Registry test is not set up properly with error: Get "http://<ROUTE-location-to-custom-registry-by-registry-opeator>/index": dial tcp: lookup <ROUTE-location-to-custom-registry-by-registry-opeator> on www.xxx.y.z:53: no such host, please check the registry URL and credential (refer `odo registry update --help`)

Odo Devfile Components:
NAME                          DESCRIPTION                                                         REGISTRY
java-maven                    Upstream Maven and OpenJDK 11                                       DefaultDevfileRegistry
java-openliberty              Java application stack using Open Liberty runtime                   DefaultDevfileRegistry
java-quarkus                  Quarkus with Java                                                   DefaultDevfileRegistry
java-springboot               Spring Boot® using Java                                             DefaultDevfileRegistry
java-vertx                    Upstream Vert.x using Java                                          DefaultDevfileRegistry
java-wildfly                  Upstream WildFly                                                    DefaultDevfileRegistry
java-wildfly-bootable-jar     Java stack with WildFly in bootable Jar mode, OpenJDK 11 and...     DefaultDevfileRegistry
nodejs                        Stack with Node.js 14                                               DefaultDevfileRegistry
python                        Python Stack with Python 3.7                                        DefaultDevfileRegistry
python-django                 Python3.7 with Django                                               DefaultDevfileRegistry

Odo S2I Components:
NAME       PROJECT       TAGS                      SUPPORTED
java       openshift     11,8,latest               YES
nodejs     openshift     10,12,latest              YES
dotnet     openshift     2.1,3.1,latest            NO
golang     openshift     1.11.5,latest             NO
httpd      openshift     2.4,latest                NO
nginx      openshift     1.10,1.14,1.16,latest     NO
perl       openshift     5.26,latest               NO
php        openshift     7.2,7.3,latest            NO
python     openshift     2.7,3.6,latest            NO
ruby       openshift     2.4,2.5,2.6,latest        NO

Expected behavior

When listing odo components, I would have expected to see the components for registry test listed as below:

 odo catalog list components
Odo Devfile Components:
NAME                          DESCRIPTION                                                         REGISTRY
java-maven                    Upstream Maven and OpenJDK 11                                       test
java-openliberty              Java application stack using Open Liberty runtime                   test
java-quarkus                  Quarkus with Java                                                   test
java-springboot               Spring Boot® using Java                                             test
java-vertx                    Upstream Vert.x using Java                                          test
java-wildfly                  Upstream WildFly                                                    test
java-wildfly-bootable-jar     Java stack with WildFly in bootable Jar mode, OpenJDK 11 and...     test
nodejs                        Stack with Node.js 14                                               test
python                        Python Stack with Python 3.7                                        test
python-django                 Python3.7 with Django                                               test
java-maven                    Upstream Maven and OpenJDK 11                                       DefaultDevfileRegistry
java-openliberty              Java application stack using Open Liberty runtime                   DefaultDevfileRegistry
java-quarkus                  Quarkus with Java                                                   DefaultDevfileRegistry
java-springboot               Spring Boot® using Java                                             DefaultDevfileRegistry
java-vertx                    Upstream Vert.x using Java                                          DefaultDevfileRegistry
java-wildfly                  Upstream WildFly                                                    DefaultDevfileRegistry
java-wildfly-bootable-jar     Java stack with WildFly in bootable Jar mode, OpenJDK 11 and...     DefaultDevfileRegistry
nodejs                        Stack with Node.js 14                                               DefaultDevfileRegistry
python                        Python Stack with Python 3.7                                        DefaultDevfileRegistry
python-django                 Python3.7 with Django                                               DefaultDevfileRegistry
...

Any logs, error output, etc?

This appears to work on Linux. The expected output above was generated by running the described scenario on a Linux system.

openshift-bot commented 3 years ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot commented 3 years ago

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

dharmit commented 3 years ago

/remove-lifecycle rotten

@mezarin I think things are working fine for me since I'm on Linux (I see you already mentioned that in your comment.) I'll check with someone on our team who's not on Linux. Mainly macOS like you.

Sorry about taking long on this.

dharmit commented 3 years ago

I was able to get hold of a mac mini, but wasn't able to reproduce the problem with odo 2.4.1. I installed the registry using OpenShift section in their README. And I tried on OCP 4.8:

$ uname -a
Darwin xxxxxx 19.0.0 Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64 x86_64

$ odo version
odo v2.4.1 (0850e6650)

$ odo registry list
NAME                       URL                                            SECURE
test                       http://xxxx/                                   No
DefaultDevfileRegistry     https://registry.devfile.io                    No

$ odo catalog list components
Odo Devfile Components:
NAME                          DESCRIPTION                                                         REGISTRY
dotnet50                      Stack with .NET 5.0                                                 test
dotnetcore31                  Stack with .NET Core 3.1                                            test
go                            Stack with the latest Go version                                    test
java-maven                    Upstream Maven and OpenJDK 11                                       test
java-openliberty              Java application Maven-built stack using the Open Liberty ru...     test
java-openliberty-gradle       Java application Gradle-built stack using the Open Liberty r...     test
java-quarkus                  Quarkus with Java                                                   test
java-springboot               Spring Boot® using Java                                             test
java-vertx                    Upstream Vert.x using Java                                          test
java-wildfly                  Upstream WildFly                                                    test
java-wildfly-bootable-jar     Java stack with WildFly in bootable Jar mode, OpenJDK 11 and...     test
nodejs                        Stack with Node.js 14                                               test
nodejs-angular                Stack with Angular 12                                               test
nodejs-nextjs                 Stack with Next.js 11                                               test
nodejs-nuxtjs                 Stack with Nuxt.js 2                                                test
nodejs-react                  Stack with React 17                                                 test
nodejs-svelte                 Stack with Svelte 3                                                 test
nodejs-vue                    Stack with Vue 3                                                    test
php-laravel                   Stack with Laravel 8                                                test
python                        Python Stack with Python 3.7                                        test
python-django                 Python3.7 with Django                                               test
go                            Stack with the latest Go version                                    DefaultDevfileRegistry
java-maven                    Upstream Maven and OpenJDK 11                                       DefaultDevfileRegistry
java-openliberty              Java application stack using Open Liberty runtime                   DefaultDevfileRegistry
java-openliberty-gradle       Java application Gradle built stack using the Open Liberty r...     DefaultDevfileRegistry
java-quarkus                  Quarkus with Java                                                   DefaultDevfileRegistry
java-springboot               Spring Boot® using Java                                             DefaultDevfileRegistry
java-vertx                    Upstream Vert.x using Java                                          DefaultDevfileRegistry
java-wildfly                  Upstream WildFly                                                    DefaultDevfileRegistry
java-wildfly-bootable-jar     Java stack with WildFly in bootable Jar mode, OpenJDK 11 and...     DefaultDevfileRegistry
nodejs                        Stack with Node.js 14                                               DefaultDevfileRegistry
nodejs-angular                Stack with Angular 12                                               DefaultDevfileRegistry
nodejs-nextjs                 Stack with Next.js 11                                               DefaultDevfileRegistry
nodejs-nuxtjs                 Stack with Nuxt.js 2                                                DefaultDevfileRegistry
nodejs-react                  Stack with React 17                                                 DefaultDevfileRegistry
nodejs-svelte                 Stack with Svelte 3                                                 DefaultDevfileRegistry
nodejs-vue                    Stack with Vue 3                                                    DefaultDevfileRegistry
php-laravel                   Stack with Laravel 8                                                DefaultDevfileRegistry
python                        Python Stack with Python 3.7                                        DefaultDevfileRegistry
python-django                 Python3.7 with Django                                               DefaultDevfileRegistry
kadel commented 3 years ago
Registry test is not set up properly with error: Get "http://<ROUTE-location-to-custom-registry-by-registry-opeator>/index": dial tcp: lookup <ROUTE-location-to-custom-registry-by-registry-opeator> on www.xxx.y.z:53: no such host, please check the registry URL and credential (refer `odo registry update --help`)

The error is complaining about DNS name resolution, so it look like the something with the DNS setup on the machine on cluster. @mezarin What cluster have you been using? Was it CRC?

mezarin commented 3 years ago

@dharmit, @kadel.

I am using: OCP 4.7.13

Here is more info:

$ uname -a
Darwin xxxx 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

$ odo version
odo v2.4.1 (dbf7ad592)

$ odo registry list
NAME                       URL                                                                            SECURE
test                       http://devfile-registry-registry-operator-system.apps.xxxx.xx.xxxx.ibm.com     No
DefaultDevfileRegistry     https://registry.devfile.io                                                    No

$ curl -L http://devfile-registry-registry-operator-system.apps.xxxx.xx.xxxx.ibm.com
[
  {
    "name": "dotnet50",
    "version": "1.0.0",
    "displayName": ".NET 5.0",
    "description": "Stack with .NET 5.0",
    "type": "stack",
    "tags": [
      "dotnet"
    ],
    "icon": "https://developers.redhat.com/sites/default/files/styles/large/public/dotnet-logo3x3.jpg",
    "projectType": "dotnet",
    "language": "dotnet",
    "links": {
      "self": "devfile-catalog/dotnet50:latest"
    },
    "resources": [
      "devfile.yaml"
    ],
    "starterProjects": [
      "dotnet"
    ]
  },
...
]

 $odo catalog list components
 ⚠  Registry test is not set up properly with error: Get "http://devfile-registry-registry-operator-system.apps.xxxx.xx.xxxx.ibm.com/index": dial tcp: lookup devfile-registry-registry-operator-system.apps.xxxx.xx.xxxx.ibm.com on 192.168.xx.xx:xx: no such host, please check the registry URL and credential (refer `odo registry update --help`)

Odo Devfile Components:
NAME                          DESCRIPTION                                                         REGISTRY
go                            Stack with the latest Go version                                    DefaultDevfileRegistry
java-maven                    Upstream Maven and OpenJDK 11                                       DefaultDevfileRegistry
java-openliberty              Java application stack using Open Liberty runtime                   DefaultDevfileRegistry
java-openliberty-gradle       Java application Gradle built stack using the Open Liberty r...     DefaultDevfileRegistry
...
mezarin commented 3 years ago

@dharmit, @kadel. I've been trying a few things, and i was finally able to get this to work by adding the route URL to my /etc/hosts file and rebooting.

odo catalog list components
Odo Devfile Components:
NAME                          DESCRIPTION                                                         REGISTRY
dotnet50                      Stack with .NET 5.0                                                 test
dotnetcore31                  Stack with .NET Core 3.1                                            test
go                            Stack with the latest Go version                                    test
java-maven                    Upstream Maven and OpenJDK 11                                       test
java-openliberty              Java application Maven-built stack using the Open Liberty ru...     test
java-openliberty-gradle       Java application Gradle-built stack using the Open Liberty r...     test
java-quarkus                  Quarkus with Java                                                   test
...
dotnet50                      Stack with .NET 5.0                                                 DefaultDevfileRegistry
dotnetcore31                  Stack with .NET Core 3.1                                            DefaultDevfileRegistry
go                            Stack with the latest Go version                                    DefaultDevfileRegistry
java-maven                    Upstream Maven and OpenJDK 11                                       DefaultDevfileRegistry
...

Thanks for looking into this. I think the issue can be closed now.

kadel commented 3 years ago

@dharmit, @kadel. I've been trying a few things, and i was finally able to get this to work by adding the route URL to my /etc/hosts file and rebooting.

This is interesting. Without adding it to /etc/hosts are you able to access registry outside odo? For example with curl http://devfile-registry-registry-operator-system.apps.xxxx.xx.xxxx.ibm.com/index ?

mezarin commented 3 years ago

This is interesting. Without adding it to /etc/hosts are you able to access registry outside odo? For example with curl http://devfile-registry-registry-operator-system.apps.xxxx.xx.xxxx.ibm.com/index ?

Yeah i am able to display the index using curl without updating /etc/hosts ... see the output in my previous reply: https://github.com/openshift/odo/issues/4855#issuecomment-953197780

kadel commented 3 years ago

Yeah i am able to display the index using curl without updating /etc/hosts ... see the output in my previous reply: #4855 (comment)

oh, sorry, I missed that. In that case I'm not going to close this issue, this looks like it actually might be a bug in odo.