odo icon indicating copy to clipboard operation
odo copied to clipboard

missing information why `odo dev` failed

Open kadel opened this issue 3 years ago • 0 comments

/kind bug /priority high

What versions of software are you using?

Operating System: MacOS

Output of odo version: odo v3.0.0-beta2 (c8e4458f4)

Server: https://api.crc.testing:6443 Kubernetes: v1.23.5+b463d71

How did you run odo exactly?

odo dev

on a springboot project with devfile that contained ServiceBinding to not existing service.

devfile.yaml
commands:
- exec:
    commandLine: mvn clean -Dmaven.repo.local=/home/user/.m2/repository package -Dmaven.test.skip=true
    component: tools
    group:
      isDefault: true
      kind: build
    hotReloadCapable: false
    workingDir: ${PROJECT_SOURCE}
  id: build
- exec:
    commandLine: mvn -Dmaven.repo.local=/home/user/.m2/repository spring-boot:run
    component: tools
    group:
      isDefault: true
      kind: run
    hotReloadCapable: false
    workingDir: ${PROJECT_SOURCE}
  id: run
- exec:
    commandLine: java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=${DEBUG_PORT},suspend=n
      -jar target/*.jar
    component: tools
    group:
      isDefault: true
      kind: debug
    hotReloadCapable: false
    workingDir: ${PROJECT_SOURCE}
  id: debug
components:
- container:
    dedicatedPod: false
    endpoints:
    - name: 8080-tcp
      secure: false
      targetPort: 8080
    env:
    - name: DEBUG_PORT
      value: "5858"
    image: quay.io/eclipse/che-java11-maven:next
    memoryLimit: 768Mi
    mountSources: true
    volumeMounts:
    - name: m2
      path: /home/user/.m2
  name: tools
- name: m2
  volume:
    ephemeral: false
    size: 3Gi
- kubernetes:
    inlined: |
      apiVersion: binding.operators.coreos.com/v1alpha1
      kind: ServiceBinding
      metadata:
        creationTimestamp: null
        name: app-db
      spec:
        application:
          group: apps
          kind: Deployment
          name: my-java-springboot-app-app
          version: v1
        bindAsFiles: false
        detectBindingResources: true
        services:
        - group: pxc.percona.com
          id: app-db
          kind: PerconaXtraDBCluster
          name: non-existing
          resource: perconaxtradbclusters
          version: v1-8-0
      status:
        secret: ""
  name: app-db
metadata:
  description: Spring Boot® using Java
  displayName: Spring Boot®
  globalMemoryLimit: 2674Mi
  icon: https://spring.io/images/projects/spring-edf462fec682b9d48cf628eaf9e19521.svg
  language: java
  name: my-java-springboot-app
  projectType: spring
  tags:
  - Java
  - Spring
  version: 1.1.0
schemaVersion: 2.1.0
starterProjects:
- git:
    remotes:
      origin: https://github.com/odo-devfiles/springboot-ex.git
  name: springbootproject

Actual behavior

▶ odo dev
  __
 /  \__     Developing using the my-java-springboot-app Devfile
 \__/  \    Namespace: asdf
 /  \__/    odo version: v3.0.0-beta2
 \__/

↪ Deploying to the cluster in developer mode
 ✓  Added storage m2 to my-java-springboot-app
 ✓  Creating kind ServiceBinding [12ms]
 ✗  Waiting for Kubernetes resources [1m]
Cleaning resources, please wait
 ✗  timeout while waiting for "my-java-springboot-app-app-f5bc79c77-z9tch" pod to be deleted

Expected behavior

odo printing information why it failed.

Something similar what odo dev outputs when the pod failed (for example due to invalid image)

`odo dev` when pod fails
▶ odo dev
  __
 /  \__     Developing using the my-java-springboot-app Devfile
 \__/  \    Namespace: asdf
 /  \__/    odo version: v3.0.0-beta2
 \__/

↪ Deploying to the cluster in developer mode
 ✓  Added storage m2 to my-java-springboot-app
 ✗  Waiting for Kubernetes resources [5m]
Cleaning resources, please wait
 ✗  error while waiting for deployment rollout: timeout while waiting for my-java-springboot-app-app deployment roll out\nFor more information to help determine the cause of the error, re-run with '-v'.
See below for a list of failed events that occured more than 5 times during deployment:

 NAME                                                          COUNT  REASON            MESSAGE

 cluster1-haproxy-0.1705a6d65907cdac                           12     Unhealthy         Readiness probe failed: ERROR
                                                                                        2013 (HY000): Lost connection
                                                                                        to MySQL server at 'reading
                                                                                        initial communication packet',
                                                                                        system error: 2
 cluster1-haproxy-1.1705a6e454c20f99                           133    FailedScheduling  0/1 nodes are available:
                                                                                        1 node(s) didn't match pod
                                                                                        anti-affinity rules.
 cluster1-pxc-1.1705a6e38118fd0d                               133    FailedScheduling  0/1 nodes are available:
                                                                                        1 node(s) didn't match pod
                                                                                        anti-affinity rules.
 my-java-springboot-app-app-75f4cbf595-h2xxm.1705ac9a0a3e94e0  6      Failed            Error: ImagePullBackOff

Any logs, error output, etc?

For users, this situation is hard to debug. When odo dev finishes, it deletes all the resources. User is left with failed odo dev with no information how to fix it.

While odo dev is still running you can see the reason why it failed

▶ kubectl get servicebindings
NAME     READY   REASON            AGE
app-db   False   ProcessingError   13s


▶ kubectl get servicebindings -o yaml
...
...
  status:
    conditions:
    - lastTransitionTime: "2022-07-27T11:32:30Z"
      message: perconaxtradbclusters.pxc.percona.com "non-existing" not found
      reason: ErrorReadingServices
      status: "False"
      type: CollectionReady
    - lastTransitionTime: "2022-07-27T11:32:30Z"
      message: perconaxtradbclusters.pxc.percona.com "non-existing" not found
      reason: ProcessingError
      status: "False"
      type: Ready
    secret: ""
...
...

At least the user should know that the problem was with ServiceBinding due to ProcessingError

kadel avatar Jul 27 '22 11:07 kadel