Mutation failed because Dgraph execution failed because : context deadline exceeded

Report a GraphQL Bug

What edition and version of Dgraph are you using?


  • SlashGraphQL
  • Dgraph (community edition/Dgraph Cloud)

If you are using the community edition or enterprise edition of Dgraph, please list the version:

Dgraph Version
$ dgraph version

Have you tried reproducing the issue with the latest release?

Steps to reproduce the issue (paste the query/schema if possible)

Ran a simple mutation:

mutation setHomepage {
  }]) {

Expected behaviour and actual result.

Expected mutation to run instead got the response:

mutation addUserSetting failed because Dgraph execution failed because : context deadline exceeded

Waited just a little bit and ran the same thing again with no problems. :man_shrugging:

I expected my shared instance to be more reliable after the upgrade to a HA shared instance than a standalone instance.

This context deadline exceeded makes no sense to me. Can anybody explain what this error even means?

1 Like

I’m also getting this error in mutations, particularly if triggering it multiple times over a small period of time. The weird thing is Apollo isn’t even capable of catching the error, so my React app just crashes. I’m wondering if this has to do with the number of concurrent mutations performed on a specific node id or if it just can’t handle many mutations at the same time (which is worrisome since I plan on serving my app to multiple users). I’m using a shared instance by the way.

This error occurs if the db client does not get an answer from the database in the expected time frame.
See here for what a context is.

The described error is very common on my local instance when I initially (live) load a dgraph database with a large number of mutations. I found that it usually happens when dgraph is doing log compaction and thus can not react the client requests.

@dmai what is your take on this? Is the problem due to the high load when myself and another here have not even launched our apps publicly and seeing this now?

Is it because of the load by others on our shared instance?

Is there any throttling recommendations or load that is too high for a shared cloud setup?

It is hard to know how high the load even is when the metrics on the cloud UI show very little details and to get more metrics one has to pay big bucks for dedicated HA

1 Like