juicedata/juicefs · error
load worker config: %s
Error message
load worker config: %s
What it means
In doSync, when the process runs as a sync worker (--worker), it reads its src/dst URLs and environment from the master via loadClusterWorkerConfig(os.Stdin). Any failure in that handshake (including bad config format, I/O errors on stdin, or env-setting failures from error 310) is re-wrapped as 'load worker config: %s'. The worker cannot proceed without this config, so the command exits.
Source
Thrown at cmd/sync.go:537
return "", "", err
}
for key, value := range env {
if err := os.Setenv(key, value); err != nil {
return "", "", fmt.Errorf("set worker environment %q: %s", key, err)
}
}
return src, dst, nil
}
func doSync(c *cli.Context) error {
isWorker := c.String("manager") != ""
var workerSrcURL, workerDstURL string
if isWorker {
var err error
// need init before NewConfigFromCli, otherwise the env will not be applied(umask)
workerSrcURL, workerDstURL, err = loadClusterWorkerConfig(os.Stdin)
if err != nil {
return fmt.Errorf("load worker config: %s", err)
}
}
setup(c, 2)
if c.IsSet("include") && !c.IsSet("exclude") {
logger.Warnf("The include option needs to be used with the exclude option, otherwise the result of the current sync may not match your expectations")
}
config := sync.NewConfigFromCli(c)
cliCtx = c
if config.Manager != "" {
logger.Debugf("worker process start")
}
// Windows support `\` and `/` as its separator, Unix only use `/`
srcURL, dstURL := c.Args().Get(0), c.Args().Get(1)
if isWorker {
srcURL, dstURL = workerSrcURL, workerDstURL
} else {
config.SetClusterStorage(srcURL, dstURL)
}View on GitHub (pinned to c9a67b23e8)
Solutions
- Read the inner error after 'load worker config:' to find the root cause.
- Verify the worker was launched by the master (with --worker) so stdin carries the cluster config; do not run --worker manually with a terminal stdin.
- Check that the master is running and reachable, and that it printed no errors when distributing the job.
- If running under a supervisor, ensure stdin is a pipe connected to the master, not /dev/null.
Defensive patterns
Strategy: try-catch
Try / catch
if err := runSyncWorker(); err != nil {
if strings.Contains(err.Error(), "load worker config") {
// verify master connectivity and that stdin carries the config pipe
}
return err
} Prevention
- Always launch workers through the master (with --worker), never manually with a terminal stdin
- Under systemd/docker, ensure stdin is wired to the master process, not /dev/null
- Log master-side errors when distributing cluster jobs
When it happens
Trigger: `juicefs sync ... --worker` where loadClusterWorkerConfig returns an error: stdin closed/empty, malformed cluster config line, or a setenv failure inside the worker env application loop.
Common situations: Worker launched without the master piping the config into stdin; master crashed or disconnected mid-handshake; master sent malformed config; stdin redirected by a process manager (systemd/docker) so the worker never receives the config.
Understand the failure class
Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.
Related errors
- set worker environment %q: %s
- Unsupported ByteMultiple " + sMultiple
- wrong type
- random, backward, skip are only valid under read
- random, backward, skip are mutually exclusive
AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06).
Data as JSON: /api/errors/8b8bc59a776ab5f7.
Report an issue: GitHub.