marcwebbie / passpie

:closed_lock_with_key: Multiplatform command-line password manager
http://passpie.readthedocs.org/
MIT License
921 stars 68 forks source link

Error init passpie on windows 8 #27

Closed chtiprog closed 8 years ago

chtiprog commented 9 years ago

After successfully installed passpie, I typed this

passpie init

And this error occur :

raise RuntimeError(str(ae))
RuntimeError: Homedir ''C:\Users\XXX~1\AppData\Local\Temp\tmpmp4852an'' needs
 read/write permissions
wcastand commented 9 years ago

He, i think i have the same bug. I'm on windows 8.1, i use pip to install passpie and use Cmder as console I use a SSD (C:) and my User directory are on my HDD (E:). Maybe it's a problem :)

There is my log in the console :

λ passpie init
Passphrase:
Repeat for confirmation:
ERROR:gnupg:[Error 123] La syntaxe du nom de fichier, de rÚpertoire ou de volume est incorrecte: "E:\\'e:"
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\gnupg\_util.py", line 322, in _create_if_necessary
    os.makedirs(directory, 0x1C0)
  File "C:\Python27\lib\os.py", line 150, in makedirs
    makedirs(head, mode)
  File "C:\Python27\lib\os.py", line 150, in makedirs
    makedirs(head, mode)
  File "C:\Python27\lib\os.py", line 157, in makedirs
    mkdir(name, mode)
WindowsError: [Error 123] La syntaxe du nom de fichier, de rÚpertoire ou de volume est incorrecte: "E:\\'e:"
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\passpie.exe\__main__.py", line 9, in <module>
  File "C:\Python27\lib\site-packages\click\core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "C:\Python27\lib\site-packages\click\core.py", line 644, in main
    rv = self.invoke(ctx)
  File "C:\Python27\lib\site-packages\click\core.py", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Python27\lib\site-packages\click\core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python27\lib\site-packages\click\core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "C:\Python27\lib\site-packages\passpie\cli.py", line 159, in init
    with Cryptor(config.path) as cryptor:
  File "C:\Python27\lib\site-packages\passpie\crypt.py", line 38, in __init__
    self._gpg = gnupg.GPG(binary=self._binary, homedir=self._homedir)
  File "C:\Python27\lib\site-packages\gnupg\gnupg.py", line 125, in __init__
    ignore_homedir_permissions=ignore_homedir_permissions,
  File "C:\Python27\lib\site-packages\gnupg\_meta.py", line 177, in __init__
    self.homedir = os.path.expanduser(home) if home else _util._conf
  File "C:\Python27\lib\site-packages\gnupg\_util.py", line 744, in __set__
    getattr(obj, self.fset.__name__)(value)
  File "C:\Python27\lib\site-packages\gnupg\_meta.py", line 430, in _homedir_setter
    raise RuntimeError(str(ae))
RuntimeError: Homedir ''e:\temp\tmp9dawsu'' needs read/write permissions
jbonhag commented 9 years ago

I'm experiencing the same issue using both the Windows command prompt and Git Bash.

marcwebbie commented 9 years ago

Looks like that on Windows open files cannot be accessed by other processes in this case "gpg" process. I could reproduce this issue and I am working on for the next version.

Thanks for reporting

scorphus commented 9 years ago

@marcwebbie: Hey, any progress on this? Anything to share?

Yesterday I dug this one a bit while trying and debugging a build failure on Win8. Looks like python-gnupg can't handle paths quite right. Both homedir and path to GnuPG.exe (used when guessing version, for example). It's a known, wonfix, feature/bug isislovecruft/python-gnupg#62, by the way.

Maybe upstream python-gnupg is an option...

marcwebbie commented 9 years ago

Hello,

I am working on some rewrite of gpg and git backend for passpie, I don't have windows so it is hard to test local for me. I be writting a gpg module for Windows installations and push it up to a branch so people can try.

I will keep this issue up to date with newss

scorphus commented 9 years ago

Glad to know that, @marcwebbie! I'm eager to help, I already have a Win8 box all setup, shiny – phew, that was pain for a Linux/OSX user :smile:

Merci!

zQueal commented 9 years ago

@marcwebbie do we have any updates on this? passpie has had no commits for almost 3 months and this issue is 4 months old. It's sad because passpie is legitimately the best CLI based password manager for Windows users.

marcwebbie commented 9 years ago

Hello @zQueal

Actually, we were experiencing some issues with python-gnupg and I've been rewriting passpie commands backend not to depend on python-gnupg anymore. This will probably become the 1.0 version of Passpie and it is on a different branch.

You can take a look at the current work here: https://github.com/marcwebbie/passpie/tree/redesign_dependencies

Thanks for keeping up with Passpie

Regards

scorphus commented 9 years ago

Awesome to know this, Marc. I'll have a close look at and experiment it as soon as I can. Thanks for sharing.

zQueal commented 9 years ago

Hey Marc, this is great news!

I just loaded this up via pip and got farther than with master.

λ passpie init --force
Passphrase:
Repeat for confirmation:
Traceback (most recent call last):
  File "C:\Python27\Scripts\passpie-script.py", line 9, in <module>
    load_entry_point('passpie==0.3.3', 'console_scripts', 'passpie')()
  File "C:\Python27\lib\site-packages\click\core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "C:\Python27\lib\site-packages\click\core.py", line 680, in main
    rv = self.invoke(ctx)
  File "C:\Python27\lib\site-packages\click\core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Python27\lib\site-packages\click\core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python27\lib\site-packages\click\core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "C:\Python27\lib\site-packages\click\decorators.py", line 63, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "C:\Python27\lib\site-packages\click\core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "C:\Python27\lib\site-packages\passpie\cli.py", line 99, in init
    key_length=db.config['key_length'])
  File "C:\Python27\lib\site-packages\passpie\crypt.py", line 64, in create_keys
    keysfile.write(export_keys(temp_homedir))
AttributeError: 'NoneType' object has no attribute 'write'

After this, passpie almost works like normal. I can add and update, entries, but I cannot get them to copy to the clipboard (even though it shows success), passpie log doesn't work, and once added, you cannot delete a single entry, you have to purge the entire database to remove something.

Hopefully that's some good debug information.

muffins commented 8 years ago

Edit: Wow I'm silly, sorry, I realized @marcwebbie already spoke to these issues above. Please disregard my silly-ness!

Hey All!

I have something of an update on this issue. I forked the source and seem to have gotten passpie working on Windows 10, however this involved changing the dependency from gnupg to python-gnupg, which I'm still unsure if this'll break anything. It seems that on windows there's a known conflict between the python-gnupg and gnupg packages, however I've had better luck using the python-gnupg packages to avoid this particular issue.

I've got the code on my github, and would welcome discussion and feedback on if there's anything else that breaks moving passpie to python-gnupg, as opposed to the gnupg library, and if there's any other considerations involved with a library change like this. Or if there's any particular reason against using the python-gnupg libs. Lemme know! I'd love to have passpie working on my windows box alongside Mac OS X and Linux!

https://github.com/PoppySeedPlehzr/passpie

zQueal commented 8 years ago

@PoppySeedPlehzr

I'm testing out your repo and it seems to actually be working! The only issue I'm having is copying passwords to the Windows clipboard.

λ passpie copy github.com
Passphrase:
Exception in thread Thread-21:
Traceback (most recent call last):
  File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
    self.run()
  File "C:\Python27\lib\threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\Python27\lib\site-packages\gnupg.py", line 813, in _read_response
    result.handle_status(keyword, value)
  File "C:\Python27\lib\site-packages\gnupg.py", line 575, in handle_status
    Verify.handle_status(self, key, value)
  File "C:\Python27\lib\site-packages\gnupg.py", line 308, in handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: u'FAILURE'

Additionally, adding, updating, and even generating pass phrases works great, but I cannot export them. This means I can generate passwords but not view or use them. lol

marcwebbie commented 8 years ago

Hello @chtiprog @scorphus @zQueal @wcastand @jeffbonhag

Development version of Passpie is now working on Windows. Try it out with:

pip install -U https://github.com/marcwebbie/passpie/tarball/master

Tested on WIndows 10

muffins commented 8 years ago

@marcwebbie tested on Windows 8 x64 with Python 2.7.10 and pip 8.0.2, I can init, add, and copy! Thanks a lot for the awesome project!!

marcwebbie commented 8 years ago

@PoppySeedPlehzr happy to read that it was working for you!

This is now pushed to upstream passpie.

pip install -U passpie

Thanks for your contribution

marcwebbie commented 8 years ago

Will be closing this issue, seems to be fixed in upstream.

Thanks for your contribution: 😃

MRGiacalone commented 6 years ago

I get this issue on Windows 10. Seems to be similar to the one described above.

M:\>passpie init
Traceback (most recent call last):
  File "m:\miniconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "m:\miniconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "M:\Miniconda3\Scripts\passpie.exe\__main__.py", line 9, in <module>
  File "m:\miniconda3\lib\site-packages\click\core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "m:\miniconda3\lib\site-packages\click\core.py", line 695, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "m:\miniconda3\lib\site-packages\click\core.py", line 620, in make_context
    self.parse_args(ctx, args)
  File "m:\miniconda3\lib\site-packages\click\core.py", line 1012, in parse_args
    rest = Command.parse_args(self, ctx, args)
  File "m:\miniconda3\lib\site-packages\click\core.py", line 874, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "m:\miniconda3\lib\site-packages\click\core.py", line 1398, in handle_parse_result
    self.callback, ctx, self, value)
  File "m:\miniconda3\lib\site-packages\click\core.py", line 77, in invoke_param_callback
    return callback(ctx, param, value)
  File "m:\miniconda3\lib\site-packages\passpie\validators.py", line 43, in validate_config
    configuration = config.setup_crypt(configuration)
  File "m:\miniconda3\lib\site-packages\passpie\config.py", line 71, in setup_crypt
    configuration['recipient'] = get_default_recipient(configuration['homedir'])
  File "m:\miniconda3\lib\site-packages\passpie\crypt.py", line 132, in get_default_recipient
    output, _ = process.call(command)
  File "m:\miniconda3\lib\site-packages\passpie\process.py", line 40, in call
    with Proc(*args, **kwargs) as proc:
  File "m:\miniconda3\lib\subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "m:\miniconda3\lib\subprocess.py", line 966, in _execute_child
    args = list2cmdline(args)
  File "m:\miniconda3\lib\subprocess.py", line 461, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'NoneType' is not iterable