View Issue Details

IDProjectCategoryView StatusLast Update
0003567OpenFOAMBugpublic2020-11-17 11:33
Reporterskwde Assigned Towyldckat  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionunable to reproduce 
PlatformUnixOSOtherOS Version(please specify)
Summary0003567: cannot create $FOAM_RUN direcotry in docker container
DescriptionI am on a fresh centos7.7 Virtual Machine with linux kernel 3.10.0-1127.19.1.el7.x86_64.
I installed docker from the docker repository.

I follow the instructions, e.g. on https://openfoam.org/download/6-linux/

The container starts fine but I cannot do step 6:
mkdir -p $FOAM_RUN

It always triggers
mkdir: cannot create directory '/home/openfoam/run': Permission denied
Note, it doesn't matter if i start openfoam6-linux as root or my standard user.
I have the same issue with openfoam7-linux and openfoam8-linux.
TagsNo tags attached.

Activities

wyldckat

2020-10-14 13:34

updater   ~0011594

I haven't tested on CentOS 7.7, but have tested it on Ubuntu 20.04. My guess is that there is an issues associated to SELinux, for which instructions are provided here: https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label

@skwde: Please edit the file "/usr/bin/openfoam8-linux" (or similar) and find this line near the end:

    -v $MOUNT_DIR:$HOME_DIR \

Then change it to this:

    -v $MOUNT_DIR:$HOME_DIR:z \

skwde

2020-10-14 13:54

reporter   ~0011595

@wyldckat Thanks for your reply. Unfortunately this didn't solve the issue.

I also tried to temporarily disable selinux (via setenforce 0), but I still face the same issue.
Any other ideas?

wyldckat

2020-10-14 15:24

updater   ~0011598

Without having to install CentOS 7.7 on a VM myself, more details are needed... the first few that come to mind are:

1. Knowing what the following command gives you when inside the container (when you run the launching script):

    ls -ld $HOME
    echo $USER

2. Seeing what you see when the container finishes starting up... it should give additional error/warning messages.

skwde

2020-10-14 15:41

reporter   ~0011599

Below the output you asked for. Notebly $USER is not set.
export USER=openfoam does not solve the issue.
id reveals that the centos uid and gid are correctly matched to the openfoam user / group.

Besides, startup does not show any errors.

1.
OpenFOAM-6(1) ls -ld $HOME
drwxr-xr-x. 2 openfoam openfoam 2048 Oct 9 08:18 /home/openfoam
OpenFOAM-6(2) echo $USER

OpenFOAM-6(3)

2.
$ openfoam6-linux
Launching /usr/bin/openfoam6-linux
User: "<MY CENTOS USER>" (ID <MY CENTOS UID>, group ID <MY CENTOS GID>)
Welcome to the OpenFOAM v6 Docker Image

Provides bash terminal with OpenFOAM 6 and ParaView 5.6.0

Produced and maintained by CFD Direct (https://cfd.direct), on behalf of the
OpenFOAM Foundation (https://openfoam.org), the owner and distributor of
OpenFOAM as free, open source software under the General Public Licence v3.

Further Resources:
* OpenFOAM User Guide: https://cfd.direct/openfoam/user-guide
* C++ Source Guide: https://cpp.openfoam.org
* OpenFOAM Training: https://cfd.direct/openfoam-training
* Running in the Cloud: https://cfd.direct/cloud
* Issue (Bug) Reporting: https://bugs.openfoam.org
* Subscribe to Newsletter: https://cfd.direct/news
* Contributors to OpenFOAM: https://openfoam.org/dev/contributors

OpenFOAM-6(1)

wyldckat

2020-10-14 15:57

updater   ~0011600

It's not clear from this... without a noticeable detail, it's nearly impossible to diagnose the issue without trying it myself...

The best I can do at the moment is to point you to step-by-step building instructions, provided by the community for OpenFOAM 6 + CentOS 7.5: https://openfoamwiki.net/index.php/Installation/Linux/OpenFOAM-6/CentOS_SL_RHEL#CentOS_7.5_.281804.29

This issue seems to be related to Docker and CentOS, which mostly falls outside of the OpenFOAM Foundation issue tracker's objectives. Mounting the path of a host's user folder within the Docker seems the main issue.

- Either it's being signalled in the "/var/log/audit/*" files...
- Or in some of Docker's own log files...

skwde

2020-10-14 16:05

reporter   ~0011601

Alright, thanks a lot for your help anyhow.

wyldckat

2020-11-17 11:33

updater   ~0011688

I've finished just now testing this on a VM with CentOS 7 as well and was unable to reproduce this issue. Tested with both OpenFOAM 6 and 8, following the official instructions, e.g. from here: https://openfoam.org/download/8-linux/

My guess is that the missing step was the very last sentence of step #3, namely:

    The user must log out and log in of their account for the change to take effect.

Closing this issue as "unable to reproduce".

Issue History

Date Modified Username Field Change
2020-10-09 11:49 skwde New Issue
2020-10-14 13:34 wyldckat Note Added: 0011594
2020-10-14 13:54 skwde Note Added: 0011595
2020-10-14 15:24 wyldckat Note Added: 0011598
2020-10-14 15:41 skwde Note Added: 0011599
2020-10-14 15:57 wyldckat Note Added: 0011600
2020-10-14 16:05 skwde Note Added: 0011601
2020-11-17 11:33 wyldckat Assigned To => wyldckat
2020-11-17 11:33 wyldckat Status new => closed
2020-11-17 11:33 wyldckat Resolution open => unable to reproduce
2020-11-17 11:33 wyldckat Note Added: 0011688