Skip to content

Not working #2

Description

@MichaelBelgium

Trying out catapultjs. Unfortunately not working at all. I did the quick start but i'm having these issues:

  • it's not possible to specify the ssh key in deploy config?
  • some sock error: (possible because windows?)
==> [production] setup directories

ℹ ExecaError: Command failed with exit code 4294967295: ssh -o "ControlMaster=auto" -o 
  "ControlPath=C:\Users\Michael\AppData\Local\Temp\cata-dd9c1426.sock" -o "ControlPersist=300" "deploy@*****" "bash -lc 
  'echo 
  CiAgICBzZXQgLWUKICAgIG1rZGlyIC1wICcvaG9tZS9kZXBsb3kvc3BsaXQtZmxhcCcKICAgIG1rZGlyIC1wICcvaG9tZS9kZXBsb3kvc3BsaXQtZmxhcC9yZWxlYXNlcycKICAgIG1rZGlyIC1wICcvaG9tZS9kZXBsb3kvc3BsaXQtZmxhcC9zaGFyZWQnCiAgICBta2RpciAtcCAnL2hvbWUvZGVwbG95L3NwbGl0LWZsYXAvLmNhdGFwdWx0JwogICAgCiAgICAKICA=|base64 
  -d|bash'"

  getsockname failed: Not a socket\r
  Read from remote host *******: Unknown error

 ⁃ at getFinalError (/node_modules/execa/lib/return/final-error.js:6:9)

    1 ┃  // When the subprocess fails, this is the error instance being returned.
    2 ┃  // If another error instance is being thrown, it is kept as `error.cause`.
    3 ┃  export const getFinalError = (originalError, message, isSync) => {
    4 ┃         const ErrorClass = isSync ? ExecaSyncError : ExecaError;
    5 ┃         const options = originalError instanceof DiscardedError ? {} : {cause: originalError};
 ❯  6 ┃         return new ErrorClass(message, options);
    7 ┃  };
    8 ┃  
    9 ┃  // Indicates that the error is used only to interrupt control flow, but not in the return value
   10 ┃  export class DiscardedError extends Error {}
   11 ┃  

 ⁃ at makeError (/node_modules/execa/lib/return/result.js:108:16)
 ⁃ at getAsyncResult (/node_modules/execa/lib/methods/main-async.js:168:4)
 ⁃ at handlePromise (/node_modules/execa/lib/methods/main-async.js:151:17)
 ⁃ at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
 ⁃ at async setupHost (/node_modules/@catapultjs/deploy/build/src/deployer.js:25:5)
 ⁃ at async initializeHost (/node_modules/@catapultjs/deploy/build/src/deployer.js:36:5)
 ⁃ at async Setup.run (/node_modules/@catapultjs/deploy/build/commands/setup.js:14:13)
 ⁃ at async Setup.exec (/node_modules/@adonisjs/ace/build/index.js:712:18)
 ⁃ at async #execMain (/node_modules/@adonisjs/ace/build/index.js:2184:4)

Activity

  1. batosai commented on Jul 25, 2026

    @batosai
    Collaborator

    Thanks for the feedback!

    You're right, at the moment it's not possible to specify a custom path for the SSH key. I'll add support for that.

    As for Windows support, I haven't tested it at all yet. I should be able to look into it by the end of the summer.

    Could you tell me a bit more about your environment? In particular, what are you using for SSH (OpenSSH, Git for Windows, WSL, PuTTY, etc.)?

  2. MichaelBelgium commented on Jul 25, 2026

    @MichaelBelgium
    Author

    Well my goal is to find an easier solution to deploy nodejs applications to my server and that only the files are on the server that are required to run it. So no dev packages, no .env files, anything thats not needed shouldn't be on there,

    Currently it's complicated - idk why nodejs apps are so hard to deploy (compared to PHP which is my main field).

    My dev environment is just my local PC, windows. And on server there's prod and/or testing environments.
    I use the ssh client Termius mostly, before it was Putty. If these 2 inquires get resolved, i think my goal might be reached :) But i gotta see how the recipes will behave. I got 2 nodejs applications right now: astro and adonisjs.

  3. batosai commented on Jul 25, 2026

    @batosai
    Collaborator

    The socket error isn't related to Termius or PuTTY. catapult doesn't interact with your SSH client directly. It simply invokes the ssh, scp, and rsync executables available on your PATH using standard OpenSSH syntax. According to your logs, it's using the native Windows OpenSSH (ssh.exe), and that's where the failure occurs:

    getsockname failed: Not a socket
    

    catapult relies on SSH connection multiplexing (ControlMaster / ControlPath) to reuse a single SSH connection across multiple commands. Unfortunately, the native Windows OpenSSH implementation doesn't support control sockets, so the connection fails immediately. In addition, Windows doesn't provide rsync out of the box, while several deployment recipes depend on it.

    The easiest way to get things working right now is to run catapult from WSL2.

    wsl --install

    Inside a WSL (Ubuntu) environment you'll have a full OpenSSH implementation along with rsync. SSH multiplexing works as expected, and your ~/.ssh/config (IdentityFile, User, Port, etc.) behaves exactly the same as it does on Linux or macOS. Just move your project into WSL and run catapult from there—no configuration changes required.

    I'm also planning a couple of improvements on the catapult side:

    Support for a custom SSH key per host.
    Automatic (or optional) disabling of connection multiplexing when it's not supported

    Deploying only the files needed at runtime without development dependencies or your .env file, is exactly what catapult is designed for. Once you're past this issue, I can help you set up the right deployment recipe for Astro or AdonisJS.

  4. MichaelBelgium commented on Jul 25, 2026

    @MichaelBelgium
    Author

    The socket error isn't related to Termius or PuTTY.

    No shit 😅 The error makes it clear it uses the ssh executable which every system has

    It's this line in the sshControlArgs function:

    const socket = join(tmpdir(), `cata-${hash}.sock`)

    This file doesn't exist on windows I believe. If I do an early return when the system is windows, the setup command does work 🎉

    But for now i'll wait for fix instead of using WSL

    I'm also planning a couple of improvements on the catapult side:

    Support for a custom SSH key per host.
    Automatic (or optional) disabling of connection multiplexing when it's not supported

    Ok great!

  5. batosai commented on Jul 26, 2026

    @batosai
    Collaborator

    Both changes are in and published under the beta tag.

    I don't have a Windows machine to test on at the moment, so I really can't validate
    this on your platform myself. I'd genuinely appreciate it if you could give the beta
    a try and let me know how it goes, your feedback is what will let me confirm the fix
    and cut a proper release 🙏

    npm i -D @catapultjs/deploy@beta

    1. The sock error is fixed. Connection multiplexing (ControlMaster/ControlPath)
    is now auto-disabled on Windows, since native OpenSSH has no control-socket support
    that's exactly the getsockname failed: Not a socket you hit. Nothing to configure,
    it's automatic. If you ever need to override it, there's a per-host multiplexing
    boolean.

    2. Custom SSH key path. New per-host identityFile on the object ssh form:

    {
      "name": "production",
      "ssh": {
        "user": "deploy",
        "host": "example.com",
        "port": 22,
        "identityFile": "C:/Users/Michael/.ssh/deploy_ed25519"
      },
      "deployPath": "/home/deploy/myapp"
    }

    On Windows, use forward slashes (or ~) in the path to avoid backslash escaping.
    (If you use a string alias like "deploy@example.com" instead, configure the key
    via ~/.ssh/config → IdentityFile.)

    One heads-up for later: the setup command and everything over ssh/scp
    should now work on native Windows. But recipes/rsync needs an rsync binary, which native Windows doesn't ship

    Let me know how the setup and a deploy go on your end, if it works I'll cut a
    proper release.

  6. MichaelBelgium commented on Jul 27, 2026

    @MichaelBelgium
    Author

    Both issues are resolved, great!

    Trying out the first deploy takes suspicious long, been waiting for 15 minutes already,. It's doing the scp command.
    I suspect it's copying everything, including the whole node_modules folder? That'll take ages

    Do i only have to do this in deploy.config.ts if my project is astro? Or does it require something more.

    import '@catapultjs/deploy/recipes/astro'
    

    I expect it should build locally and then copy the build to the server? But the scp copies my whole dev environment

  7. batosai commented on Jul 27, 2026

    @batosai
    Collaborator

    Great thanks for the feedback.

    You can use the static recipe: https://catapultjs.com/guide/recipes/astro_static

  8. MichaelBelgium commented on Jul 27, 2026

    @MichaelBelgium
    Author

    Ok, gonna close this because the initial issues got fixed, thx for the help

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions