NCAR / container-dtc-nwp

End-to-end NWP systems in containers.
https://dtcenter.org/community-code/numerical-weather-prediction-nwp-containers
28 stars 13 forks source link

Permission denied issues #17

Closed vrlt closed 4 years ago

vrlt commented 4 years ago

Hello, I have installed docker as root and built the images of dtc as root. When running the run-dtc-nwp-sandy container as:

docker run --rm -it --volumes-from wps_geog --volumes-from ${CASE_NAME} \ -v ${PROJ_DIR}/container-dtc-nwp/components/scripts/common:/home/scripts/common \ -v ${CASE_DIR}/wrfprd:/home/wrfprd -v ${CASE_DIR}/wpsprd:/home/wpsprd \ -v ${PROJ_DIR}/container-dtc-nwp/components/scripts/${CASENAME}${CASE_DATE}:/home/scripts/case \ --name run-dtc-nwp-${CASE_NAME} dtc-wps_wrf /home/scripts/common/run_wps.ksh

I get permission denied: Running WPS

Also when stating and getting inside the container, where in my host I am the root: docker run -it dtc-wps_wrf /bin/bash

I get this output:

Starting with UID : 9999 bash: /root/.bashrc: Permission denied (not comuser as expected)

Could you please guide me?

mkavulich commented 4 years ago

I notice your docker run command is for an older version of the tutorial; we made some updates last year to fix file permissions issues on certain platforms. Try the run commands listed in this version of the tutorial: https://dtcenter.org/tutorial-version-3/hurricane-sandy-case-27-oct-2012/run-nwp-initialization-components

The Permission denied error is a quirk of the entrypoint script we are using, but should be harmless and unrelated to any other problems you are seeing.

vrlt commented 4 years ago

Thank you for your reply, I have tried the newest version of commands:

docker run --rm -it -e LOCAL_USER_ID=id -u $USER --volumes-from wps_geog --volumes-from sandy \ -v ${PROJ_DIR}/container-dtc-nwp/components/scripts/common:/home/scripts/common \ -v ${PROJ_DIR}/container-dtc-nwp/components/scripts/sandy_20121027:/home/scripts/case \ -v ${CASE_DIR}/wpsprd:/home/wpsprd --name run-sandy-wps dtcenter/wps_wrf /home/scripts/common/run_wps.ksh

It seems that when logging with su as root in centos, the $USER command pointed to my user id, not root. So by replacing $USER with root, solved my problem.

Thank you for your help.