bernd-wechner / Degoo

CLI tool(s) for working with Degoo cloud storage
Other
143 stars 41 forks source link

Bug: On first run fails to create the degoo app folder when trying to create cred_file #2

Closed coreysiegel closed 3 years ago

coreysiegel commented 3 years ago

On login attempt, I get no response (error, confirmation, or other). I see no usage guideance for further troubleshooting. Where do I enter in my username and password?

# ls
LICENSE.md  build.py     default_properties.txt  degoo_cd   degoo_ll     degoo_ls     degoo_path   degoo_put  degoo_rm    degoo_tree 
README.md   commands.py  degoo                   degoo_get  degoo_login  degoo_mkdir  degoo_props  degoo_pwd  degoo_test  degoo_user
# ./commands.py help
# ./commands.py login
# ./commands.py user
# ./commands.py ls
bernd-wechner commented 3 years ago

Could be a symptom of https://github.com/bernd-wechner/Degoo/issues/1, but yeah it's not super user friendly at present, definitely a WIP (Work In Progress). That said run builld.py first, and see what happens. The command tools as I use them are all the degoo__command files.

That is I don't run:

`./commands.py ls'

but

'./degoo_ls

if you look in commands.py:

https://github.com/bernd-wechner/Degoo/blob/21f39c75c3b111a8140d901dc740c6e40cf3ce08/commands.py#L54

you'll find a clue.

After build.py has built the local commands:

./degoo_login

will say what's needed. Currently a dirt cheap implementation, it will just create a login file for you and ask you to go edit it ....

For clues see:

https://github.com/bernd-wechner/Degoo/blob/21f39c75c3b111a8140d901dc740c6e40cf3ce08/commands.py#L179

https://github.com/bernd-wechner/Degoo/blob/21f39c75c3b111a8140d901dc740c6e40cf3ce08/degoo/__init__.py#L133

It can use some gloss that's for sure ;-). Quick and dirty so far, as I've mostly spent time reading the network traffic to get the commands developed. And login is currently broken it seems, and needs diagnosis and fixing.

PRs always welcome, but I'll take a look at it too some time, maybe not till next year ....

coreysiegel commented 3 years ago

Thanks! Led me on the right track. On running ./degoo_login I received error: FileNotFound(2, 'No such file or directory')`

I then manually created the directory ~/.config/degoo and received the expected error: No login credentials available. Please add account details to [cred_file]
Login failed.

Now the config file was created, so I could edit it back to the same spot as @jeffmikels in #1. I added the debug code and reproduced his issue: {'Date': ...} {"message":"Missing Authentication Token"}

coreysiegel commented 3 years ago

Sorry, shouldn't have closed. Guess the issue is (1) add some usage notes and (2) handle a missing directory and create it if missing. Thanks for starting on a potentially very useful tool though!

bernd-wechner commented 3 years ago

Yep that's bug. It should certainly create the degoo app folder if it's not there! As ever PR welcome, or I'll fix that some time .... mean time this is a reminder and I'll rename it for that.

This line:

https://github.com/bernd-wechner/Degoo/blob/21f39c75c3b111a8140d901dc740c6e40cf3ce08/degoo/__init__.py#L179

needs to be prefixed with a check that the folder exists, and if not, create it.

bernd-wechner commented 3 years ago

Fixed this with:

https://github.com/bernd-wechner/Degoo/commit/8f64b77933891a831fad205ef402ad4c6ee50f66

Should all be good now, creating the config dir when it's not there.