gopass-jsonapi icon indicating copy to clipboard operation
gopass-jsonapi copied to clipboard

gopass-jsonapi configure complains store uninitialized

Open liljenstolpe opened this issue 2 years ago • 6 comments
trafficstars

Summary

bridge has stopped working on my Arch box. When I attempt to run gopass-jsonapi configure I get the following error:

Failed to initialize gopass API: password store not initialized. run 'gopass setup' first

But gopass is fully configured and running

Steps To Reproduce

Not sure how I got here. So, not quite sure how to reproduce, sorry.

Expected behavior

Be able to re-run configure on a running gopass system and be able to bring up bridge or other jsonapi clients

But - maybe - have a new-style config file, and non-default store location?

Environment

Please complete the following information (see note below)

  • Arch, recent

  • OS version: Linux mjolnir 6.1.11-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 09 Feb 2023 20:06:08 +0000 x86_64 GNU/Linux

  • gopass-jsonapi Version: Bzzz - try again - won't even run that due to the error

  • Installation method: Original from AUR, retried with a go get.

Additional context

Re-ran with DEBUG set, here are some interesting tid-bits...

❯ cat /tmp/gp.log
2023/04/07 19:03:55.079858 pwrules/aliases.go:55	pwrules.loadCustomAliases	no custom aliases found at /home/cdl/.config/gopass/domain-aliases.json
2023/04/07 19:03:55.108839 config/io.go:47	config.loadConfig	Trying to load config from /home/cdl/.config/gopass/config.yml
2023/04/07 19:03:55.108863 config/io.go:47	config.loadConfig	Trying to load config from /home/cdl/.config/gopass/config.yml
2023/04/07 19:03:55.108871 config/io.go:47	config.loadConfig	Trying to load config from /home/cdl/.gopass.yml
2023/04/07 19:03:55.109291 config/io.go:66	config.loadDefault	Loaded default config: &config.Config{AutoClip:false, AutoImport:false, ClipTimeout:45, ExportKeys:true, NoPager:false, Notifications:true, Parsing:true, Path:"/home/cdl/.local/share/gopass/stores/root", SafeContent:false, Mounts:map[string]string{}, ConfigPath:"/home/cdl/.config/gopass/config.yml", XXX:map[string]interface {}(nil)}

The key here, is you aren't seeing the config.

The config is in /home/cdl/.config/gopass/config note it's in the NEW format (the gitconfig format), not the YAML format. It looks like you aren't looking for the non-yaml format configs. Therefore, you aren't finding my stores.

Note, I didn't change the config format, I assume some upgrade that gopass went through in the last year did the translation in a migration.

liljenstolpe avatar Apr 08 '23 02:04 liljenstolpe

@dominikschulz, any thoughts on this?

liljenstolpe avatar Apr 29 '23 18:04 liljenstolpe

Ok, I have an ugly hack workaround, that works for some reason.

$ gopass-jsonapi configure --print

Then, at the end, when it asks you to install, say 'Y'. Evidently, that somehow bypasses the check that is blocking the normal install/configure.

liljenstolpe avatar Apr 29 '23 18:04 liljenstolpe

Is there anyone paying attention here?

liljenstolpe avatar May 15 '23 21:05 liljenstolpe

@dominkschultz - need anything else from me?

liljenstolpe avatar May 23 '23 19:05 liljenstolpe

+1, although slightly different.

I am unable to able to install for all users, without initialising a password store for the root user, which is a bit annoying.

You could change /etc/opt/chrome/native-messaging-hosts directory to allow write from non root users, then switch it back after running the install script. Although the install locations for the wrapper etc would default to still being in your home directory.

fetwar avatar Nov 21 '23 01:11 fetwar

I am unable to able to install for all users, without initialising a password store for the root user, which is a bit annoying.

This is something we should fix. An initialized password store should not be required to install the extension.

dominikschulz avatar Nov 21 '23 10:11 dominikschulz