Menu

#81 fix(#67 regression): fleet-task* temp path uses server OS path, breaks remote SSH members

closed
nobody
bug (6)
2026-04-06
2026-04-06
Anonymous
No

Originally created by: kumaakh

Regression introduced by [#67]

The fix for [#67] moved .fleet-task* prompt files to os.tmpdir() to prevent them entering member git repos. This works for local members but breaks remote SSH members.

Root cause

os.tmpdir() is evaluated on the fleet server (e.g. Windows: C:\Users\akhil\AppData\Local\Temp). This path is then used as the location for the fleet-task file when constructing the cd command sent to the remote member. A macOS/Linux remote member receives:

cd: C:\Users\akhil\AppData\Local\Temp: No such file or directory

Fix

The temp path must be resolved relative to the member's OS, not the server's OS:

  • Local membersos.tmpdir() on the server is correct (same machine)
  • Remote members — use /tmp (safe on all Linux/macOS targets), or resolve via execute_command → echo $TMPDIR on the member before writing the file

Simplest fix: branch on member_type:

const tmpDir = member.type === 'local' ? os.tmpdir() : '/tmp';

Impact

All execute_prompt calls to remote SSH members fail with a path error. Local members are unaffected.

Related

Tickets: #67

Discussion

  • Anonymous

    Anonymous - 2026-04-06

    Originally posted by: kumaakh

    Fixed in PR [#79] (merged 44d1cb5).

     

    Related

    Tickets: #79

  • Anonymous

    Anonymous - 2026-04-06

    Ticket changed by: kumaakh

    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB