amor71 / LiuAlgoTrader

Framework for algorithmic trading
MIT License
784 stars 129 forks source link

OSError: Multiple exceptions: [Errno 61] Connect call failed ('::1', 5432, 0, 0), [Errno 61] Connect call failed ('127.0.0.1', 5432) #386

Closed wmelton closed 1 year ago

wmelton commented 1 year ago

Describe the bug Clean install on MacOS running Docker Desktop 4.15. For reasons I'm unable to figure out, streamlit, portfolio create, etc. are unable to connect to PostGres.

I've verified Docker image started, PostGres is running, and no errors are present in logs, but Liu will not successfully connect.

image

Desktop (please complete the following information):

github-actions[bot] commented 1 year ago

Thank you for joining LiuAlgoTrader community and submitting your first issue. Feel free to check out Liu community: https://gitter.im/LiuAlgoTrader/community

amor71 commented 1 year ago

@wmelton is that log from your docker?!

wmelton commented 1 year ago

@amor71 no, that's from your package attempting to connect to the postgres instance launched via docker compose at run time.

amor71 commented 1 year ago

@wmelton after you run liu quickstart there are details at the end. among it is to run environment variables, which set the port to 5400, your example is looking for port 5431 which makes me think we didn't follow all steps, and hence you can't connect to the Postgres running on the docker.

wmelton commented 1 year ago

@amor71 so it looks like the env_vars.sh script does set it up, however, I'm pretty sure the liu_samples folder only gets created if you tell the quickstart prompt to include samples. Might be a worthy update to create the env_var.sh file in the root of the project.

After running env_vars.sh the issue is resolved. Thanks!