Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悶 NotAwaitedRequestError: Encountered an error while requesting data via graphql through a synchronous call. Make sure the function called is awaited. #7303

Open
gerhard opened this issue May 7, 2024 · 6 comments
Labels
kind/bug Something isn't working sdk/typescript All about TypeScript sdk

Comments

@gerhard
Copy link
Member

gerhard commented May 7, 2024

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

@gerhard gerhard added kind/bug Something isn't working sdk/typescript All about TypeScript sdk labels May 7, 2024
@vikram-dagger
Copy link
Contributor

+1

@helderco
Copy link
Contributor

helderco commented May 7, 2024

Probably a side effect of a client connection going down.

@vikram-dagger
Copy link
Contributor

@TomChv
Copy link
Member

TomChv commented May 14, 2024

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

@helderco
Copy link
Contributor

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.

@TomChv
Copy link
Member

TomChv commented May 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working sdk/typescript All about TypeScript sdk
Projects
None yet
Development

No branches or pull requests

4 participants