[Bug]: `step` (client) does not properly run when using `launchd` to trigger the script (MacOS Sequoia 15.5)

Open
#2,458 3 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@hslatman is already working on this.

Since Nov 11, 2025.

Assessment

This issue has not been assessed yet.

Description

bug needs triage
Steps to Reproduce
shell script to renew on a MacBook
#!/bin/bash

CERT_PATH="$HOME/cert.pem"
KEY_PATH="$HOME/key.pem"
PASSWORD_FILE="$HOME/.step-password"
PROVISIONER="[email protected]"

# Renew certificate
/opt/homebrew/bin/step ca certificate "$(whoami)@$(hostname)" \
    "$CERT_PATH" \
    "$KEY_PATH" \
    --provisioner "$PROVISIONER" \
    --password-file "$PASSWORD_FILE" \
    --not-after=16h \
    --force
launchd com.user.renew-cert.plist file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.user.docker-cert-renewal</string>
    
    <key>ProgramArguments</key>
    <array>
        <string>/Users/<user>/renew-cert.sh</string>
    </array>
    
    <key>StartInterval</key>
    <integer>57600</integer>
    
    <key>RunAtLoad</key>
    <true/>
    
    <key>StandardOutPath</key>
    <string>/Users/<user>/renewal-stdout.log</string>
    
    <key>StandardErrorPath</key>
    <string>/Users/<user>/renewal-stderr.log</string>
    
    <key>EnvironmentVariables</key>
    <dict>
        <key>PATH</key>
        <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin</string>
    </dict>
    
    <key>ProcessType</key>
    <string>Background</string>
</dict>
</plist>
  1. Copy the content of the shell file excerpt to ~/renew-cert.sh (/Users/<user>/renew-cert.sh).
  2. Run chmod +x ~/renew-cert.sh.
  3. Ensure step is installed (brew install step).
  4. Copy the content of the plist file excerpt to ~/Library/LaunchAgents.
  5. Replace <user> with an actual user.
  6. Trigger the new Launch agent off and back on.Image

It should run and create the logging outputs.

Your Environment
  • MacOS Sequoia 15.7
  • step version: Smallstep CLI/0.28.7 (darwin/arm64), Release Date: 2025-07-14 05:36 UTC
  • step-ca version (on my remote machine): Smallstep CA/0.28.1 (linux/amd64), Release Date: 2025-05-12 21:09 UTC
Expected Behavior

The renew-cert.sh should be executed using launchd properly and create the expected cert.pem and key.pem files, the output should look something like:

✔ Provisioner: <redacted_provisioner> (JWK) [kid: _<redacted_id>]
✔ CA: https://<redacted_url>
✔ Certificate: /Users/<user>/cert.pem
✔ Private Key: /Users/<user>/key.pem

This should be the output you get when running renew-cert.sh from terminal.

Actual Behavior

The /Users/<user>/renewal-stderr.log will contain this:

client GET https://step-ca.my.world/provisioners?limit=100 failed: dial tcp 192.168.178.155:443: connect: no route to host

And the certificate creation will fail.

Additional Context

I can't exactly say for sure why this is, but I do have an idea:

I don't understand all the details, but judging by what I see it seems, that either an old version of Go is used or a particular flag is not set to generate the necessary UUID for MacOS to identify the application and show the popup regarding "Local Network access". I also don't see step ever requesting it.

Perhaps adding -B gobuildid to the ldflags would solve this?

$ dwarfdump --uuid /opt/homebrew/bin/step
UUID: 9FD8B88C-F25F-3B18-E2D6-576D65EAA410 (arm64) /opt/homebrew/bin/step

It has a UUID... this is not the issue it seems.

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Dominant language
Go
Stars
8.9k
Forks
599
Avg merge
21h 20m
Merged PRs (30d)
15

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from smallstep/certificates

All issues in smallstep/certificates

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.