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

Aperta
#2,458 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@hslatman ci sta già lavorando.

Dal 11/11/2025.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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).

Lingua principale
Go
Stelle
8.9k
Fork
599
Merge medio
21h 20m
PR unite (30g)
15

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di smallstep/certificates

Tutte le issue di smallstep/certificates

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.