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

gopass config core.notifications false → "Error: Error setting config value: failed to stage config file: …" #2673

Closed
tchernomax opened this issue Sep 27, 2023 · 3 comments · Fixed by #2716
Assignees
Labels
bug Defects
Milestone

Comments

@tchernomax
Copy link

Summary

max@host % gopass config core.notifications false

Error: Error setting config value: failed to stage config file: exit status 128: fatal: pathspec 'config' did not match any files

note: the setting is changed even if gopass output an error

Steps To Reproduce

gopass config core.notifications false

Expected behavior

no error

Environment

Additional context

@dominikschulz dominikschulz added the bug Defects label Sep 28, 2023
@dominikschulz dominikschulz self-assigned this Sep 28, 2023
@tjex
Copy link

tjex commented Oct 25, 2023

I'm also encountering this on Mac 13.5.

Not only this, but I have core.notifications = false set, but I've started getting notifications (clipboard copy, clear, etc)

@shiftleft1
Copy link

Also experiencing this in Ubuntu 20.04

@AnomalRoil
Copy link
Member

I can reproduce on master.
This is because the .config/gopass folder is not using git I guess.

I suspect these might be the cause:

if err := st.Add(ctx, "config"); err != nil && !errors.Is(err, istore.ErrGitNotInit) {
return fmt.Errorf("failed to stage config file: %w", err)
}
if err := st.Commit(ctx, "Update config"); err != nil && !errors.Is(err, istore.ErrGitNotInit) {
return fmt.Errorf("failed to commit config: %w", err)
}

Here's the DEBUG logs:

2023/11/20 21:35:37.767111 action/config.go:81	action.(*Action).setConfigValue	setting core.notifications to false for ""
2023/11/20 21:35:37.767116 gitconfig/config.go:109	gitconfig.(*Config).Set	set "core.notifications" to "false"
2023/11/20 21:35:37.767120 gitconfig/config.go:118	gitconfig.(*Config).Set	updating value
2023/11/20 21:35:37.767128 gitconfig/config.go:218	gitconfig.(*Config).rewriteRaw	input (core.notifications: false): ---------

[recipients]
	hash = <somebighash>
[mounts]
	path = /home/anomalroil/.local/share/gopass/stores/root
[mounts "sarl"]
	path = /home/anomalroil/.local/share/gopass/stores/sarl
[generate]
	autoclip = true
[core]
	notifications = true

-----------
2023/11/20 21:35:37.767143 gitconfig/config.go:226	gitconfig.(*Config).rewriteRaw	output: ---------

[recipients]
	hash = <somebighash>
[mounts]
	path = /home/anomalroil/.local/share/gopass/stores/root
[generate]
	autoclip = true
[core]
	notifications = false

-----------
2023/11/20 21:35:37.767151 gitconfig/config.go:242	gitconfig.(*Config).flushRaw	writing config to /home/anomalroil/.config/gopass/config: -----------

[recipients]
	hash = <somebighash>
[mounts]
	path = /home/anomalroil/.local/share/gopass/stores/root
[generate]
	autoclip = true
[core]
	notifications = false

--------------
2023/11/20 21:35:37.767236 gitfs/git.go:144	gitfs.(*Git).captureCmd	store.gitAdd: /usr/bin/git [git add --all --force config] (/home/anomalroil/.local/share/gopass/stores/root)
2023/11/20 21:35:37.768646 gitfs/git.go:144	gitfs.(*Git).captureCmd	store.gitDiffIndex: /usr/bin/git [git diff-index --quiet HEAD] (/home/anomalroil/.local/share/gopass/stores/root)
2023/11/20 21:35:37.771388 action/config.go:44	action.(*Action).Config	Error setting config value: failed to commit config: git has nothing to commit - stacktrace: failed to commit config: git has nothing to commit

which also seems to point at

if err := st.Commit(ctx, "Update config"); err != nil && !errors.Is(err, istore.ErrGitNotInit) {
return fmt.Errorf("failed to commit config: %w", err)
}

being the issue

@AnomalRoil AnomalRoil added this to the 1.15.10 milestone Nov 21, 2023
AnomalRoil added a commit that referenced this issue Nov 21, 2023
Fixes #2673

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
@AnomalRoil AnomalRoil linked a pull request Nov 21, 2023 that will close this issue
dominikschulz pushed a commit that referenced this issue Nov 24, 2023
* [CLEANUP] Misc changes around debug logging and configs

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [BUGFIX] Handle uninitialized stores with gopass config

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [BUGFIX] Do not always commit upon config changes

Fixes #2673

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] Following code review comments

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] More code review changes

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] Forgot one change

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

---------

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants