question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After upgrade to 5.0 (with docker-compose): failed to connect to server

See original GitHub issue

Everything was working fine and we upgraded form v3 to v4 to v5 with the docker-compose upgrade command, and the redash UI is loading fine, but cannot execute any query.

The UI displays an error: Error running query: (psycopg2.OperationalError) could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

And the docker-compose logs shows the following:

redash-worker | [2018-10-15 10:40:30,331][PID:46][INFO][Worker-13] waiting tracker 14a3e1bd6ffb17fda50f3ef34071f77f finished
redash-worker | [2018-10-15 10:40:30,332][PID:46][INFO][Worker-13] waiting tracker e321600e578ecd0d5e4bbfd0cb7eb0a7 finished
redash-worker | [2018-10-15 10:40:30,333][PID:1][INFO][MainProcess] Task redash.tasks.cleanup_tasks[bd77acf9-104f-45f6-a037-b54e64f638fd] succeeded in 0.0124485739998s: None
redash-worker | [2018-10-15 10:40:30,377][PID:14][INFO][Beat] Scheduler: Sending due task refresh_queries (redash.tasks.refresh_queries)
redash-worker | [2018-10-15 10:40:30,380][PID:1][INFO][MainProcess] Received task: redash.tasks.refresh_queries[29fcf6b1-9873-425d-ac6e-0972299e6bd3]
redash-worker | [2018-10-15 10:40:30,381][PID:49][INFO][Worker-14] task_name=redash.tasks.refresh_queries task_id=29fcf6b1-9873-425d-ac6e-0972299e6bd3 Refreshing queries...
redash-worker | [2018-10-15 10:40:30,390][PID:1][ERROR][MainProcess] Task redash.tasks.refresh_queries[29fcf6b1-9873-425d-ac6e-0972299e6bd3] raised unexpected: OperationalError('(psycopg2.OperationalError) could not connect to server: No such file or directory\n\tIs the server running locally and accepting\n\tconnections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?\n',)

Any ideas? Thank you so much

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
SebC99commented, Oct 15, 2018
The docker-compose.yml file we use:
version: '3'

services:

  server:
    image: redash/redash:latest
    container_name: redash
    restart: unless-stopped
    command: server
    depends_on:
      - postgres
      - redis
    ports:
      - "6000:5000"

    environment:
      PYTHONUNBUFFERED: 0
      REDASH_HOST: https://xxx
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
      REDASH_COOKIE_SECRET: xxxx
      REDASH_WEB_WORKERS: 4
      VIRTUAL_HOST: xxx
      VIRTUAL_PORT: 5000
      LETSENCRYPT_HOST: xxx
      LETSENCRYPT_EMAIL: gitlab@xxx
      REDASH_MAIL_SERVER: "ssl0.ovh.net"
      REDASH_MAIL_PORT: "587"
      REDASH_MAIL_USE_TLS: "true"
      REDASH_MAIL_USE_SSL: "false"
      REDASH_MAIL_USERNAME: "gitlab@xxx"
      REDASH_MAIL_PASSWORD: xxxx
      REDASH_MAIL_DEFAULT_SENDER: "no-reply@xxx"

  worker:
    image: redash/redash:latest
    container_name: redash-worker
    command: scheduler
    environment:
      PYTHONUNBUFFERED: 0
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
      QUEUES: "queries,scheduled_queries,celery"
      WORKERS_COUNT: 2
      REDASH_MAIL_SERVER: "ssl0.ovh.net"
      REDASH_MAIL_PORT: "587"
      REDASH_MAIL_USE_TLS: "true"
      REDASH_MAIL_USE_SSL: "false"
      REDASH_MAIL_USERNAME: "gitlab@xxx"
      REDASH_MAIL_PASSWORD: "xxxx"
      REDASH_MAIL_DEFAULT_SENDER: "no-reply@xxx"
    restart: always

  redis:
    container_name: redash-redis
    image: redis:3.0-alpine
    restart: always

  postgres:
    container_name: redash-db
    image: postgres:9.5.6-alpine
    restart: always
    volumes:
      - ./data:/var/lib/postgresql/data

networks:
  default:
    external:
      name: nginx-proxy
1reaction
SebC99commented, Oct 15, 2018

Just a typo here, it’s correct in the docker-compose file. I have REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres" in the server container and REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres" in the worker container, and the result of the docker-compose up -d command is: OperationalError: (psycopg2.OperationalError) fe_sendauth: no password supplied

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker-Compose Cannot Connect to Server w/ mysqli_connect
Simply updating the host name you're trying to connect to from 127.0.0.1 to database should be all you need to do.
Read more >
How to Resolve the “cannot connect to the Docker daemon ...
1. First, check if the Docker engine is running: sudo service docker status · 2. If the Docker engine isn't working, start it...
Read more >
[SOLVED] Docker Failed to Start - Docker Desktop for Windows
Issue Type: Docker Failed to Start OS Version/Build: Windows 10 - 10.0.18363 Build 18363. App Version: “Client: Docker Engine - Community
Read more >
Compose file versions and upgrading - Docker Documentation
An upgrade of version 3 that introduces new parameters only available with Docker Engine version 1.13.1+, and higher. Introduces the following additional ...
Read more >
Docker Compose release notes
Added support for windows/arm64 and linux/riscv64. Updates . Updated Dockerfile syntax to latest stable and renamed docs Dockerfile. Dependencies update: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found