docker-images icon indicating copy to clipboard operation
docker-images copied to clipboard

unable to run the 12213 domain permission error

Open beide opened this issue 7 years ago • 9 comments

I am getting this error on OCI with opc as an user. Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

domain_name : [base_domain] admin name : [AdminServer] admin_port : [7001] cluster_name : [DockerCluster] domain_path : [/u01/oracle/user_projects/domains/base_domain] production_mode : [dev] com.oracle.cie.domain.script.ScriptException: 60308: Domain location not writable. 60308: The domain location does not have write permission. 60308: Correct permissions or select different domain location.....

I have checked that opc is 1000:1000 but still did not work. There is the command I am trying to run docker run -d --name wlsadmin --hostname wlsadmin -p 7001:7001 --env-file ./container-scripts/domain.properties -e ADMIN_PASSWORD=<admin_password> -v /home/opc:/u01/oracle/user_projects 12213-domain

beide avatar Dec 13 '18 14:12 beide

@beide if /home/opc has the correct write permissions it should work. You can try running the sample 12213-domain-home-in-image where instead of writing the domain home to a volume like in 12213-domain the domain home gets written to the image.

mriccell avatar Jan 09 '19 00:01 mriccell

I am facing the same issue and I did check the UID and GID for the user on the host. Any alternatives as in prod we will have to mounting Volumes anyways.

--Using Vagrant.

com.oracle.cie.domain.script.ScriptException: 60308: Domain location not writable. 60308: The domain location does not have write permission. 60308: Correct permissions or select different domain location. Error: runCmd() failed. Do dumpStack() to see details.

Even given 777 on the volume mount specified directory ($PWD) does not help ....

chayzgithub avatar Jan 11 '19 14:01 chayzgithub

@beide I assume the folder /home/opc doesn't have a subfolder named domains before docker run. If there are subfolders, you need to make sure all the subfolders have the right permission.

lilyhe123 avatar Jan 22 '19 07:01 lilyhe123

@lilyhe123 - you are right ! user_project does not have a subdirectory domain . What to do to get the above issue resolved ?

giriarnab avatar Mar 25 '19 04:03 giriarnab

@giriarnab can you describe your steps in detail how you got the error? The subfolder of user_project supposed to be created to the PV the first time the container is running.

lilyhe123 avatar Mar 25 '19 08:03 lilyhe123

@lilyhe123 I have docker toolbox installed in my local machine and performed the below steps

  1. Pulled the docker images from https://github.com/oracle/docker-images
  • referred to all the scripts in the above project for performing below steps.
  1. downloaded JRE https://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html
  2. Build JRE 8 docker image
  3. downloaded WL 12c quick installer https://www.oracle.com/technetwork/middleware/fusion-middleware/downloads/index.html
  4. Build WL 12 c (12.2.1.3) docker image. (docker-images\OracleWebLogic\dockerfiles) ./buildDockerImage.sh -v 12.2.1.3 -d 6.Build WL Domain image (docker-images\OracleWebLogic\samples\12213-domain) . ./build.sh
  5. Run the container docker run -d --name wlsadmin --hostname wlsadmin -p 7001:7001 --env-file ./container-scripts/domain.properties -e ADMIN_PASSWORD=xxx 12213-domain

Let me know if you need any further details. Thanks in advance .

giriarnab avatar Mar 27 '19 03:03 giriarnab

@giriarnab Just find out there is a bug in the Dockerfile when creating the DOMAIN_HOME it doesn't set the folder permission correctly. It may take a while to get the fix check in. Before that you can apply the fix manually.

$ git diff Dockerfile
diff --git a/OracleWebLogic/samples/12213-domain/Dockerfile b/OracleWebLogic/samples/12213-domain/Dockerfile
index 3de2267..587270a 100644
--- a/OracleWebLogic/samples/12213-domain/Dockerfile
+++ b/OracleWebLogic/samples/12213-domain/Dockerfile
@@ -18,7 +18,6 @@
 # Pull base image
 # ---------------
 FROM  oracle/weblogic:12.2.1.3-developer
-
 # Maintainer
 # ----------
 MAINTAINER Monica Riccelli <[email protected]>
@@ -60,9 +59,8 @@ RUN chmod +xw /u01/oracle/*.sh && \
     chmod +xw /u01/oracle/*.py && \
     mkdir -p $PRE_DOMAIN_HOME && \
     chown -R oracle:oracle $PRE_DOMAIN_HOME && \
-    chmod -R a+xwr $PRE_DOMAIN_HOME && \ 
     mkdir -p $DOMAIN_HOME && \ 
-    chmod -R a+xwr $DOMAIN_HOME
+    chmod -R a+xwr $PRE_DOMAIN_HOME 
 
 
 VOLUME $PRE_DOMAIN_HOME

After apply the change, you need to rerun your above step 5 and 6.

But if you mount a volume in docker run of step 6, it should work without any fix.

docker run -d --name wlsadmin --hostname wlsadmin -p 7001:7001 --env-file ./container-scripts/domain.properties -e ADMIN_PASSWORD=xxx -v <localFolder>:/u01/oracle/user_projects 12213-domain 

The owner of the 'localFolder' should be '1000:1000' or its mod should be '777'.

lilyhe123 avatar Mar 28 '19 02:03 lilyhe123

@lilyhe123 Thanks ! It worked :)

But now I tried to create a managed server using the below command

$ docker run -d --name MS1 --link wlsadmin:wlsadmin -p 8001:8001 --env-file ./container-scripts/domain.properties -e ADMIN_PASSWORD=<admin_password> -e MS_NAME=MS1 --volumes-from wlsadmin 12213-domain createServer.sh

I see the container running in docker , but when I go into the console I don't see the managed server.

giriarnab avatar Mar 30 '19 20:03 giriarnab

I got the problem too

[root@localhost 12213-domain]# docker logs -f 24
Domain Home is:  /u01/oracle/user_projects/domains/base_domain
Domain Name is:  base_domain
      ----> 'weblogic' admin password: 88888888

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

domain_name     : [base_domain]
admin name      : [AdminServer]
admin_port      : [7001]
cluster_name    : [DockerCluster]
domain_path     : [/u01/oracle/user_projects/domains/base_domain]
production_mode : [dev]
com.oracle.cie.domain.script.ScriptException: 60308: Domain location not writable.
60308: The domain location does not have write permission.
60308: Correct permissions or select different domain location.

        at com.oracle.cie.domain.script.ScriptExecutor.writeDomain(ScriptExecutor.java:2035)
        at com.oracle.cie.domain.script.jython.WLScriptContext.writeDomain(WLScriptContext.java:1793)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.oracle.cie.domain.script.jython.WLSTState.processCommand(WLSTState.java:225)
        at com.oracle.cie.domain.script.jython.WLScriptContext.runCmd(WLScriptContext.java:729)
        at sun.reflect.GeneratedMethodAccessor118.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.python.core.PyReflectedFunction.__call__(Unknown Source)
        at org.python.core.PyMethod.__call__(Unknown Source)
        at org.python.core.PyObject.__call__(Unknown Source)
        at org.python.core.PyInstance.invoke(Unknown Source)
        at org.python.pycode._pyx5.command$1(/tmp/WLSTOfflineIni8787777146687382784.py:19)
        at org.python.pycode._pyx5.call_function(/tmp/WLSTOfflineIni8787777146687382784.py)
        at org.python.core.PyTableCode.call(Unknown Source)
        at org.python.core.PyTableCode.call(Unknown Source)
        at org.python.core.PyTableCode.call(Unknown Source)
        at org.python.core.PyFunction.__call__(Unknown Source)
        at org.python.pycode._pyx5.writeDomain$26(/tmp/WLSTOfflineIni8787777146687382784.py:107)
        at org.python.pycode._pyx5.call_function(/tmp/WLSTOfflineIni8787777146687382784.py)
        at org.python.core.PyTableCode.call(Unknown Source)
        at org.python.core.PyTableCode.call(Unknown Source)
        at org.python.core.PyFunction.__call__(Unknown Source)
▽       at org.python.pycode._pyx36.f$0(/u01/oracle/create-wls-domain.py:82)
        at org.python.pycode._pyx36.call_function(/u01/oracle/create-wls-domain.py)
        at org.python.core.PyTableCode.call(Unknown Source)
        at org.python.core.PyCode.call(Unknown Source)
        at org.python.core.Py.runCode(Py.java:1226)
        at org.python.util.PythonInterpreter.execfile(Unknown Source)
        at weblogic.management.scripting.WLST.main(WLST.java:186)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at weblogic.WLST.main(WLST.java:47)
Problem invoking WLST - Traceback (innermost last):
  File "/u01/oracle/create-wls-domain.py", line 82, in ?
  File "/tmp/WLSTOfflineIni8787777146687382784.py", line 107, in writeDomain
  File "/tmp/WLSTOfflineIni8787777146687382784.py", line 19, in command
60308: Domain location not writable.
60308: The domain location does not have write permission.
60308: Correct permissions or select different domain location.

        at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:69)
        at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:2983)
        at com.oracle.cie.domain.script.jython.WLScriptContext.runCmd(WLScriptContext.java:735)
        at sun.reflect.GeneratedMethodAccessor118.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)

com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.jython.WLSTException: Error writing domain:
60308: Domain location not writable.
60308: The domain location does not have write permission.
60308: Correct permissions or select different domain location.


Error: runCmd() failed. Do dumpStack() to see details.
mkdir: cannot create directory '/u01/oracle/user_projects/domains': Permission denied
/u01/oracle/createAndStartWLSDomain.sh: line 47: /u01/oracle/user_projects/domains/base_domain/servers/AdminServer/security/boot.properties: No such file or directory
/u01/oracle/createAndStartWLSDomain.sh: line 48: /u01/oracle/user_projects/domains/base_domain/servers/AdminServer/security/boot.properties: No such file or directory
/u01/oracle/createAndStartWLSDomain.sh: line 49: /u01/oracle/user_projects/domains/base_domain/bin/setDomainEnv.sh: No such file or directory
/u01/oracle/createAndStartWLSDomain.sh: line 54: /u01/oracle/user_projects/domains/base_domain/startWebLogic.sh: No such file or directory
touch: cannot touch '/u01/oracle/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log': No such file or directory
tail: cannot open '/u01/oracle/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log' for reading: No such file or directory
tail: no files remaining

resolve it use the follow way

i run the follow command

docker run -d --name wlsadmin --hostname wlsadmin -p 7002:7001 \
	--env-file ./container-scripts/domain.properties -e ADMIN_PASSWORD=88888888 \
	-v /data/weblogic:/u01/oracle/user_projects \
	12213-domain

at your hosts

[root@localhost ~]# chown -R 1000:1000 /data/weblogic
[root@localhost ~]# ll /data/
total 0
drwxr-xr-x 3 weblogic weblogic  46 Apr 18 17:50 weblogic
[root@localhost ~]# ll /data/weblogic
total 4
-rw-r--r-- 1 weblogic weblogic 34 Apr 18 12:51 domain.properties
drwxr-xr-x 3 weblogic weblogic 25 Apr 18 17:50 domains

weironz avatar Apr 18 '19 09:04 weironz