psemdel / py-trading-bot

Trading-bot in python using django, vertorbt lib and interactive-brokers
MIT License
141 stars 34 forks source link

Connection refused in Kombu #7

Closed ben1628 closed 1 year ago

ben1628 commented 1 year ago

When I try to start bot, I'm running in this error

1/WARNING:kombu.connection:No hostname was supplied. Reverting to default 'localhost'

2 /Getting this connection refused error, also

"/home/usr/trading-bot/trading-bot/.vbt/lib/python3.10/site-packages/kombu/connection.py", line 450, in _reraise_as_library_errors raise ConnectionError(str(exc)) from exc kombu.exceptions.OperationalError: [Errno 111] Connection refused

I'm new to Redis, so not sure how I can fix this.

psemdel commented 1 year ago

Never got this one. Normally a Redis server is started by the script. It should be started before the celery worker. The Celery logic is in trading_bot/celery.py but it is only standard code from the documentation. in trading_bot/settings.py the url is provided REDIS_URL , maybe check that its value seems ok.

ben1628 commented 1 year ago

it's working now. Need to make sure telegram bot is working.

psemdel commented 1 year ago

What did you change?

ben1628 commented 1 year ago

I was taking a baby step to the whole process. First, I created a django project from scratch, making sure I can see the website working, then copy py-trading-bot over and made and necessary changes. Everything was working.

Then I started doing Redis, and telegram and ran into this error. With your help, I find out the celery.py is missing in trading_bot.