tudorials icon indicating copy to clipboard operation
tudorials copied to clipboard

Error No such column: True

Open elkiwi opened this issue 4 years ago • 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.

elkiwi avatar Mar 27 '20 17:03 elkiwi

Probably shouldn't be running BotRunner.py

elkiwi avatar Mar 27 '20 18:03 elkiwi

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?

tudorelu avatar Apr 04 '20 14:04 tudorelu

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

erenyildiz avatar Jun 13 '20 17:06 erenyildiz

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.

erenyildiz avatar Jun 13 '20 17:06 erenyildiz

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'],))

erenyildiz avatar Jun 13 '20 17:06 erenyildiz