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

gshell code - throwing error message #23

Open
cleitols opened this issue Oct 1, 2021 · 3 comments
Open

gshell code - throwing error message #23

cleitols opened this issue Oct 1, 2021 · 3 comments

Comments

@cleitols
Copy link

cleitols commented Oct 1, 2021

Hello.
Every time I try to execute the init command switch for gshell, I get the following error:

cleitols@os:~$ gshell init
Traceback (most recent call last):
File "/usr/local/bin/gshell", line 8, in
sys.exit(main())
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 443, in main
cli()
File "/usr/lib/python3/dist-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 125, in cmd_init
config_dir = init(name)
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 54, in init
init_config()
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 92, in init_config
home_id = _get_home_id()
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 84, in _get_home_id
parent_id = lines[1][start:end].strip()
IndexError: list index out of range

@wkentaro
Copy link
Owner

wkentaro commented Oct 1, 2021

Probably it is due to a broken ~/.gshell file. The solution would be rm -f ~/.gshell

@wkentaro wkentaro added the bug? label Oct 1, 2021
@cleitols
Copy link
Author

cleitols commented Oct 2, 2021

rm -f ~/.gshell

Tried to delete the file, but doesn't seem to be the reason yet.
I also tried to run the command as sudo and it went a little better, but the same error above is shown:

cleitols@os:~$ sudo gshell init
[sudo] password for cleitols:
Initializing system (/root/.gdrive)
Authentication needed
Go to the following url in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=367116221053-7n0vf5akeru7on6o2fjinrecpdoe99eg.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=state

Enter verification code: ****
User: ****
Used: 300.5 MB
Free: 15.8 GB
Total: 16.1 GB
Max upload size: 5.2 TB
Traceback (most recent call last):
File "/usr/local/bin/gshell", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/gshell/init.py", line 443, in main
cli()
File "/usr/lib/python3/dist-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/gshell/init.py", line 125, in cmd_init
config_dir = init(name)
File "/usr/local/lib/python3.9/dist-packages/gshell/init.py", line 54, in init
init_config()
File "/usr/local/lib/python3.9/dist-packages/gshell/init.py", line 92, in init_config
home_id = _get_home_id()
File "/usr/local/lib/python3.9/dist-packages/gshell/init.py", line 84, in _get_home_id
parent_id = lines[1][start:end].strip()
IndexError: list index out of range

@AlbertHuyb
Copy link

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

You can try to print the cmd and stdout in /usr/local/lib/python3.9/dist-packages/gshell/init.py to debug it.

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

No branches or pull requests

3 participants