cloud-native-oracle icon indicating copy to clipboard operation
cloud-native-oracle copied to clipboard

Loads of permission issues when trying to start the image

Open Impakt opened this issue 1 year ago • 8 comments

Hello, I followed the documentation and was able to build 19.19 on my macbook, but I can't get it to start regardless whether i use compose or not

compose:

services:
  oracle-arm:
    container_name: oracle-arm
    build:
      context: .
      dockerfile: dockerfiles/oracle-arm.Dockerfile # this just has a FROM line that points to the image i built
    ports:
      - 1521:1521 # oracle
      - 8080:8080 # web ui
    volumes:
      - ./data/oracle/oradata:/u02/app/oracle/oradata \
      - ./data/oracle/diag:/u01/app/oracle/diag \
      - ./data/oracle/audit:/u01/app/oracle/admin \
      - ./data/oracle/reco:/u03/app/oracle \
      - ./data/oracle/scripts:/scripts \

All of the directories are empty and even have 777 pernissions. Startup logs:

2024-05-09 15:10:27 [FATAL] [DBT-06006] Unable to create directory: (/u02/app/oracle/oradata/test/).
2024-05-09 15:10:27    CAUSE: Proper permissions are not granted to create the directory or there is no space left in the volume.
2024-05-09 15:10:27 [FATAL] [DBT-06006] Unable to create directory: (/u03/app/oracle).
2024-05-09 15:10:27    CAUSE: Proper permissions are not granted to create the directory or there is no space left in the volume.
2024-05-09 15:10:28 alter pluggable database all open
2024-05-09 15:10:28 *
2024-05-09 15:10:28 ERROR at line 1:
2024-05-09 15:10:28 ORA-01034: ORACLE not available
2024-05-09 15:10:28 Process ID: 0
2024-05-09 15:10:28 Session ID: 0 Serial number: 0
2024-05-09 15:10:28 
2024-05-09 15:10:28 
2024-05-09 15:10:28 alter pluggable database all save state
2024-05-09 15:10:28 *
2024-05-09 15:10:28 ERROR at line 1:
2024-05-09 15:10:28 ORA-01034: ORACLE not available
2024-05-09 15:10:28 Process ID: 0
2024-05-09 15:10:28 Session ID: 0 Serial number: 0
2024-05-09 15:10:28 
2024-05-09 15:10:28 
2024-05-09 15:10:28 
2024-05-09 15:10:28 # ----------------------------------------------------------------------------------------------- #
2024-05-09 15:10:28   runDBCA: DBCA complete at 2024-05-09 05:10:28
2024-05-09 15:10:28 # ----------------------------------------------------------------------------------------------- #
2024-05-09 15:10:29 ERROR: Cannot locate /home/oracle/bin/sqlplus
2024-05-09 15:10:29 Exiting...
2024-05-09 15:10:29 WARNING: Database setup for test was unsuccessful.
2024-05-09 15:10:29 WARNING: Check log output for additional information.
2024-05-09 15:10:29 
2024-05-09 15:10:29 # ----------------------------------------------------------------------------------------------- #
2024-05-09 15:10:29   Tailing alert_test.log: 
2024-05-09 15:10:26 mkdir: cannot create directory '/u03/app/oracle/fast_recovery_area': Permission denied
2024-05-09 15:10:27 cat: /u01/app/oracle/cfgtoollogs/dbca/test/test.log: No such file or directory
2024-05-09 15:10:27 cat: /u01/app/oracle/cfgtoollogs/dbca/test.log: No such file or directory
2024-05-09 15:10:27 cat: /u01/app/oracle/cfgtoollogs/dbca/test/testPDB1/test.log: No such file or directory
2024-05-09 15:10:28 mkdir: cannot create directory '/u02/app/oracle/oradata/dbconfig': Permission denied
2024-05-09 15:10:29 /opt/scripts/manageOracle.sh: line 934: /home/oracle/bin/sqlplus: No such file or directory
2024-05-09 15:10:29 tail: cannot open '/u01/app/oracle/diag/rdbms/*/*/trace/alert*.log' for reading: No such file or directory
2024-05-09 15:10:29 tail: no files remaining

Any help would be greatly appreciated, and happy to help test to get it working.

Impakt avatar May 09 '24 05:05 Impakt

Try using absolute paths for the volumes.

oraclesean avatar May 09 '24 05:05 oraclesean

same issue i'm afraid.

I changed the manageOracle.sh script where the fast_recovery_area dir is created to this:

            ls -l /u03/app/
            ls -l ${RECO}
            mkdir -p "${RECO}/fast_recovery_area/${ORACLE_SID}" || error "Could not create the FRA directory for ${ORACLE_SID}"

And when that part of the script is executed, this is the output:

oracle-arm  | drwxr-xr-x 2 root root 4096 May  9 06:09 oracle
oracle-arm  | drwxr-xr-x 2 root root   64 May  9 06:10 oracle \
oracle-arm  | total 0
oracle-arm  | mkdir: cannot create directory '/u03/app/oracle/fast_recovery_area': Permission denied
oracle-arm  | ERROR: Could not create the FRA directory for ORCLCDB

Impakt avatar May 09 '24 06:05 Impakt

That error is saying that the path in the container can't be created. Since it's referencing a volume on the host, it needs (first) an absolute path (container ecosystems don't do relative paths) and correct permissions on the local volume.

./data/oracle/oradata is not an acceptable path for mapping to the local host. Relative paths could change based on the user's current directory at runtime, and multiple calls to docker [run|compose] from different directories would produce inconsistent results. Dot notation and tilde references are not allowed.

Change the local path used for mounting the volumes to something like:

/home/myuser/data/oracle/oradata

oraclesean avatar May 09 '24 06:05 oraclesean

rookie error on my part. I had the trailing slash in my compose file (look at the volumes) because i copied/pasted your docker command in the readme and pasted it to my compose file but forgot to remove them. Now im trying to get the image to run my scripts to populate the database like this one. Sorry for wasting your time

Impakt avatar May 09 '24 06:05 Impakt

I have the same issues any suggest?

ovgu12 avatar Feb 05 '25 22:02 ovgu12

@ovgu12 sure! Will you please share some details? It would help if you could send the command(s) you're running, the output it generates, any errors, and the output of docker info. Thanks!

oraclesean avatar Feb 06 '25 13:02 oraclesean

@oraclesean Thanks for reply! I managed to fix the issues and it works in MAC again.

ovgu12 avatar Feb 15 '25 17:02 ovgu12

@ovgu12 excellent! Do you mind sharing the issue/fix?

oraclesean avatar Feb 19 '25 17:02 oraclesean