Skip to content

Conversation

@ivo1116
Copy link

@ivo1116 ivo1116 commented Jan 23, 2026

Summary

Fixes cloudfoundry/diego-release#1089 - Intermittent create-workdir-failed for Docker images using system users with no home directory.

Docker images using adduser --no-create-home crash when Guardian tries to set a non-existent home directory as the working directory. This causes diego-sshd and launcher processes to fail with exit status 2 and error message create-workdir-failed.

Root Cause:
When DesiredLRP doesn't explicitly set a Dir property, Guardian defaults to the home directory from /etc/passwd. For system users created with --no-create-home, this directory doesn't exist in the container's rootFS, causing the process creation to fail.

Solution:
Added getRootDir() function in rundmc/processes/builder.go that:

  • Checks if the working directory exists in the container's rootFS using os.Stat()
  • Falls back to / (which always exists) if the directory doesn't exist
  • Preserves existing behavior for containers with valid home directories

Backward Compatibility

Breaking Change? No

This change is backwards compatible. It only affects containers where the working directory doesn't exist (which currently crash). Containers with existing home directories continue to work as before.

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Intermittent create-workdir-failed for Docker images using system users with no home directory

1 participant