hashicorp / waypoint

A tool to build, deploy, and release any application on any platform.
https://waypointproject.io
Other
4.76k stars 327 forks source link

UI/Server: UI does not surface latest project job failures #3157

Open briancain opened 2 years ago

briancain commented 2 years ago

Describe the bug

If a new project has an initial error, such as https://github.com/hashicorp/waypoint/issues/2454 where the Init operation fails to find git on the path, then the following operation QueueProject also fails, the UI never updates to say the latest failure in the project.

Screenshot from 2022-03-29 11-16-30

brian@localghost:k8s λ waypoint job list                                                                                                                                                                                                                                                          ±[main]

» Waypoint Jobs
              ID             |  OPERATION   |  STATE  | TIME COMPLETED |       TARGET RUNNER        | WORKSPACE |      PROJECT       | APPLICATION
-----------------------------+--------------+---------+----------------+----------------------------+-----------+--------------------+--------------
  01FZBE7Q04J7ZRGCWKV3D9BC0D | StopTask     | Success | 16 seconds ago | *                          | default   | go-gitops-0        |
  01FZBE7PZY9FXYZ1VCN9J470BH | Poll         | Success | 16 seconds ago | 01FZBE7PZZJSC3CY8M74WYB9BA | default   | go-gitops-0        |
  01FZBE7Q04SKMXMREBSDV7K8CS | StartTask    | Success | 19 seconds ago | *                          | default   | go-gitops-0        |
  01FZBE6WMW5KMJTJGDHM9S5FQR | StopTask     | Success | 42 seconds ago | *                          | default   | go-gitops-0        |
  01FZBE6WMPRSBANGRFQ899B0HY | QueueProject | Error   | 42 seconds ago | 01FZBE6WMPMMXNACFGGG32YJ8P | default   | go-gitops-0        |
  01FZBE6SPAZDS7VP8YZ64Y7ZGE | StopTask     | Success | 46 seconds ago | *                          | default   | go-gitops-0        |
  01FZBE6WMWMZXE60S7JHAFVTC0 | StartTask    | Success | 46 seconds ago | *                          | default   | go-gitops-0        |
  01FZBE6SP2K27EB2SKBR3GR8K8 | Poll         | Success | 46 seconds ago | 01FZBE6SP2MX082NWJEBRZ2MEZ | default   | go-gitops-0        |
  01FZBE6SPAFHT0PDXHABDE2KSY | StartTask    | Success | 49 seconds ago | *                          | default   | go-gitops-0        |
  01FZBE6MQRWR2EXB4M1TKTTD28 | StopTask     | Success | 51 seconds ago | *                          | default   | go-gitops-0        |
  01FZBE6MQNHN2P7ME5JX4J1XH5 | Init         | Error   | 52 seconds ago | 01FZBE6MQNSMFA1TQF9D5V9S7B | default   | go-gitops-0        |
  01FZBE6G9D4DG8WAPJRXPVT571 | StopTask     | Success | 53 seconds ago | *                          | default   | go-gitops-0        |
  01FZBE6G9BN0V13FN37BNP3GF2 | Init         | Error   | 53 seconds ago | 01FZBE6G9BVDT5C7JZ9ZEXB1N3 | default   | go-gitops-0        |
  01FZBE6MQRD3A1X9BJGZQYNGW6 | StartTask    | Success | 54 seconds ago | *                          | default   | go-gitops-0        |
  01FZBE6G9DC7QFES5FQNV0DKGQ | StartTask    | Success | 59 seconds ago | *                          | default   | go-gitops-0        |
  01FZBE1SA58CZMMXS41ATHK5P9 | Up           | Success | 3 minutes ago  | 01FZBE1RSZ9BF6T0YSTRC787AW | default   | k8s-tetris-project | tetris
  01FZBDVP87CT5PG250AFDBRRB6 | Up           | Error   | 6 minutes ago  | 01FZBDVNR8NQ18VZAF8V1PZMES | default   | k8s-tetris-project | tetris

brian@localghost:k8s λ waypoint job inspect  01FZBE6WMPRSBANGRFQ899B0HY                                                                                                                                                                                                                           ±[main]

» Job Configuration
             ID: 01FZBE6WMPRSBANGRFQ899B0HY
   Singleton ID: poll-trigger/go-gitops-0//default
      Operation: QueueProject
  Target Runner: 01FZBE6WMPMMXNACFGGG32YJ8P
      Workspace: default
        Project: go-gitops-0

» Job Results
           State: Error
   Complete Time: 4 minutes ago
  Error Messsage: /kaniko/tmp/waypoint3633120895/k8s/waypoint.hcl:11,1-15: Unset variable "tag"; A variable must be set or have a default value; see https://www.waypointproject.io/docs/waypoint-hcl/variables/input for details.

Typically I get the Init operation error every time I make a new project (a separate bug), but since the following operation for QueueProject failed, the UI never surfaced the latest issue and I had to dive into the CLI to figure it out.

Steps to Reproduce

Get the Init operation to fail, and try to queue a project with an HCL error such as no default value for a dynamic config variable.

Expected behavior

The UI should surface the latest job failures for a given project on the project page.

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

Additional context Add any other context about the problem here.

jgwhite commented 2 years ago

Good catch. I don’t think I twigged that QueueProject would also contain valuable info when I added this screen.

briancain commented 2 years ago

@jgwhite - To add to the details here, it doesn't look like it's "required" for the Init op to fail to trigger this too. You probably know this already. If the QueueProject op fails, the project page ends up being blank. Just an FYI for other readers, you don't need to have a failing Init op to reproduce this, just a failing QueueProject job.