Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Error message: Can we improve error message on API errors due to shipyard parsing #6592

Closed
2 of 13 tasks
kethahel99 opened this issue Jan 14, 2022 · 0 comments · Fixed by #6606
Closed
2 of 13 tasks
Assignees
Labels
type:bug Something is not working as intended/documented

Comments

@kethahel99
Copy link

Your issue may already be reported! Please search on the issue tracker before creating a new one.

Environment
Any keptn installation

  • Client OS (e.g., Linux, macOS, Windows): Windows
  • Keptn Version (keptn version): 0.11.4
  • Kubernetes Cloud Provider (e.g., GKE, AKS): AKS
  • Kubernetes version (kubectl version):1.20.9
N/A

Affected Component

  • Approval
  • Bridge
  • CLI
  • Datastore
  • Docs
  • Distributor / Event Broker
  • Helm
  • Istio
  • Jmeter
  • Kubernetes Integration
  • Openshift Integration
  • REST API
  • Webhook

Describe the bug
If you shipyard.yaml is not properly formatted .e.g indentiation, then you will receive and API error "sequence tasks not iterable" message . As a result, you might have later (e.g. webhook or job-executor service) when trying to configure event subscriptions in the bridge
image

To Reproduce

Steps to reproduce the behavior:

  1. Change you shipyard.yaml file and decrease the indentiation of a task or tasks under one or more sequences e.g:
apiVersion: "spec.keptn.sh/0.2.2"
kind: "Shipyard"
metadata:
  name: "shipyard-quality-gates"
spec:
  stages:
  - name: "quality-gate"
    sequences:
      - name: evaluation
        tasks:
        - name: monaco
        - name: evaluation
      - name: simple_evaluation
        tasks:
      - name: evaluation
        triggeredAfter: "6m"
        properties:
          timeframe: "6m"      

Note, that the evaluation task in the simple_evaluation sequence should have indentation for this to work properly e.g.

apiVersion: "spec.keptn.sh/0.2.2"
kind: "Shipyard"
metadata:
  name: "shipyard-quality-gates"
spec:
  stages:
  - name: "quality-gate"
    sequences:
      - name: evaluation
        tasks:
        - name: monaco
        - name: evaluation
      - name: simple_evaluation
        tasks:
        - name: evaluation
          triggeredAfter: "6m"
          properties:
            timeframe: "6m"      
  1. Go to Uniform
  2. Click on e.g. webhook-service
  3. Click on Add subscription
  4. The bridge UI will show a loading screen and the console will eventually report an HTTP 500 error
  5. See error
    image

Expected behavior
Perhaps a more clear error mesasge like:

"The API cannot iterate though the tasks in your sequence : {sequence name}. Please verify that your shipyard.yaml is correct. Ensure to check indentation and format."

Current behavior
API error given is "sequence tasks not iterable" and error is not handled with clear message on the UI

Screenshots
image
image
image

Additional context
N/A

@kethahel99 kethahel99 added the type:bug Something is not working as intended/documented label Jan 14, 2022
@bacherfl bacherfl self-assigned this Jan 17, 2022
@ermin-muratovic ermin-muratovic self-assigned this Jan 17, 2022
@johannes-b johannes-b added this to the 0.13.0 (Bridge) milestone Jan 20, 2022
ermin-muratovic added a commit that referenced this issue Jan 28, 2022
…6592) (#6606)

* add keptn logo as svg and transparent background

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* add logo as png

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* revert logo.png

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* show error when problem with parsing shipyard.yaml

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* throw error when problem with parsing shipyard.yaml

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* don't hide error message automatically

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* fix unit tests

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* fix unit tests

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* fix unit tests

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* use errorMessage: string instead of Observable and reload page correctly

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* remove console.log

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* add uitestid on reload button

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* don't throw error, just show notification

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* ui test for error message

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* throw error correctly in catchError

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* add test for bridge-server in case of invalid shipyard.yaml

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* end with expect

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* use app instead of global.app

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* response code should be 500

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* add return

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* fix logoUrl

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* add errorCount also to second test

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* fix ui test

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* fix ui tests

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* fix ui tests

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>

* xit tests with HTTP error status

Signed-off-by: ermin.muratovic <ermin.muratovic@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:bug Something is not working as intended/documented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants