Nepochal/wallabag-cli

wallabag binary failed to execute script

Closed this issue · 11 comments

in ubuntu mate 16.04 , using binary wallabag-cli produced following output.

Traceback (most recent call last):
File "wallabag/wallabag.py", line 61, in
File "wallabag/conf.py", line 149, in is_valid
File "wallabag/conf.py", line 216, in load
File "wallabag/conf.py", line 125, in __dicionary2config
File "wallabag/conf.py", line 122, in __dicionary2config
File "wallabag/conf.py", line 81, in __decrypt
File "base64.py", line 88, in b64decode
binascii.Error: Incorrect padding
Failed to execute script wallabag

Could you please do the following steps:

  • Remove the config file
    rm ~/.wallabag-cli
  • Create a new one
    wallabag config
  • Test
    wallabag list

If the error occurs furthermore, please send me your .wallabag-cli.
Your Wallabag-password is stored encrypted and salted with information that are kept on your computer. So I'm not able to reproduce your password from that file. But if you are afraid, please create a temporary Wallabag user for that file.

wallabag-cli file attached
wallabag.cli.zip

Thanks. I will look into it when I'm back from vacations.

This is weird.
Since version 0.6.0a the program encrypts your password and your oauth-secret in the config file (.wallabag-cli). Your Password was encrypted properly. But your oauth-secret was stored unencrypted. There is only one method in the program that saves the file. This method always encrypts both values, so it should be impossible that only one value is encrypted. I was not able to reproduce this behavior, so I need some more information:

  • Did you use the latest program version (0.7.1a) for config file creation?
  • Are there error messages during config file creation via wallabag config?
  • Did you manually change the config file?
  • Are there errors when you use wallabag-cli version 0.5.0a (the latest release without encryption)? You have to use wallabag config again.

Thanks for your help.

  • yes, i am using the latest version i.e 0.7.1a (precompiled binary)
  • yes, there are error message with command wallabag config
    After entering credentials , program is not closing and asking for credentials repeatedly as below:
    Enter the client id of your Wallabag API.
    (Leave the text empty to not change the client id.)

so, i have to interrupt the program at some point by pressing Ctrl+c.
then output is as following
^CTraceback (most recent call last):
File "wallabag/wallabag.py", line 99, in
File "wallabag/wallabag_config.py", line 53, in start
File "wallabag/wallabag_config.py", line 53, in start
File "wallabag/wallabag_config.py", line 53, in start
File "wallabag/wallabag_config.py", line 53, in start
File "wallabag/wallabag_config.py", line 29, in start
File "wallabag/wallabag_config.py", line 179, in __client
KeyboardInterrupt
Failed to execute script wallabag

  • As wallabag config failed, i manually entered credentials by .wallabag-cli configuration file
    by opening file with vim editor.
    and i tried : wallabag list ; following is the output
    Error: invalid_client - The client credentials are invalid

As wallabag config failed, i manually entered credentials by .wallabag-cli configuration file
by opening file with vim editor.

Well, that explains the decrypted oauth-secret. It is not possible to insert the values manually due to the encryption.

Please use wallabag config -o
Do not delete your wallabag-config previously.
Refill your oauth client and your oauth secret. After that it should show "The config was saved successfully.".
If not, please post your full input and output.

i think there is some problem with local python environment (pyenv)
i copied binary to /usr/local/bin and executed command wallabag config successfully
and able to use all commands available with wallabag binary as root user.
when it is executed in home folder, following error messages are thrown.
Traceback (most recent call last):
File "wallabag/wallabag.py", line 61, in
File "wallabag/conf.py", line 149, in is_valid
File "wallabag/conf.py", line 216, in load
File "wallabag/conf.py", line 122, in __dicionary2config
File "wallabag/conf.py", line 83, in __decrypt
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbc in position 0: invalid start byte
Failed to execute script wallabag

using binary as root is not good option.

Which version of python shows python --version with your local user? And which version shows it with root?

in root folder: Python 2.7.12
in home folder: it is failing with both Python 2.7.10 and Python 3.6.0 (using pyenv shell version)

That's strange. Python 3.6.0 should work.
I'm afraid that this is a system-dependend problem I can't help you with. Sorry.
You could try to run the program from sources as described here. Using a virtual environment (virtualenv) would be a good idea.

I added a check if the password and the oauth-secret can be decrypted. In the future there will be an error-message instead of a crash.
The changes will be in version 0.7.2a