nhost / hasura-backend-plus

🔑Auth and 📦Storage for Hasura. The quickest way to get Auth and Storage working for your next app based on Hasura.
https://nhost.github.io/hasura-backend-plus/
MIT License
1.17k stars 187 forks source link

Wait loop when using JWKS #634

Open SVerkuil opened 3 years ago

SVerkuil commented 3 years ago

Describe the bug When using JWKS hasura-backend-plus will wait with starting until hasura (graphql-engine) is ready. But graphql-engine will never become ready because it will wait for the JWKS endpoint of hasura-backend-plus to become ready first.

To Reproduce Steps to reproduce the behavior:

  1. Create environment using provided docker compose
  2. Change graphql-engine to use JWKS HASURA_GRAPHQL_JWT_SECRET: '{"type": "RS256", "jwk_url": "http://hasura-backend-plus:3000/auth/jwks"}'
  3. Observe logs of hasura-backend-plus (crash loop) and graphql-engine (crash on JWKS)

Expected behavior The hasura-backend-plus application should expose JWKS endpoint on app startup even if Hasura is not ready

Additional context hasura-backend-plus 2.6.1 works fine, JWKS api is broken in 2.7.1

pk992 commented 3 years ago

This can also happen on 2.6.1, if one container was stopped or recreated, it's impossible to sync them again.

paulbalomiri commented 3 years ago

second that. I'm trying to automate deployment using ansible. The way to work around this is

my docker images are:

    image: hasura/graphql-engine:v2.0.3.cli-migrations-v3
    image: nhost/hasura-backend-plus:latest