Skip to content

[JENKINS-42346] Environment not considered by exec launcher #227

Description

@jenkins-infra-bot

See gist.

SSHAgentStepExecution probably needs to be capturing EnvVars from the step context and passing that to the launcher in initRemoteAgent. And ExecRemoteAgentFactory and ExecRemoteAgent would need to pass the EnvVars to every command.

Just never came up before because ssh-agent would not normally care about environment variables other than SSH_AGENT_PID (which should not normally be initially set on the node anyway); $PATH / %Path% is of course relevant when launching the command, but this was only ever tested on Linux, with ssh-agent in /usr/bin.

Probable workaround: preconfigure the %Path% of the computer with ssh-agent available by default (or do that in the agent launcher), rather than relying on withEnv.


Originally reported by jglick, imported from: Environment not considered by exec launcher
  • status: Open
  • priority: Major
  • component(s): ssh-agent-plugin
  • label(s): environment-variables, windows
  • resolution: Unresolved
  • votes: 0
  • watchers: 3
  • imported: 20260604-211335
Raw content of original issue

See gist.

SSHAgentStepExecution probably needs to be capturing EnvVars from the step context and passing that to the launcher in initRemoteAgent. And ExecRemoteAgentFactory and ExecRemoteAgent would need to pass the EnvVars to every command.

Just never came up before because ssh-agent would not normally care about environment variables other than SSH_AGENT_PID (which should not normally be initially set on the node anyway); $PATH / %Path% is of course relevant when launching the command, but this was only ever tested on Linux, with ssh-agent in /usr/bin.

Probable workaround: preconfigure the %Path% of the computer with ssh-agent available by default (or do that in the agent launcher), rather than relying on withEnv.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions