MaksymBilenko / docker-oracle-12c

:whale: Docker image with Oracle Database 12c on board
Apache License 2.0
680 stars 285 forks source link

Error starting container with a mapped volume #116

Closed tberne closed 4 years ago

tberne commented 6 years ago

Hi. I'm trying to start a container in a Linux box. It fails in both, docker and docker-compose.

Here's my compose configuration:

  db_oracle:
    image: sath89/oracle-12c
    ports:
    - 127.0.0.1:1521:1521
    - 127.0.0.1:18080:8080
    volumes:
    - /home/yoda/Documentos/lumis/env/oracle/data:/u01/app/oracle
    environment:
    - DBCA_TOTAL_MEMORY=3072

Here's the container output:

Database not initialized. Initializing database.
mv: failed to access '/u01/app/oracle/dbs': Too many levels of symbolic links
Starting tnslsnr
Cannot create directory "/u01/app/oracle/cfgtoollogs/dbca".

Unique database identifier check passed.
Error writing into silent log -- /u01/app/oracle/cfgtoollogs/dbca/silent.log_2018-09-11_02-14-36-PM (No such file or directory)

/u01/app/oracle/ has enough space. Required space is 6140 MB , available space is 32944 MB.
File Validations Successful.
Error writing into silent log -- /u01/app/oracle/cfgtoollogs/dbca/silent.log_2018-09-11_02-14-36-PM (No such file or directory)
Cannot create directory "/u01/app/oracle/cfgtoollogs/dbca/xe".
Error writing into silent log -- /u01/app/oracle/cfgtoollogs/dbca/silent.log_2018-09-11_02-14-36-PM (No such file or directory)
Error in file copy from </u01/app/oracle/cfgtoollogs/dbca/silent.log_2018-09-11_02-14-36-PM> to </u01/app/oracle/cfgtoollogs/dbca/xe.log>
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/silent.log_2018-09-11_02-14-36-PM" for further details.

When removing the volume mapping, the container starts well.

jozsefmorrissey commented 5 years ago

I ran into the same problem. Not sure what caused it, probably prematurely exiting container. However, it can be fixed in two ways.

Easy: Deleting the contents of the shared volume from your file system: rm -r -f /local/comupter/volume/*

A little harder: Start docker container with docker run -p 8080:8080 -p 1521:1521 -v /local/comupter/volume/:/container/volumn/ -ti sath89/oracle-12c bash Repair entrypoint.sh sed -i "s/mv \(\/u01\/app\/oracle-product\/12.1.0\/xe\/dbs \/u01\/app\/oracle\/dbs\)/cp -r \1/" /entrypoint.sh Run entrypoint.sh /entrypoint.sh

Hopefully the owner will make a perminate fix soon: Its in entypoint.sh at line 73

MaksymBilenko commented 5 years ago

Looks like database corruption due to hard stop.

MaksymBilenko commented 5 years ago

@jozsefmorrissey Now sure what kind of fix you are looking for. If you have any suggestion you are welcome to create PR with detailed explanation

tberne commented 5 years ago
      Looks like database corruption due to hard stop.

Actually, it was the very first time the container has been started. So, I don't believe it is something like database corruption due to hard stop, since there was no stop at all.

MaksymBilenko commented 5 years ago

Volumes from host might have issues. Try to use docker volumes (non hostPath) like -v oracle12_data:/u01/app/oracle

tberne commented 5 years ago

@MaksymBilenko, I'll try that later and post the results here.

orzeh commented 5 years ago

Using docker volumes in my docker-compose.yml solved this issue.

siegfriedhuber commented 5 years ago

I could solve the issue with Cannot create directory and Error writing into silent log - by chmod -R a+w /home/user1/oracle12-data This is the directory I used when running the docker docker run -p 8080:8080 -p 1521:1521 -v /home/user1/oracle12-data:/u01/app/oracle -d sath89/oracle-12c:latest

cn-sy-yl commented 4 years ago

I could solve the issue with Cannot create directory and Error writing into silent log - by chmod -R a+w /home/user1/oracle12-data This is the directory I used when running the docker docker run -p 8080:8080 -p 1521:1521 -v /home/user1/oracle12-data:/u01/app/oracle -d sath89/oracle-12c:latest

i try this,its helpful