tudorelu/tudorials

Error No such column: True

elkiwi opened this issue · 5 comments

aps = database.GetActivePairsOfBot(bot)

File "/var/www/sites/python/trading/Database.py", line 252, in GetActivePairsOfBot
c.execute('SELECT * FROM pairs Where bot_id = ? and is_active = True', (bot['id'],))
sqlite3.OperationalError: no such column: True

I deleted the db file too and ran again but same problem.

Probably shouldn't be running BotRunner.py

Hey man, yes, you actually do run BotRunner.py. I am not getting that error myself but others mentioned it. Did you find a fix?

Hi there

A more detailed error message is here when you create a bot at startup:

←[K←[?25hTraceback (most recent call last):
File "BotRunner.py", line 536, in
Main()
File "BotRunner.py", line 531, in Main
prog.StartExecution(bot_symbol_datas)
File "BotRunner.py", line 437, in StartExecution
aps = database.GetActivePairsOfBot(bot)
File "C:\Users\yumun\Documents\Final Version\Database.py", line 252, in GetActivePairsOfBot
c.execute('SELECT * FROM pairs Where bot_id = ? and is_active = True', (bot['id'],))
sqlite3.OperationalError: no such column: True

And here is the error when you do not create a bot at startup:

⠇←[0m Getting balances of all bots...←[KTraceback (most recent call last):
File "BotRunner.py", line 536, in
Main()
File "BotRunner.py", line 531, in Main
prog.StartExecution(bot_symbol_datas)
File "BotRunner.py", line 408, in StartExecution
self.all_symbol_datas[pair['symbol']] = sd[pair['symbol']]
KeyError: 'BEARUSDT'
⠋←[0m Getting balances of all bots...←[K

I think the second error is generated because the symbols vary from platform to platform. We need to delete the database file first and start BotRunner anew.

The first issue seems to be due to a column not generated in the database, BotRunner can not see any active bots.

Solved the issue as below:

Line 252 in Database.py should read as follows:

	c.execute('SELECT * FROM pairs Where bot_id = ? and is_active = 1', (bot['id'],))

NOT as below. Let me know if this solved the issue for you @elkiwi

	c.execute('SELECT * FROM pairs Where bot_id = ? and is_active = True', (bot['id'],))