Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to find user openfl: no matching entries in passwd file #1211

Open
yanmxa opened this issue Dec 12, 2024 · 2 comments
Open

unable to find user openfl: no matching entries in passwd file #1211

yanmxa opened this issue Dec 12, 2024 · 2 comments

Comments

@yanmxa
Copy link
Contributor

yanmxa commented Dec 12, 2024

Describe the bug
A clear and concise description of what the bug is.
I want to build an image from the current workspace with fx workspace dockerize --save. But it always throws the following error message:

 fx workspace dockerize --save
[13:36:14] INFO     FL-Plan hash is 0a75748df5759c7af688f263440ca474551f38cfcf562022f6be4db852f3ea769ab59b6dc1b3bc4df8c948d466827e21                 plan.py:290
           INFO     plan.yaml is already frozen                                                                                                       plan.py:92
'.workspace' file not found.
Create a default '.workspace' file? [y/N]: y

 🗜️  Preparing workspace distribution zip file

 ✔️  Workspace exported to archive: mnist_workspace.zip
Building the Docker image
> Step 1/10 : ARG BASE_IMAGE=openfl:latest>
> Step 2/10 : FROM ${BASE_IMAGE}>
>  ---> 71b6034ad009
> Step 3/10 : SHELL ["/bin/bash", "-o", "pipefail", "-c"]>
>  ---> Running in d0bf0328c4e3
>  ---> 2917710660dd
> Step 4/10 : USER openfl>
>  ---> Running in 1044cddf3367
>  ---> f1f1a9a60474
> Step 5/10 : ARG WORKSPACE_NAME>
>  ---> Running in 62b68be5dec4
>  ---> 3c9c67a907ea
> Step 6/10 : COPY ${WORKSPACE_NAME}.zip .>
>  ---> e78ef86e0217
> Step 7/10 : WORKDIR /home/openfl>
>  ---> Running in 378907ff6ab9
>  ---> ef9f3522afae
> Step 8/10 : RUN fx workspace import --archive ${WORKSPACE_NAME}.zip &&     pip install -r ${WORKSPACE_NAME}/requirements.txt>
>  ---> Running in dae29aa03d5f
Failed to build the Docker image:
{'errorDetail': {'message': 'unable to find user openfl: no matching entries in passwd file'}, 'error': 'unable to find user openfl: no matching entries in passwd file'}

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@teoparvanov
Copy link
Collaborator

teoparvanov commented Dec 13, 2024

Hi @yanmxa, I suppose you've been following the instructions in the openfl-docker/README.md? From the console outputs you've provided, it looks like you're encountering a problem retrieving the base openfl image.

Alternatively, could you try rebuilding the base openfl image locally from sources?

cd openfl-docker
docker build . -t openfl -f Dockerfile.base --build-arg OPENFL_REVISION=https://github.com/securefederatedai/openfl.git@develop

Looping in @MasterSkepticista and @psfoley, as they may be able to provide additional insight.

@MasterSkepticista
Copy link
Collaborator

MasterSkepticista commented Dec 16, 2024

@yanmxa It seems you modified USER to be openfl in the workspace dockerfile, but not in the base image.
Here are two ways to use a custom user:

  1. Set the USER value to the one you intend to use in the base dockerfile (where a user is created), and workspace dockerfile (where it simply switches to the user already created in the base image):

    # Create an unprivileged user.
    RUN groupadd -g 1001 default && \
    useradd -m -u 1001 -g default user
    USER user

  2. Leave the defaults as USER user in both dockerfiles. Instead supply a flag during docker run --user <value> <args>

Let us know if this works. Since it cannot be known which usernames would be used during deployment, we do not expose the option to configure usernames during build. We are reviewing it internally to see if there are better ways to handle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants