Skip to content

run PCGR as non-root user fails at quarto #246

@HomoPolyethylen

Description

@HomoPolyethylen

Whenever you encounter an error, please also include:

  • Version of PCGR.
  • Genome build (grch37/grch38).
  • the complete command you used to invoke pcgr (including all explicit options)
  • the full error message

running the pcgr v2.0.1 docker container on the example vcf file T001-BRCA.grch37.vcf.gz with assembly GRCh37 fails, if the container is run as the executing user (providing -u $(id -u):$(id -g) to the docker command. If I leave out the -u option, pcgr runs through smoothly.
quarto seems to need root-permissions

command

I first started the docker container in interactive mode

docker run -it --rm \
    -v /home-link/zxmgc83/tools/pcgr/examples:/mnt/data \
    -v /home-link/zxmgc83/tools/pcgr/refbundle/20240621:/mnt/refdata \
    -v /home-link/zxmgc83/.vep:/mnt/vep \
    -v /home-link/zxmgc83/runs/pcgr/pcgr2/results:/mnt/output \
    -u $(id -u):$(id -g)        # remove this line and pcgr/quarto runs through
    sigven/pcgr:2.0.1

and then executed pcgr

pcgr \
		--input_vcf         /mnt/data/tumor_sample.BRCA.vcf.gz \
		--refdata_dir       /mnt/refdata \
		--vep_dir           /mnt/vep \
		--output_dir        /mnt/output \
		--genome_assembly   grch37 \
		--sample_id         pcgr-test-sample \
		--assay             TARGETED \
		--tumor_site        8

error message

2024-06-30 10:51:58 - pcgr-writer - INFO - PCGR - STEP 6: Generation of output files - molecular interpretation report for precision cancer medicine
2024-06-30 10:51:59 - pcgr-report-generation - INFO - Successfully parsed YAML configuration file - reporting mode: PCGR
2024-06-30 10:51:59 - pcgr-report-generation - INFO - Loading reference datasets - genome assembly: grch37
2024-06-30 10:52:25 - pcgr-report-generation - INFO - ------
2024-06-30 10:52:25 - pcgr-report-generation - INFO - Reading annotated molecular dataset (DNA) - somatic SNV/InDels
2024-06-30 10:52:26 - pcgr-report-generation - INFO - Assigning variants to tiers of clinical significance - somatic actionability guidelines (ACMG/AMP)
2024-06-30 10:52:26 - pcgr-report-generation - INFO - Generating data frame with hyperlinked variant/gene annotations
2024-06-30 10:52:27 - pcgr-report-generation - INFO - ------
2024-06-30 10:52:27 - pcgr-report-generation - INFO - Generating quarto-based interactive HTML report (.html) with variant findings
[0m[1m[31merror[0m: Uncaught PermissionDenied: Permission denied (os error 13): mkdir '/.cache/quarto'
        Deno.mkdirSync(dir, {
[0m[31m             ^[0m
    at [0m[1m[3mObject.mkdirSync[0m ([0m[36mext:deno_fs/30_fs.js[0m:[0m[33m132[0m:[0m[33m7[0m)
    at [0m[1m[3mensureDirSync[0m ([0m[36mfile:///opt/mambaforge/envs/pcgrr/bin/quarto.js[0m:[0m[33m9288[0m:[0m[33m14[0m)
    at [0m[1m[3mquartoDir[0m ([0m[36mfile:///opt/mambaforge/envs/pcgrr/bin/quarto.js[0m:[0m[33m33006[0m:[0m[33m5[0m)
    at [0m[1m[3mquartoCacheDir[0m ([0m[36mfile:///opt/mambaforge/envs/pcgrr/bin/quarto.js[0m:[0m[33m32998[0m:[0m[33m12[0m)
    at [0m[36mfile:///opt/mambaforge/envs/pcgrr/bin/quarto.js[0m:[0m[33m39501[0m:[0m[33m25[0m
Error in `quarto::quarto_render()`:
✖ Error running quarto cli.
ℹ Rerun with `quiet = FALSE` to see the full error message.
Caused by error:
! System command 'quarto' failed
Backtrace:
    ▆
 1. └─pcgrr::write_report_quarto_html(report = pcg_report)
 2.   └─quarto::quarto_render(...)
 3.     └─quarto:::quarto_run(args, echo = TRUE, quarto_bin = quarto_bin)
 4.       └─base::tryCatch(...)
 5.         └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 6.           └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 7.             └─value[[3L]](cond)
 8.               └─cli::cli_abort(msg, call = .call, parent = e)
 9.                 └─rlang::abort(...)

Additional context

I could replicate this issue with other samples. I am not sure whether execution as non-root is intended or not and hence if this is a bug or a feature request.

running on Linux 5.14.0

I want to run pcgr on a server, where I do not have root-privileges.
If I run docker without -u, the pcgr output files are written by root and I hence cannot remove them.
If I run docker with -u, the user witin the container does not have the rights to create a directory in the root dir (mkdir /.cache/quarto)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions