Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range #445

Closed
dev-x0 opened this issue Feb 3, 2019 · 7 comments
Closed

IndexError: list index out of range #445

dev-x0 opened this issue Feb 3, 2019 · 7 comments
Assignees
Labels
[3] Type: Bug [5] Small Task Indicates size of task. Est. between one and two hours

Comments

@dev-x0
Copy link

dev-x0 commented Feb 3, 2019

Expected Behavior

I assume config just moves onto next step.

Actual Behavior

Config outputs an error.

Steps to Reproduce the Problem

  1. dexbot-cli configure
  2. configure up to point where cli asks for external price source
  3. pick any price source eg. binance and select Ok, an error will appear and the config menu will close saying IndexError: list index out of range

Specifications

  • Version: 0.9.5
  • OS: Ubuntu 18.04
@thehapax
Copy link
Collaborator

thehapax commented Feb 5, 2019

This is related to external feeds, i will take a look after project administrative tasks

@thehapax thehapax added [1] Status: Available [5] Small Task Indicates size of task. Est. between one and two hours labels Feb 5, 2019
@thehapax thehapax self-assigned this Feb 5, 2019
@thehapax
Copy link
Collaborator

I find this bug to be introduced during @joelvai 's refactoring in december where the "none" option is commented out.

a7015ed#diff-6a2e0d37f88f35d4bcc3e1d9da39a4b4

suggest default value to be none in config element instead of exchanges[0] . will continue to look at this tmr.

@PermieBTS
Copy link
Collaborator

Is there a planned fix for this bug?

@bitphage bitphage self-assigned this Feb 27, 2019
@bitphage
Copy link
Collaborator

Ok, I'm able to reproduce the problem only by using a input value outside of proposed:

External price source - The bot will try to get price information from this source

 1) Coingecko
 2) Waves DEX
 3) Kraken
 4) Bitfinex
 5) Gdax
 6) Binance


Your choice: [1]: 7
Traceback (most recent call last):
  File "./cli.py", line 6, in <module>
    cli.main()
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/vvk/devel/DEXBot/dexbot/ui.py", line 130, in new_func
    return ctx.invoke(f, *args, **kwargs)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/vvk/devel/DEXBot/dexbot/ui.py", line 87, in new_func
    return ctx.invoke(f, *args, **kwargs)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/vvk/devel/DEXBot/dexbot/ui.py", line 120, in new_func
    return ctx.invoke(f, *args, **kwargs)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/vvk/devel/DEXBot/dexbot/cli.py", line 145, in configure
    configure_dexbot(config, ctx)
  File "/home/vvk/devel/DEXBot/dexbot/cli_conf.py", line 277, in configure_dexbot
    config['workers'][txt] = configure_worker(whiptail, {})
  File "/home/vvk/devel/DEXBot/dexbot/cli_conf.py", line 236, in configure_worker
    process_config_element(elem, whiptail, worker_config)
  File "/home/vvk/devel/DEXBot/dexbot/cli_conf.py", line 122, in process_config_element
    config.get(elem.key, elem.default), elem.extra))
  File "/home/vvk/devel/DEXBot/dexbot/whiptail.py", line 157, in radiolist
    return self.menu(msg, [(k, v) for k, v, s in items], default=default)
  File "/home/vvk/devel/DEXBot/dexbot/whiptail.py", line 147, in menu
    ret = items[ret - 1]
IndexError: list index out of range

bitphage added a commit to bitphage/DEXBot that referenced this issue Feb 27, 2019
If allowed input is in range 1-5 and user entered 6 or more, treat this
as 5.

Closes: Codaone#445
@thehapax
Copy link
Collaborator

thehapax commented Mar 1, 2019

I already made the fix on my branch here, the bug i did not find on whiptail but in the config elements. Here is the pull request: #503

Why are we making the assignment of this redundant? @PermieBTS @vvk

@bitphage
Copy link
Collaborator

bitphage commented Mar 1, 2019

@PermieBTS asked me to look into this bug.

@PermieBTS
Copy link
Collaborator

There was some confusion between octo and I over reassigning this issue to vvk.
My apologies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[3] Type: Bug [5] Small Task Indicates size of task. Est. between one and two hours
Projects
None yet
Development

No branches or pull requests

4 participants