Skip to content

dcp: MPI permissions issue with --uid and --gid #585

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

Closed
bdevcich opened this issue Oct 2, 2024 · 0 comments · Fixed by #586
Closed

dcp: MPI permissions issue with --uid and --gid #585

bdevcich opened this issue Oct 2, 2024 · 0 comments · Fixed by #586

Comments

@bdevcich
Copy link
Contributor

bdevcich commented Oct 2, 2024

Running dcp with --uid and --gid frequently results in this message at the end. This is with openmpi v4.1.0 and running mpirun as root. I understand that running as root is frowned upon, but our current design forces our hand at this so that we can become any user to perform data movement inside of containers.

A full command typically looks something like this:

mpirun --allow-run-as-root -hostfile <hostfile> dcp --xattrs none --progress 1 --uid 1060 --gid 100 <src> <dest>

And here is the message that appears frequently after the dcp output:

# --------------------------------------------------------------------------
# A system call failed during shared memory initialization that should
# not have.  It is likely that your MPI job will now either abort or
# experience performance degradation.
#
#   Local host:  nnf-dm-worker-xj45m
#   System call: unlink(2) /dev/shm/vader_segment.nnf-dm-worker-xj45m.8d600001.7
#   Error:       Operation not permitted (errno 1)
# --------------------------------------------------------------------------

Most of the time, this message appears to be harmless: dcp completes successfully and well as mpirun. However, there are some cases there it can segfault.

I tried to get at the root of the message and as part of that journey, I ended up upgrading to openmpi v4.1.6 to try to see if anything changes. It does and these message now appear with every single invocation of dcp:

    [[16880,0],0] ORTE_ERROR_LOG: Data unpack failed in file util/show_help.c at line
    501\n[nnf-dm-controller-manager-67cbcc74c5-s8bg6:00394] [[16880,0],0] ORTE_ERROR_LOG:
    Data unpack failed in file util/show_help.c at line 501\n[nnf-dm-controller-manager-67cbcc74c5-s8bg6:00394]
    [[16880,0],0] ORTE_ERROR_LOG: Data unpack failed in file util/show_help.c at line
    501\n[nnf-dm-controller-manager-67cbcc74c5-s8bg6:00394] [[16880,0],0] ORTE_ERROR_LOG:
    Data unpack failed in file util/show_help.c at line 501\n[nnf-dm-controller-manager-67cbcc74c5-s8bg6:00394]
    [[16880,0],0] ORTE_ERROR_LOG: Data unpack failed in file util/show_help.c at line
    501\n[nnf-dm-controller-manager-67cbcc74c5-s8bg6:00394] [[16880,0],0] ORTE_ERROR_LOG:
    Data unpack failed in file util/show_help.c at line 501\n[nnf-dm-controller-manager-67cbcc74c5-s8bg6:00394]
    [[16880,0],0] ORTE_ERROR_LOG: Data unpack failed in file util/show_help.c at line
    501\n[nnf-dm-controller-manager-67cbcc74c5-s8bg6:00394] [[16880,0],0] ORTE_ERROR_LOG:
    Data unpack failed in file util/show_help.c at line 501\n"

I noticed that if you drop --uid and --gid, this goes away. That leads me to believe that there are some issues with the combination of mpirun as root and trying to do things in dcp as non-root.

In lieu of using dcp --uid/--gid, I tried to use setpriv before the dcp command:

mpirun --allow-run-as-root -hostfile <hostfile> setpriv --euid 1060 --egid 100 --clear-groups dcp --xattrs none --progress  <src> <dest>

But this results in an error:

   [nnf-dm-worker-jzl9t:00111] PMIX ERROR: UNREACHABLE in file ptl_tcp_component.c at line 1849
   [nnf-dm-worker-jzl9t:00121] PMIX ERROR: ERROR in file gds_ds12_lock_pthread.c at line 168
   [nnf-dm-worker-jzl9t:00121] OPAL ERROR: Unreachable in file pmix3x_client.c at line 111
   *** An error occurred in MPI_Init
   *** on a NULL communicator
   *** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
   ***    and potentially your MPI job)
   [nnf-dm-worker-jzl9t:00121] Local abort before MPI_INIT completed completed successfully, but am not able to aggregate error messages, and not able to guarantee that all other processes were killed!
   --------------------------------------------------------------------------
   mpirun detected that one or more processes exited with non-zero status, thus causing
   the job to be terminated. The first process to do so was:

     Process name: [[22121,1],3]
     Exit code:    1
   --------------------------------------------------------------------------

I think --uid and --gid need to only be used for the file operations and not mpi functionality. Is that possible?

bdevcich added a commit to NearNodeFlash/mpifileutils that referenced this issue Oct 3, 2024
When `--uid` or `--gid` is used, MPI_Init() is called as the original
user. The original uid/gid is not being restored prior to calling
MPI_Finalize(), which leads to cleanup issues.

Resolves hpc#585.

Signed-off-by: Blake Devcich <[email protected]>
bdevcich added a commit to NearNodeFlash/mpifileutils that referenced this issue Oct 3, 2024
When `--uid` or `--gid` is used, MPI_Init() is called as the original
user. The original uid/gid is not being restored prior to calling
MPI_Finalize(), which leads to cleanup issues.

Resolves hpc#585.

Signed-off-by: Blake Devcich <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant