Unable to create docker based development environment based on the https://redash.io/help/open-source/dev-guide/docker documentation.

For some reason the Postgres isn’t accessible in the following step

docker-compose run --rm server create_db

It fails with the following error (tested two separate Windows 10 based dev PCs and both face the issue)

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "postgres" to address: Name or service not known

What could be causing the issue here?

1 Like

I get a similar error on the same step of the guide:

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name “postgres” to address: No address associated with hostname

1 Like

The problem is due to a breaking change in PostgreSQL.
Probably there is a better solution, but atm I’ve solved by editing the “docker-compose.yml” file adding the environment part:

  ...
  postgres:
    image: postgres:9.5-alpine
    ...
    restart: unless-stopped
    environment:
      POSTGRES_HOST_AUTH_METHOD: "trust"
  email:
  ...

So that command goes forward.

But continuing with the setup steps, the “npm run build” command gives ELIFECYCLE errors, “rm” is not recognized as a command, the “postgres_1” messages keep emitting a “LOG: unexpected EOF on client connection with an open transaction” messages, and in the end when I try to launch “http://localhost:5000”, I get the setup page only with its HTML, no CSS and no images. And even if I try to fill the form in this broken page, it goes to a Chrome’s ERR_CONNECTION_REFUSED page, then eventually refreshing it becomes a Werkzeug’s “dontpanic” output, saying:

FileNotFoundError: [Errno 2] No such file or directory: ‘/app/redash/settings/…/…/client/dist/index.html’

For me it was enough just to add that and the build started to succeed after that.

I have the same problem. Do you have solved the problem?

I’m sorry to say no :pensive:

I seem to know how to avoid this proble.
Use this url to get redash resource bundle. Extract resource package and enter into the folder of “redash” and execute command of “docker-compose -f docker-compose.yml run --rm server create_db”.

url: https://version.redash.io/API/releases
execute command:wget https://s3.amazonaws.com/redash-releases/redash.7.0.0.b17535.tar.gz

Thanks. I’m not sure if I’ll try this because meanwhile I’ve chosen a radically different solution and by now I’m in that path.

ok! I’m in this path.
If you have Installed successfully,can you tell me and share the way with me?
Thank you!

No - I meant I gave up on trying Redash and moved on with something else. Sorry for not being able to help.

Ok!
I have installed successfully.
You can have a try If you want use redash.

This is fixed in:

1 Like

Perhaps a 8.0.3 branch would be in order, deleting 8.0.2

Edit. Upon closer inspection I’m having a similar issue, but not same.

File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 2463, in call
return self.wsgi_app(environ, start_response)
File “/usr/local/lib/python3.7/site-packages/werkzeug/middleware/proxy_fix.py”, line 232, in call
return self.app(environ, start_response)
File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 2449, in wsgi_app
response = self.handle_exception(e)
File “/usr/local/lib/python3.7/site-packages/flask_restful/init.py”, line 269, in error_router
return original_handler(e)
File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 1866, in handle_exception
reraise(exc_type, exc_value, tb)
File “/usr/local/lib/python3.7/site-packages/flask/_compat.py”, line 39, in reraise
raise value
File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 2446, in wsgi_app
response = self.full_dispatch_request()
File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/usr/local/lib/python3.7/site-packages/flask_restful/init.py”, line 269, in error_router
return original_handler(e)
File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File “/usr/local/lib/python3.7/site-packages/flask/_compat.py”, line 39, in reraise
raise value
File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 1949, in full_dispatch_request
rv = self.dispatch_request()
File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 1935, in dispatch_request
return self.view_functionsrule.endpoint
File “/usr/local/lib/python3.7/site-packages/flask_login/utils.py”, line 261, in decorated_view
return func(*args, **kwargs)
File “/app/redash/handlers/static.py”, line 32, in index
return render_index()
File “/app/redash/handlers/static.py”, line 16, in render_index
response = send_file(full_path, **dict(cache_timeout=0, conditional=True))
File “/usr/local/lib/python3.7/site-packages/flask/helpers.py”, line 629, in send_file
file = open(filename, “rb”)
FileNotFoundError: [Errno 2] No such file or directory: ‘/app/redash/settings/…/…/client/dist/index.html’

The solution mentioned here in this thread seems to be to add

  POSTGRES_HOST_AUTH_METHOD: "trust"

To docker-compose.yml. But I already have this string in my docker-compose.yml and I’m still getting the error… :confused:

1 Like

Hello all,
I am trying to setup redash by following this link

I ran these commands before sudo docker-compose up

docker-compose run --rm server create_db

docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests"

been getting this error multiple times

postgres_1   | LOG:  unexpected EOF on client connection with an open transaction
worker_1     | [2021-05-31 04:55:26,338][PID:8][INFO][rq.worker] periodic: 18281a865ed3d1a60f366aeb8596fe2283aa421f
worker_1     | [2021-05-31 04:55:26,378][PID:116][INFO][rq.worker] periodic: Job OK (18281a865ed3d1a60f366aeb8596fe2283aa421f)
worker_1     | [2021-05-31 04:55:26,378][PID:116][INFO][rq.worker] Result is kept for 600 seconds
worker_1     | [2021-05-31 04:55:26,392][PID:8][INFO][rq.worker] periodic: 305c0cae0a196ae96915fd2b6f81001c435aad65
worker_1     | [2021-05-31 04:55:26,403][PID:117][INFO][rq.job.redash.tasks.queries.maintenance] job.func_name=redash.tasks.queries.maintenance.refresh_queries job.id=305c0cae0a196ae96915fd2b6f81001c435aad65 Refreshing queries...
worker_1     | [2021-05-31 04:55:26,446][PID:117][INFO][rq.job.redash.tasks.queries.maintenance] job.func_name=redash.tasks.queries.maintenance.refresh_queries job.id=305c0cae0a196ae96915fd2b6f81001c435aad65 Done refreshing queries: {'outdated_queries_count': 0, 'last_refresh_at': 1622436926.4460568, 'query_ids': '[]'}

The docker-compose.yml file also contains the Environment variable HOST_AUTH_METHOD as the discussion above suggests.

  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

I am blocked here, please suggest me if any changes need to be made somewhere.

Thank you :slight_smile:

Hello, could you please let me know if you found a solution to this issue. I am facing a similar issue.

Hi @Vineet can you share what steps you followed? I’m trying to reproduce this issue but it’s working for me without issues…

Hi @jesse , I followed the same steps as mentioned in the link https://redash.io/help/open-source/dev-guide/docker. I was trying to set up the developer version using the code base.
When I use the production version i.e. GitHub - getredash/setup: Setup scripts for Redash Cloud Images I am able to set it up without any issue.