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

SSH: Unable to find program #5839

Open
TGTGamer opened this issue Dec 15, 2024 · 8 comments
Open

SSH: Unable to find program #5839

TGTGamer opened this issue Dec 15, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@TGTGamer
Copy link

Version

0.14.4

Operating System

Windows

Distribution Method

msi (Windows)

Describe the issue

Using 1password as my ssh agent. Was working until I updated to latest version:

SSH agent path: C:\Program Files\1Password\app\8\op-ssh-sign.exe
Confirmed it exists, is working for other programs

How to reproduce

No response

Expected behavior

Should sign commits.

Relevant log output

Program not found
user.C034edPS.js:4 
 ipc->check_signing_settings: {"id":"31d6e997-0f4b-4b08-8a9a-e666c46c1609"} s: Program not found
    at s.fromError (http://tauri.localhost/_app/immutable/chunks/ipc.DM3tJdKb.js:1:1093)
    at w (http://tauri.localhost/_app/immutable/chunks/ipc.DM3tJdKb.js:1:1297)
    at async Object.C [as onclick] (http://tauri.localhost/_app/immutable/nodes/27.0QkJqKa9.js:10:818) 
Object
user.C034edPS.js:4 
 Error checking signing: s: Program not found
    at s.fromError (http://tauri.localhost/_app/immutable/chunks/ipc.DM3tJdKb.js:1:1093)
    at w (http://tauri.localhost/_app/immutable/chunks/ipc.DM3tJdKb.js:1:1297)
    at async Object.C [as onclick] (http://tauri.localhost/_app/immutable/nodes/27.0QkJqKa9.js:10:818)
(anonymous)	@	user.C034edPS.js:4
@TGTGamer TGTGamer added the bug Something isn't working label Dec 15, 2024
@Byron
Copy link
Collaborator

Byron commented Dec 16, 2024

Thanks a lot for reporting!

I am pretty sure that #5756 has something to do with it.

  • The problem is that on Windows, the current implementation won't use a shell which is probably required for all required environment variables to be picked up.

This I will address, hoping that it will work again then.

@Byron Byron self-assigned this Dec 16, 2024
Byron added a commit to Byron/gitbutler that referenced this issue Dec 16, 2024
gitbutlerapp#5839)

That way, the shell will be used on Windows as well.
@Byron Byron mentioned this issue Dec 16, 2024
@Byron Byron closed this as completed in f4115c3 Jan 2, 2025
@DS-DanielW
Copy link

DS-DanielW commented Jan 3, 2025

Still getting this same issue on the latest nightly with the potential fix merged.

2025-01-03T08:34:23.899332Z  INFO check_signing_settings: crates\gitbutler-tauri\src\repo.rs:38: new id=258c22eb-ba53-4ee5-a89d-ff5c4781f566
2025-01-03T08:34:23.906000Z ERROR check_signing_settings: crates\gitbutler-tauri\src\repo.rs:38: error=Error(program not found) id=258c22eb-ba53-4ee5-a89d-ff5c4781f566
2025-01-03T08:34:23.906021Z  INFO check_signing_settings: crates\gitbutler-tauri\src\repo.rs:38: close time.busy=6.68ms time.idle=10.9µs id=258c22eb-ba53-4ee5-a89d-ff5c4781f566

@Caleb-T-Owens
Copy link
Contributor

Caleb-T-Owens commented Jan 3, 2025

@Byron I've taken a look at the PR which seems to use with_shell which is always uses sh, which most people probably don't have an environment set up for. We possibly ought to try doing with_shell_program and pass in $SHELL by default, and have a user setting that lets them override it.

WDYT?

@Caleb-T-Owens Caleb-T-Owens reopened this Jan 3, 2025
@Byron
Copy link
Collaborator

Byron commented Jan 4, 2025

This is also what I had in mind when adding with_shell_program(), and I am not surprised the fix didn't work after all. What I kept wondering is how this could ever work, as previously it was launching ssh directly if I remember correctly.

In any case, even when using the shell configured by the user, it might not come up as login shell and thus doesn't read all the configuration files that it would need to truly resemble the environment that the user sees in a terminal. On top of that, what it takes to spawn a login shell seems to differ depending on the shell.

What we'd really want is a way to use the environment that the user sees in their standard terminal environment, and if available, there wouldn't be a need to go through a shell at all.

Thinking about it more, once it's clear how to make a shell launch as interactive shell at least, or login shell even, while executing a command, then doing so might be the most compatible as on each invocation it would pick up the latest settings. Otherwise, if GitButler were to read the environment from the loginshell and make it its own, it would effectively cache these and can't pick up changes easily.

Probably it will be easiest to to try to use $SHELL and with_shell_program(), and if that isn't good enough for some shells, one could add something like with_login_shell() which will automatically add the required arguments depending on the currently set shell.

How does that sound?

@Caleb-T-Owens
Copy link
Contributor

Probably it will be easiest to to try to use $SHELL and with_shell_program(), and if that isn't good enough for some shells, one could add something like with_login_shell() which will automatically add the required arguments depending on the currently set shell.

How does that sound?

Sounds good to me 👍

@Caleb-T-Owens
Copy link
Contributor

Are you interested in working on it? Otherwise I can take a look

@Byron Byron assigned Caleb-T-Owens and unassigned Byron Jan 6, 2025
@Byron
Copy link
Collaborator

Byron commented Jan 6, 2025

I just realized that I was still assigned, but would love if you could take it over.

@Byron Byron assigned Byron and unassigned Caleb-T-Owens Jan 9, 2025
Byron added a commit to Byron/gitbutler that referenced this issue Jan 9, 2025
That way it should pick up all configuration just as it does
when invoking it from the terminal.
@Byron Byron mentioned this issue Jan 9, 2025
4 tasks
Byron added a commit to Byron/gitbutler that referenced this issue Jan 9, 2025
That way it should pick up all configuration just as it does
when invoking it from the terminal.
@Byron
Copy link
Collaborator

Byron commented Jan 9, 2025

The linked PR will now enforce using the current users default shell, assuming it is picked up in the $SHELL environment variable, which should make signing more likely. And I say it carefully as my tests indicate that the environment of my login shell is actually already present in the GitButler application even when started through the finder. Thus, if launching these programs through a shell changes something, their effect is probably more subtle than environment variables.

In any case, at most a day after the PR gets merged one should be able to try it out in the nightly build.

Byron added a commit to Byron/gitbutler that referenced this issue Jan 10, 2025
That way it should pick up all configuration just as it does
when invoking it from the terminal.
Byron added a commit to Byron/gitbutler that referenced this issue Jan 10, 2025
That way it should pick up all configuration just as it does
when invoking it from the terminal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants