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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostGraphile watch flag not working as expected #1069

Closed
1 of 3 tasks
alexisrolland opened this issue May 9, 2019 · 7 comments
Closed
1 of 3 tasks

PostGraphile watch flag not working as expected #1069

alexisrolland opened this issue May 9, 2019 · 7 comments
Labels
😓 cannot-reproduce Someone has attempted but failed to reproduce this; create an example repo to demonstrate the issue.

Comments

@alexisrolland
Copy link

alexisrolland commented May 9, 2019

I'm submitting a ...

  • bug report
  • feature request
  • question

PostGraphile version:
I am using PostGraphile in Docker. Latests image: graphile/postgraphile latest f07ca419c2e5 3 months ago 91.9MB

I am running my PostGraphile container using docker-compose. Here is the configuration:

version: '3.1'
services:

  db:
    container_name: listof-db
    restart: always
    image: listof-db
    build:
      context: ./db
    volumes:
      - db:/var/lib/postgresql/data
    env_file:
        - ./.env
    networks:
      - network
    expose:
      - 5432
    ports:
      - 5432:5432

  graphql:
    container_name: listof-graphql
    restart: always
    image: graphile/postgraphile
    env_file:
      - ./.env
    depends_on:
      - db
    networks:
      - network
    command: ["postgraphile",
      "--connection", "${DATABASE_URL}",
      "--port", "5433",
      "--schema", "base,public",
      "--default-role", "anonymous",
      "--jwt-secret", "${SECRET_KEY}",
      "--jwt-token-identifier", "base.sys_token",
      "--cors",
      "--watch"]

networks:
  network:

volumes:
  db:

Current behavior:
As you can see, I'm running PostGraphile with the watch argument to detect database changes. For some reason after a while, PostGraphile stops to detect the database changes and I have to restart my container to re-detect them and regenerate queries and mutation names... It is difficult to reproduce because the issue happens "randomly" after a while. Not based on a specific user action. Note the database change which was not detected was a table being renamed.

Expected behavior:
PostGraphile would continuously detect database changes.

Is this a know issue seen before? What could be the potential reasons for such a behavior? Where could I investigate?

Thanks
Alexis

@benjie benjie added the 😓 cannot-reproduce Someone has attempted but failed to reproduce this; create an example repo to demonstrate the issue. label May 9, 2019
@benjie
Copy link
Member

benjie commented May 9, 2019

Hi @alexisrolland; do you get the same issue when you use PostGraphile directly, rather than in Docker?

Also, can you ask docker to run postgraphile --version please?

@alexisrolland
Copy link
Author

alexisrolland commented May 9, 2019

Hi @benjie

I've actually never run PostGraphile outside of Docker and I would have to install it on a server and let it run for a while to see if the issue happens again. I'd like to avoid that.

The version I am running is PostGraphile v4.3.2.
The issue happened twice today. I'll continue to monitor the issue to see if it happens again and will let you know.

@benjie
Copy link
Member

benjie commented May 9, 2019

v4.4.0 solves a lot of things around database watching for users who reset their databases (e.g. by restarting docker instances); try upgrading to that.

@alexisrolland
Copy link
Author

alexisrolland commented May 9, 2019

Cool thanks for the info @benjie

I'm actually using the latest Docker image from Docker Hub: https://hub.docker.com/r/graphile/postgraphile/tags

I've deleted my Docker image and re-pulled the image but it seems it's still using v4.3.2. Any idea why it's not upgrading to v4.4.0 automatically?

The image Dockerfile does not specify any version so I would expect it install the latest automatically:
https://hub.docker.com/r/graphile/postgraphile/dockerfile

FROM node:alpine
LABEL description="Instant high-performance GraphQL API for your PostgreSQL database https://github.com/graphile/postgraphile"

RUN npm install -g postgraphile

EXPOSE 5000
ENTRYPOINT ["postgraphile", "-n", "0.0.0.0"]

@benjie
Copy link
Member

benjie commented May 9, 2019

Yeah, we need to sort out the DockerHub situation. It's on my list for next week. It always trails behind master. Though I'd expect it to be on 4.3.3 rather than 4.3.2, so seems it may be worse than I realised. Our dockerfile is only a few lines, you might be better off using that yourself directly:

https://github.com/graphile/postgraphile/blob/master/Dockerfile

@alexisrolland
Copy link
Author

Ok I'll build a custom image reusing the Dockerfile!
Thanks again for your support.

@benjie
Copy link
Member

benjie commented May 17, 2019

graphile/postgraphile:4 is now available on Docker hub and should solve this issue. 👍

@benjie benjie closed this as completed May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😓 cannot-reproduce Someone has attempted but failed to reproduce this; create an example repo to demonstrate the issue.
Projects
None yet
Development

No branches or pull requests

2 participants