hasura / hasura/graphql-engine

Hasura subscriptions not Working.

Open
#4,302 0 comments 15 reactions 1 assignee Claimed by @0x777 View on GitHub
a/api/graphql k/question support/needs-more-info
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

Hello,
I love Hasura especially with the subscriptions feature.

But i spend the last 3 days try to make hasura subscriptions working.
I tested Hasura in 3 different context with multiples dedicated servers around the world.

1 Case:
Hasura with docker compose https. I follow [this](https://github.com/hasura/graphql-engine/tree/stable/install-manifests/docker-compose-https). With a custom server name.

-Console is accessible
-Query and mutations are working in hasura console ( with a x-hasura-admin-secret header)
-Subscriptions are working on hasura console (with a x-hasura-admin-secret header)

In a graphql Playground:
-Query and mutations are working ( with a x-hasura-admin-secret header)
-Subscriptions are NOT working (with a x-hasura-admin-secret header) i ran into this:

For firefox:
` "error": "Could not connect to websocket endpoint wss://burgess.ovh/v1/graphql. Please check if the endpoint url is correct."`

For chrome:

`{
"error": {
"extensions": {
"path": "$",
"code": "start-failed"
},
"message": "cannot start as connection_init failed with : x-hasura-admin-secret/x-hasura-access-key required, but not found"
}
}`

Same graphqlPlayground [adresse](https://www.graphqlbin.com/v2/new), just different browsers, same x-hasura-admin-secret header correctly setted.

In a appoloGraphql client with a create-react-app doc [here](https://hasura.io/learn/graphql/react/subscriptions/1-subscription/):

For firefox:
-Query and mutations are working ( with a x-hasura-admin-secret header)
-Subscriptions are NOT Working ( with a x-hasura-admin-secret header)

For Chrome:
-Query and mutations are working ( with a x-hasura-admin-secret header)
-Subscriptions ARE Working ( with a x-hasura-admin-secret header) (strange and weird :/)

Case 2 is a Hasura instance over Caprover, see [here ](https://caprover.com/):
Nginx is used to reverse proxy trafic, and config integrate websockets feature.

-Console is accessible
-Query and mutations are working in hasura console ( with a x-hasura-admin-secret header)
-Subscriptions are working on hasura console (with a x-hasura-admin-secret header)

I ran into the exactly same behavior with the graphqlPlayground and the appoloGraphQl client.
EXACTLY the same errors with the playground and firefox and chrome.
Chrome is ok with the appolographql client.

And case 3 is the Oneclick app with a Digital Ocean droplet.

-Console is accessible
-Query and mutations are working in hasura console ( with a x-hasura-admin-secret header)
-Subscriptions are working on hasura console (with a x-hasura-admin-secret header)

Exact same behavior, with the playground and with firefox an chrome.
Chrome is ok with the appolographql client.

I precise, i only use the x-hasura-admin-secret header for all my tests.
All my test where with https for the graphql endpoint.

I'm realy confuse about this and it's a real struggle for me.

I miss something?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.