nf-core / nf-core/tools

nf-core tools in docker is broken

Open
#1,911 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
322
Forks
255
Avg merge
2d 3h
Merged PRs (30d)
5

Description

Description of the bug

Tools does not handle failure to create .config directory as it should. Lacking a proper $HOME it will default to / and try to create /.config

Command used and terminal output
pontus@atra:~$ docker run -itv `pwd`:`pwd` -w `pwd` -u $(id -u):$(id -g) nfcore/tools
Traceback (most recent call last):
  File "/usr/local/bin/nf-core", line 5, in <module>
    from nf_core.__main__ import run_nf_core
  File "/usr/local/lib/python3.8/site-packages/nf_core/__main__.py", line 31, in <module>
    nf_core.utils.setup_nfcore_dir()
  File "/usr/local/lib/python3.8/site-packages/nf_core/utils.py", line 310, in setup_nfcore_dir
    os.makedirs(NFCORE_DIR)
  File "/usr/local/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/local/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/.config'
pontus@atra:~$
System information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in nf_core/utils.py at setup_nfcore_dir(), identified in the traceback, and reproduce the provided docker run command with the shown user and missing HOME. Trace how NFCORE_DIR is derived and how directory-creation failures are handled. Done means the container no longer attempts an unauthorized /.config path and the behavior is covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
cli, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.