Issue Summary

I’m following the Docker-based Redash installation guide. I’m unable to start the DB due to Error 139 when I run docker-compose run --rm server create_db. However, upon investigating the docker-compose logs, can’t find any relevant error messages.

I realize that a similar error came up here Getting error: redash_server_1 exited with code 139 while running docker-compose up cmd, but in my case I am using Docker rather than EC2. I tried updating Redash version as suggested in that post (by cloning the latest repo version) but no luck.

Steps I took:

docker-compose up -d → Successfully starts redash_postgres_1, redash_redis_1, redash_email_1, redash_server_1, redash_scheduler_1, redash_worker_1

yarn --frozen-lockfile → Successfully installs all packages

docker-compose run --rm server create_db → error 139, as pictured

docker-compose logs | tail -f → Appears fine

docker-compose logs | grep error → Returns nothing.

Technical details:

Hmmm :confused: I hope this isn’t back…

Have you tried the suggested command to --remove-orphans? I wonder if you still have an old version of the containers running that didn’t apply the fix for this issue.

Which commit are you on master? Have you tried building completely from scratch?

I am on the latest commit (7cac149cef70263b328049cb376c7f25f7b03efb). Yes, I have tried building from scratch.

What specific steps did you follow to build from scratch?

Hi jesse! Yes, I just tried --remove-orphans and am still receiving the Error 139 .

Please stop deleting your message in this thread lol. It makes it hard to follow what’s happened.

My bad lol, I was thought I was replying to the wrong messages so was re-replying but I’ll just stop :sweat_smile:

I’ve tried docker_compose down --remove-orphans, then deleting the redash/ directory, re-cloning, and re-following the steps.

1 Like

If you want to try a complete start-over you can run these:

docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi $(docker images -q)

This actually removes the base images and forces a refetch.

Note this will affect all the images on your system. Not just Redash ones. If you’re doing all this on a VPS that’s dedicated to Redash then it should be fine.

I ran the Docker commands as you specified (thanks!) and saw that the docker-compose up -d did the complete refetch. However, I’m still getting error 139. The log tail looks the same (pictured here) and grep error-ing the logs still yields no results.

Confirming: this only affects your database container? The others start normally?

Yes, just the DB container.

Can you share your docker-compose file? I’ve tried rebuilding from scratch and it’s working fine for me…

[edit] here are the exact steps I followed:

# System:
#  macOS 10.15.7 
#  Docker 20.10.6, build 370c289
#  yarn 1.22.10


docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi $(docker images -q)
git clone https://github.com/getredash/redash redash-139-test
cd redash-139-test
docker-compose up -d
docker-compose run --rm server create_db
yarn --immutable
yarn build

Everything comes up. Runs as normal.

Here’s my docker-compose.yml for reference:

# This configuration file is for the **development** setup.
# For a production example please refer to getredash/setup repository on GitHub.
version: "2.2"
x-redash-service: &redash-service
  build:
    context: .
    args:
      skip_frontend_build: "true"
  volumes:
    - .:/app
x-redash-environment: &redash-environment
  REDASH_LOG_LEVEL: "INFO"
  REDASH_REDIS_URL: "redis://redis:6379/0"
  REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
  REDASH_RATELIMIT_ENABLED: "false"
  REDASH_MAIL_DEFAULT_SENDER: "redash@example.com"
  REDASH_MAIL_SERVER: "email"
  REDASH_ENFORCE_CSRF: "true"
services:
  server:
    <<: *redash-service
    command: dev_server
    depends_on:
      - postgres
      - redis
    ports:
      - "5000:5000"
      - "5678:5678"
    environment:
      <<: *redash-environment
      PYTHONUNBUFFERED: 0
  scheduler:
    <<: *redash-service
    command: dev_scheduler
    depends_on:
      - server
    environment:
      <<: *redash-environment
  worker:
    <<: *redash-service
    command: dev_worker
    depends_on:
      - server
    environment:
      <<: *redash-environment
      PYTHONUNBUFFERED: 0
  redis:
    image: redis:3-alpine
    restart: unless-stopped
  postgres:
    image: postgres:9.5-alpine
    # The following turns the DB into less durable, but gains significant performance improvements for the tests run (x3
    # improvement on my personal machine). We should consider moving this into a dedicated Docker Compose configuration for
    # tests.
    ports:
      - "15432:5432"
    command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
    restart: unless-stopped
    environment:
      POSTGRES_HOST_AUTH_METHOD: "trust"
  email:
    image: djfarrelly/maildev
    ports:
      - "1080:80"
    restart: unless-stopped

Hey Jessie - That worked like a charm. Thank you so much for all of your help and patience. I really appreciate it!!