Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Cancelling a task that is ended results in runtime panic #4016

Closed
mjwhodur opened this issue Oct 10, 2022 · 1 comment · Fixed by #4019
Closed

Cancelling a task that is ended results in runtime panic #4016

mjwhodur opened this issue Oct 10, 2022 · 1 comment · Fixed by #4019
Assignees
Labels
bug Something isn't working cli

Comments

@mjwhodur
Copy link

mjwhodur commented Oct 10, 2022

Describe the bug
Runtime panic on canceling a task that is (probably) ended.

Steps to Reproduce

  1. Find a task in waypoint-runner assigned to the runner.
  2. Try to cancel it with the following command.

Please include any waypoint.hcl files if applicable, as well as a
GitHub Gist of any relevant logs or steps to
reproduce the bug. Running waypoint commands with -v up to -vvv will
include any additional debugging info in the log.

(env) michal.weglowskihodur@mhodur1m-war1 psi % waypoint task cancel -run-job-id=01GEMEGQERGV02QQJVTWQT32SF -vv  
2022-10-10T11:10:18.939+0200 [INFO]  waypoint: waypoint version: full_string="v0.10.2 (2c9926ef8)" version=v0.10.2 prerelease="" metadata="" revision=2c9926ef8
2022-10-10T11:10:18.940+0200 [DEBUG] waypoint: home configuration directory: path=/Users/michal.weglowskihodur/Library/Preferences/waypoint
2022-10-10T11:10:18.946+0200 [INFO]  waypoint.server: attempting to source credentials and connect
2022-10-10T11:10:18.948+0200 [DEBUG] waypoint.serverclient: connection information: address=192.168.0.140:9701 tls=true tls_skip_verify=true send_auth=true has_token=true
2022-10-10T11:10:19.009+0200 [DEBUG] waypoint.server: connection established with sourced credentials
2022-10-10T11:10:19.019+0200 [INFO]  waypoint: server version info: version=v0.10.2 api_min=1 api_current=1 entrypoint_min=1 entrypoint_current=1
2022-10-10T11:10:19.019+0200 [INFO]  waypoint: negotiated api version: version=1

2022-10-10T11:10:19.019+0200 [WARN]  waypoint: context cancelled, stopping interrupt listener loop
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/hashicorp/waypoint/internal/cli.(*TaskCancelCommand).Run(0x14000dda3f0, {0x140002d07f0, 0x1, 0x1})
        /home/circleci/project/waypoint/internal/cli/task_cancel.go:33 +0x724
github.com/mitchellh/cli.(*CLI).Run(0x14000c71cc0)
        /home/circleci/go/pkg/mod/github.com/mitchellh/[email protected]/cli.go:262 +0x5c4
github.com/hashicorp/waypoint/internal/cli.Main({0x14000180050, 0x5, 0x5})
        /home/circleci/project/waypoint/internal/cli/main.go:127 +0x5cc
main.main()
        /home/circleci/project/waypoint/cmd/waypoint/main.go:14 +0xb4

Expected behavior
Message: This job has been already finished

Waypoint Platform Versions
Additional version and platform information to help triage the issue if
applicable:

  • Waypoint CLI Version: v0.10.2 (2c9926e)
  • Waypoint Server Platform and Version: (like docker, nomad, kubernetes): nomad
  • Waypoint Plugin: (like aws/ecs, pack, azure): ?

Additional context
I am now fighting with Waypoint on Nomad. The aim is to create self-deployable git repo with possibility of exposing to the internet. There was a problem with the installation of the waypoint runner in the home-lab. Needed to do some workarounds with runner on nomad (the installer doesn't give all necessary config). But, after initial fights, it came to my attention that since waypoint server was running, there were loads and loads of tasks.

(env) michal.weglowskihodur@mhodur1m-war1 psi % waypoint task list
! grpc: received message larger than max (7870376 vs. 4194304)
(env) michal.weglowskihodur@mhodur1m-war1 psi % 

Ooooops.

@briancain
Copy link
Member

👋🏻 Hey there @mjwhodur - I've fixed this panic via #4019 and it should go out in our next minor release. Thanks for reporting this issue!

As far as the grpc error goes, we do know about this issue with our API and have plans to introduce pagination to work within the grpc data limits for requests. You can follow that here: #3439

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working cli
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants