graphql-engine: hasura/graphql-engine:v1.3.3.cli-migrations-v2 crashes on heroku

Hi, after a few months hasura stopped working on heroku, even though there were no changes made to the code.

Error-Message:

{"timestamp":"2021-05-14T08:42:38.000+0000","level":"info","type":"startup","detail":{"kind":"installing cli-ext plugin","info":""}}
FATA[0000] preparing execution context failed: setting up global config failed: cannot get home directory: exec: "getent": executable file not found in $PATH

I deployed hasura on a heroku-container. Environment varialbes are set. I use a 7$ Dyno, Western Europe.

Dockerimage:

FROM hasura/graphql-engine:v1.3.3.cli-migrations-v2

COPY ./hasura/migrations /hasura-migrations
COPY ./hasura/metadata /hasura-metadata

CMD graphql-engine \
    --database-url $DATABASE_URL \
    serve \
    --server-port $PORT

heroku.yml

build:
  docker:
    web: Dockerfile

Does anyone have a similar problem or has an idea what the problem might be?

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 6
  • Comments: 18 (4 by maintainers)

Most upvoted comments

@scriptonist I could fix it 😃 this dockerfile is working on heroku:

FROM hasura/graphql-engine:v1.3.3.cli-migrations-v2

# Add migrations and metadata
COPY ./migrations /hasura-migrations
COPY ./metadata /hasura-metadata
WORKDIR /

# Run the image as a non-root user
RUN adduser -D appuser
USER appuser

# Run the app. CMD is required to run on heroku
CMD graphql-engine \
    --database-url $DATABASE_URL \
    serve \
    --server-port $PORT

I’m running into this exact same issue, as described above (hasura deployed on Heroku).

Server logs:

2021-05-14T16:21:35.136967+00:00 app[web.1]: time="2021-05-14T16:21:35Z" level=fatal msg="preparing execution context failed: setting up global config failed: cannot get home directory: exec: \"getent\": executable file not found in $PATH"

The issue is a result of hasura-cli migrate apply, which is run in a docker-entrypoint.sh file.

Heroku dropped a related changelog item today – months after we also experienced this issue (which was resolved by the WORKDIR / solution). We worked with Heroku Support on this a bit to try and identify a root cause without luck, but this might be it?

@schwamic thank you for getting back with the information. I’ll spend some time on this and get back to you with my results/findings.

@warrenshen thank you for this information! For me, unfortunately, this is not so easy to do. but then I think it is an issue on heroku side… I hope the heroku support will get back to me soon and I’ll share my insights here 😃

hi @scriptonist heroku must have changed something, but I don’t know what… after running hasura without errors, the image stopped working magically three days ago.

It’s very hard to debug the hasura-image on heroku, because I can’t get on the vm via ssh (hasura/issue). So it would be a helpful feature, if the hasura-image could be extended so devs are able to ssh to their vm on heroku for debugging-purpose.

  1. Did you use hasura/graphql-engine:v1.3.3.cli-migrations-v2 including metadata and migrationfiles? Locally everything is working fine also, chrashes only on heroku…
  2. Do you know how to set $HOME/$PATH in heroku?