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

Error running gshell commands - IndexError: list index out of range. #27

Open
rishiravi17 opened this issue Apr 7, 2022 · 2 comments
Open

Comments

@rishiravi17
Copy link

Hello

I am getting below given errors on executing gshell commands like gshell cd --with-id FILEID. Only commands that work is, gshell init or gshell info --with-id FILEID. Otherwise I am always getting these errors.

I tried on Centos 7 & Ubuntu 20. In an older instance of Centos 7, I was able to execute all commands and get results, which has the same Python versions as in the latest Centos 7 spin up instances. Could you please share some light on what could be wrong?

Traceback (most recent call last):
File "/home/centos/.local/bin/gshell", line 8, in
sys.exit(main())
File "/home/centos/.local/lib/python3.6/site-packages/gshell/init.py", line 543, in main
cli()
File "/home/centos/.local/lib/python3.6/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/home/centos/.local/lib/python3.6/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/centos/.local/lib/python3.6/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/centos/.local/lib/python3.6/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/centos/.local/lib/python3.6/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/centos/.local/lib/python3.6/site-packages/gshell/init.py", line 407, in cmd_cd
cwd = getcwd()
File "/home/centos/.local/lib/python3.6/site-packages/gshell/init.py", line 106, in getcwd
return init_config()
File "/home/centos/.local/lib/python3.6/site-packages/gshell/init.py", line 97, in init_config
home_id = _get_home_id()
File "/home/centos/.local/lib/python3.6/site-packages/gshell/init.py", line 89, in _get_home_id
parent_id = lines[1][start:end].strip()
IndexError: list index out of range

Ubuntu:

Traceback (most recent call last):
File ".local/bin/gshell", line 8, in
sys.exit(main())
File "/home/ubuntu/.local/lib/python3.8/site-packages/gshell/init.py", line 543, in main
cli()
File "/usr/lib/python3/dist-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/ubuntu/.local/lib/python3.8/site-packages/gshell/init.py", line 131, in cmd_init
config_dir = init(name)
File "/home/ubuntu/.local/lib/python3.8/site-packages/gshell/init.py", line 58, in init
init_config()
File "/home/ubuntu/.local/lib/python3.8/site-packages/gshell/init.py", line 97, in init_config
home_id = _get_home_id()
File "/home/ubuntu/.local/lib/python3.8/site-packages/gshell/init.py", line 89, in _get_home_id parent_id = lines[1][start:end].strip()
IndexError: list index out of range

Appreciate your help on this. Thank you.

@AlbertHuyb
Copy link

AlbertHuyb commented Jul 24, 2022

Potentially this is because you don't have anything under your gdrive folder.

You can try to print the cmd and stdout in /home/ubuntu/.local/lib/python3.8/site-packages/gshell/init.py to debug it.

@duerrsimon
Copy link

For me this was related to not having anything in my home folder (even though I had a file shared with me). Perhaps a quick check could be added so that it fails more gracefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants