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

UID Issue on Linux #291

Closed
imolax opened this issue May 28, 2024 · 2 comments
Closed

UID Issue on Linux #291

imolax opened this issue May 28, 2024 · 2 comments

Comments

@imolax
Copy link

imolax commented May 28, 2024

Hi There!

We are having an issue with hippunfold on Docker for Linux. We can get it running, however, it exits when it tries to tar the models.

Here's what we're running:

docker run -it --rm -v /data/BILCOR/BIDS:/bids -v /data/BILCOR/BIDS/derivatives/hippunfold:/output khanlab/hippunfold:latest /bids /output participant --participant-label 02 --modality T1w -p --cores all

And here is the error (note: the error below is just the last uid issue; there are many that come before it).

Config file config/snakebids.yml is extended by additional config specified via the command line.
Building DAG of jobs...
Using shell: /bin/bash
Provided cores: 64
Rules claiming more threads will be scaled down.
Provided resources: gpus=0, mem_mb=16000, mem_mib=15259, time=60
Singularity containers: ignored
Select jobs to execute...
mkdir -p tempmodel tempimg templbl && cp work/sub-02/anat/sub-02_hemi-R_space-corobl_desc-preproc_T1w.nii.gz tempimg/temp_0000.nii.gz && tar -xf /root/.cache/hippunfold/trained_model.3d_fullres.Task101_hcp1200_T1w.nnUNetTrainerV2.model_best.tar -C tempmodel && export RESULTS_FOLDER=tempmodel && export nnUNet_n_proc_DA=16 && nnUNet_predict -i tempimg -o templbl -t Task101_hcp1200_T1w -chk model_best -tr nnUNetTrainerV2 --disable_tta &> logs/sub-02/sub-02_hemi-R_space-corobl_nnunet.txt && cp templbl/temp.nii.gz work/sub-02/anat/sub-02_hemi-R_space-corobl_desc-nnunet_dseg.nii.gz
Changing to shadow directory: /output/.snakemake/shadow/tmp7ataqbav
Building DAG of jobs...
Using shell: /bin/bash
Provided cores: 64
Rules claiming more threads will be scaled down.
Provided resources: gpus=0, mem_mb=16000, mem_mib=15259, time=60
Singularity containers: ignored
Select jobs to execute...
mkdir -p tempmodel tempimg templbl && cp work/sub-02/anat/sub-02_hemi-Lflip_space-corobl_desc-preproc_T1w.nii.gz tempimg/temp_0000.nii.gz && tar -xf /root/.cache/hippunfold/trained_model.3d_fullres.Task101_hcp1200_T1w.nnUNetTrainerV2.model_best.tar -C tempmodel && export RESULTS_FOLDER=tempmodel && export nnUNet_n_proc_DA=16 && nnUNet_predict -i tempimg -o templbl -t Task101_hcp1200_T1w -chk model_best -tr nnUNetTrainerV2 --disable_tta &> logs/sub-02/sub-02_hemi-Lflip_space-corobl_nnunet.txt && cp templbl/temp.nii.gz work/sub-02/anat/sub-02_hemi-Lflip_space-corobl_desc-nnunet_dseg.nii.gz
Changing to shadow directory: /output/.snakemake/shadow/tmp0ynzy08r
tar: nnUNet/3d_fullres/Task101_hcp1200_T1w/nnUNetTrainerV2__nnUNetPlansv2.1/fold_3/debug.json: Cannot change ownership to uid 3050834, gid 6007967: Invalid argument

and it continues with many tar uid errors, then ends with:

tar: nnUNet/3d_fullres/Task101_hcp1200_T1w/nnUNetTrainerV2__nnUNetPlansv2.1: Cannot change ownership to uid 3050834, gid 6007967: Invalid argument
tar: Exiting with failure status due to previous errors
[Tue May 28 14:05:18 2024]
Error in rule run_inference:
    jobid: 0
    input: work/sub-02/anat/sub-02_hemi-Lflip_space-corobl_desc-preproc_T1w.nii.gz, /root/.cache/hippunfold/trained_model.3d_fullres.Task101_hcp1200_T1w.nnUNetTrainerV2.model_best.tar
    output: work/sub-02/anat/sub-02_hemi-Lflip_space-corobl_desc-nnunet_dseg.nii.gz
    log: logs/sub-02/sub-02_hemi-Lflip_space-corobl_nnunet.txt (check log file(s) for error details)
    shell:
        mkdir -p tempmodel tempimg templbl && cp work/sub-02/anat/sub-02_hemi-Lflip_space-corobl_desc-preproc_T1w.nii.gz tempimg/temp_0000.nii.gz && tar -xf /root/.cache/hippunfold/trained_model.3d_fullres.Task101_hcp1200_T1w.nnUNetTrainerV2.model_best.tar -C tempmodel && export RESULTS_FOLDER=tempmodel && export nnUNet_n_proc_DA=16 && nnUNet_predict -i tempimg -o templbl -t Task101_hcp1200_T1w -chk model_best -tr nnUNetTrainerV2 --disable_tta &> logs/sub-02/sub-02_hemi-Lflip_space-corobl_nnunet.txt && cp templbl/temp.nii.gz work/sub-02/anat/sub-02_hemi-Lflip_space-corobl_desc-nnunet_dseg.nii.gz
        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: .snakemake/log/2024-05-28T135729.251009.snakemake.log

Any advice would be appreciated!

@imolax imolax changed the title UID Issue UID Issue on Linux May 28, 2024
@akhanf
Copy link
Member

akhanf commented May 28, 2024

Ah looks like a weird root+docker issue:
https://superuser.com/questions/1435437/how-to-get-around-this-error-when-untarring-an-archive-tar-cannot-change-owner

But it looks like there is a fix with a tar option (--no-same-owner), and apparently tar options can be set with env vars, so this should hopefully resolve the problem:

docker run -it --rm -e TAR_OPTIONS='--no-same-owner'  -v /data/BILCOR/BIDS:/bids -v /data/BILCOR/BIDS/derivatives/hippunfold:/output khanlab/hippunfold:latest /bids /output participant --participant-label 02 --modality T1w -p --cores all```

@imolax
Copy link
Author

imolax commented May 28, 2024

Thank you so much! It's running now.

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

2 participants