hasura / hasura-cloud-preview-apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Preview apps action fails on the first run

kikkupico opened this issue · comments

commented

Bug

Preview app action fails on the first run with the error Error: could not find the GitHub job; the associated deployment was terminated

Workaround

This is fixed by re-running the job.

Expected

The action should run successfully every time (if configured correctly).

Examples

https://github.com/kikkupico/samp-home-food-dev-2/runs/7148915232?check_suite_focus=true

Related

#91

I have been experiencing the same issue. Is this happening with everyone? I don't imagine there is any way around this right now.

commented

Thank you for bringing this issue up, and apologies for lack of response so far. I've raised a ticket internally to investigate this, will update here with any progress.

This issue now happens for us on every single run. Re-running the job leads to the same error. Error: could not find the GitHub job; the associated deployment was terminated

We have the need to configure Vercel and Hasura together in our preview environments so they are aware of each other's URLs. So a custom action is necessary if we're going to have preview environments that work.

Should I try to work with the Preview Apps API instead? Would that give me any more success? https://hasura.io/docs/latest/deployment/hasura-cloud/ci-cd/preview-apps/#preview-apps-api

commented

@jasongoetz One of the issues we discovered with this action is that the error message is incorrect. Error: could not find the GitHub job; the associated deployment was terminated is always displayed no matter what the actual problem is. This makes it more difficult to identify the actual problem in these cases. This issue is being picked up this sprint and should be resolved soon.

This action uses the Preview Apps API (see previewApps.ts for the queries that are being made) so if you need a custom action you may be able to use this as a reference for any customizations you need.

Mentioning considerably later, this is still happening. Is it safe to assume that this project is dead at Hasura?

So after trying to add more logging to the actual action, I find nothing very helpful - basically

  • the GQL query itself (query getJobStatus($jobId: uuid!)) doesn't throw anything
  • it just returns a null value
  • the jobId came from the creation of the github preview app (mutation createPreviewApp), which lends one to think that the GraphQL API ought to be able to get the status, but maybe it's dependent on some async thing that may or may not be ready? or some caching is being messed up?

my best guess is that it's querying too early before the job exists in Hasura's system (or there's some bug in how the querying logic works maybe). so maybe a reasonable approach would be to just have it retry a few times instead of erroring immediately to give the system a chance to properly return this value.

Tried retrying 3 times with 2 second time outs, that didn't do the trick. trying retrying up to 10 times (20s) (that didn't work either). I'm also finding that this isn't consistently just on the first run, when i retry jobs it sometimes happens again for... reasons. So yeah, it's probably not just some async delay on Hasura Cloud's end, it seems like something is fundamentally breaking on the other side.

Screenshot 2023-06-18 at 23 03 17