dagger / dagger

An engine to run your pipelines in containers

Home Page:https://dagger.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐞 `NotAwaitedRequestError`: Encountered an error while requesting data via graphql through a synchronous call. Make sure the function called is awaited.

gerhard opened this issue Β· comments

What is the issue?

Hit this in sdk:typescript:test https://github.com/dagger/dagger/actions/runs/8986965799/job/24684341907?pr=7296#step:5:6492

image

Also:
image

cc @TomChv

Dagger version

dagger v0.11.2 (registry.dagger.io/engine) linux/amd64

Steps to reproduce

Not sure how to reproduce, but I've seen our CI hit it a few times. Will comment when we hit it again.

Log output

NotAwaitedRequestError.txt

Probably a side effect of a client connection going down.

I'm aware of this issue, however it's quite complex to enforce the call to await when it's necessary, usually you can guess it yourself and this error message is a simple hint.
In the case of the error, it's related to the engine that is not reachable but it's quite hard to give a good hint on what happend.

I can do some work on parsing the error and if a connection refused error match, then it's probably not because of an await.
I keep this in mind and will start an iteration soon on error handling, there's another issue related to that: #6624.

There's also another issue related to connection: #4375

I want to point out that using async and await work best when used under certain rules and while in TS it seems to work when you're being flexible about using them, it doesn't mean it doesn't lead to unexpected results, and this could be one of them. At least that's the impression I have, based on research I did in the past.

I think their usage should be cleaned up at some point, but don't have any raw data to suggest that it's causing major issues and the (possible) unexpected results could in fact be negligeable.

I think their usage should be cleaned up at some point, but don't have any raw data to suggest that it's causing major issues and the (possible) unexpected results could in fact be negligeable.

I tried to use async only when it was required, but because you cannot use await in a no async func, I had 2 choices:
either using Promise to call these awaited function OR spreading async to almost all my function that do 1 async call to send the graphQL request in dagger.

I'm open to any suggestions, right now I think it's more related to error handling than an async issue.