Distinguish EACCES from ENOENT in the COMFY_DIR startup check
This commit is contained in:
@@ -518,11 +518,18 @@ func run(ctx context.Context, cfg config.Config, log *slog.Logger, logOut io.Wri
|
|||||||
if comfyCmdLine != "" {
|
if comfyCmdLine != "" {
|
||||||
if cfg.ComfyCmd == "" {
|
if cfg.ComfyCmd == "" {
|
||||||
// Derived from COMFY_DIR: flag a wrong-looking layout early,
|
// Derived from COMFY_DIR: flag a wrong-looking layout early,
|
||||||
// while the operator is still watching the startup log.
|
// while the operator is still watching the startup log. Inside
|
||||||
|
// a profile the service account may not enter, os.Stat fails
|
||||||
|
// with EACCES — that reads as "not found" but means "grant
|
||||||
|
// access", so say so.
|
||||||
python, script := supervise.ComfyLayout(runtime.GOOS, cfg.ComfyDir)
|
python, script := supervise.ComfyLayout(runtime.GOOS, cfg.ComfyDir)
|
||||||
for _, p := range []string{python, script} {
|
for _, p := range []string{python, script} {
|
||||||
if _, err := os.Stat(p); err != nil {
|
if _, err := os.Stat(p); err != nil {
|
||||||
log.Warn("COMFY_DIR: file not found; ComfyUI requests will fail until it exists", "path", p)
|
if isPermission(err) {
|
||||||
|
log.Warn("COMFY_DIR: not accessible to the service account; grant access or re-run --install-service", "path", p)
|
||||||
|
} else {
|
||||||
|
log.Warn("COMFY_DIR: file not found; ComfyUI requests will fail until it exists", "path", p)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user