Page MenuHomePhabricator

[tbs.cli] The cancel command should show a useful message when the connection to tekton works but returns http error (requests.exceptions.HTTPError)
Closed, ResolvedPublic

Description

Triggered by deleting the deployments under tekton-pipelines namespace.

Example of failing run:

toolsbeta.test@toolsbeta-sgebastion-05:~$ toolforge build cancel test-buildpacks-pipelinerun-2mj9x
I'm going to cancel 1 runs, continue? [y/N]: y
Traceback (most recent call last):
  File "/usr/bin/toolforge", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/toolforge_cli/cli.py", line 645, in main
    toolforge()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/toolforge_cli/cli.py", line 342, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/toolforge_cli/cli.py", line 540, in build_cancel
    json_patches=[{"op": "add", "path": "/spec/status", "value": "PipelineRunCancelled"}],
  File "/usr/lib/python3/dist-packages/toolforge_cli/k8sclient.py", line 217, in patch_object
    headers={"Content-type": "application/json-patch+json"},
  File "/usr/lib/python3/dist-packages/toolforge_cli/k8sclient.py", line 142, in _patch
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://k8s.toolsbeta.eqiad1.wikimedia.cloud:6443/apis/tekton.dev/v1beta1/namespaces/image-build/pipelineruns/test-buildpacks-pipelinerun-2mj9x

Event Timeline

dcaro renamed this task from [tbs.cli] The cancel command should show a useful message when the connection to tekton fails (requests.exceptions.HTTPError) to [tbs.cli] The cancel command should show a useful message when the connection to tekton works but returns http error (requests.exceptions.HTTPError).Mar 7 2023, 12:46 PM
dcaro created this task.

Change 899165 had a related patch set uploaded (by Raymond Ndibe; author: Raymond Ndibe):

[cloud/toolforge/toolforge-cli@main] cli: build cancel show a useful message when http error

https://gerrit.wikimedia.org/r/899165

Raymond_Ndibe changed the task status from Open to Stalled.Mar 15 2023, 5:06 AM
Raymond_Ndibe claimed this task.
dcaro changed the task status from Stalled to In Progress.Mar 15 2023, 8:56 AM

Change 899165 merged by jenkins-bot:

[cloud/toolforge/toolforge-cli@main] cli: build cancel show a useful message when http error

https://gerrit.wikimedia.org/r/899165