ERROR: ORA-12547: TNS:lost contact
So I have cloned this repo and built the oracle/database:12.2.0.1-ee image locally. Everything worked fine.
Now I am trying to run this built image with the following docker-compose file:
oracle:
image: oracle/database:12.2.0.1-ee
container_name: oracle
volumes:
- oracle:/opt/oracle/oradata # persistent oracle database data.
ports:
- 1521:1521
- 8080:8080
- 5500:5500
volumes:
oracle:
name: oracle
In the docker-compose file I am doing nothing special, just the standard stuff I saw in the sample docker-compose file in this repo. The only difference is that I am using a named value to get over the permissions issues that I've seen on the issues board. However, that being said, when I run the docker-compose file with docker-compose up, I receive the below.
ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: qLAVE9zSuQw=1
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 14-AUG-2020 22:59:35
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Starting /opt/oracle/product/12.2.0.1/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /opt/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/e7bde90b6c02/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 14-AUG-2020 22:59:35
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/e7bde90b6c02/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
[WARNING] [DBT-11209] Current available physical memory is less than the required physical memory (2,048MB) for creating the database.
[WARNING] [DBT-10102] The listener configuration is not selected for the database. EM DB Express URL will not be accessible.
CAUSE: The database should be registered with a listener in order to access the EM DB Express URL.
ACTION: Select a listener to be registered or created with the database.
Copying database files
1% complete
2% complete
DBCA Operation failed.
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.
[ 2020-08-14 22:59:40.071 UTC ] Copying database files
DBCA_PROGRESS : 1%
[ 2020-08-14 22:59:40.263 UTC ] ORA-12547: TNS:lost contact
DBCA_PROGRESS : 2%
[ 2020-08-14 22:59:40.421 UTC ] Error while cataloging RMAN Backups
[ 2020-08-14 22:59:40.526 UTC ] DBCA_PROGRESS : DBCA Operation failed.
SQL*Plus: Release 12.2.0.1.0 Production on Fri Aug 14 22:59:40 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
ERROR:
ORA-12547: TNS:lost contact
Enter user-name: SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}] [edition=value]]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
<proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
Enter user-name: SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}] [edition=value]]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
<proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
mv: cannot stat '/opt/oracle/product/12.2.0.1/dbhome_1/dbs/spfileORCLCDB.ora': No such file or directory
mv: cannot stat '/opt/oracle/product/12.2.0.1/dbhome_1/dbs/orapwORCLCDB': No such file or directory
ORACLE_HOME = [/home/oracle] ? ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID .
You can set ORACLE_BASE manually if it is required.
Resetting ORACLE_BASE to its previous value or ORACLE_HOME
The Oracle base remains unchanged with value /opt/oracle
/opt/oracle/checkDBStatus.sh: line 26: sqlplus: command not found
#####################################
########### E R R O R ###############
DATABASE SETUP WAS NOT SUCCESSFUL!
Please check output for further info!
########### E R R O R ###############
#####################################
The following output is now a tail of the alert.log:
tail: cannot open '/opt/oracle/diag/rdbms/*/*/trace/alert*.log' for reading: No such file or directory
tail: no files remaining
FYI I have a storage driver of overlay2 (I'm running a mac using Catalina) which I've seen mentioned on a few issues, so I don't think it's that.
More information, the reason I am using this custom built image instead is because Partitioning is disabled on the pre-built image on DockerHub Store, and I just wanted to see if it was included in the image I built from this repository. However in efforts to just see if that was the case, I've spend the last few hours tackling with just getting this image to run.
I've seen across the issues that '/opt/oracle/product/12.2.0.1/dbhome_1/dbs/orapwORCLCDB': No such file or directory means that its a permissions issues however using the named volume I thought would resolve this. Open to suggestions.
This is likely your issue.
[WARNING] [DBT-11209] Current available physical memory is less than the required physical memory (2,048MB) for creating the database.
This is likely your issue.
[WARNING] [DBT-11209] Current available physical memory is less than the required physical memory (2,048MB) for creating the database.
I'm not too sure about that, if it was the reason for the failing I would expect an [ERROR] as opposed to a [WARNING]. Besides, I removed all volumes on my laptop before running the docker-compose up so I don't believe it could be a space issue.
Were you able to solve this? I have the exact same issue, fixed the memory warning but still the same.
@mcaxtr Not yet, I've retried on a different laptop and get the same errors. I just awaiting @gvenzl response as he seems to be the main source of knowledge in this area.
The database setup for some reason fails with an error:
Copying database files
1% complete
2% complete
DBCA Operation failed.
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.
Can you check the log file, please? There should also be a *.trc file in /opt/oracle/cfgtoollogs/dbca/ORCLCDB or a sub-directory that has more details, please provide both.
@gvenzl
So it's not easy to get the logs for ORCLDB.log due to the container quickly being shut down after the docker-compose up fails. However a cat returns the following:
/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log:
[oracle@f0542cc4c03c ~]$ cat /opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log
[ 2020-10-18 17:26:22.145 UTC ] Copying database files
DBCA_PROGRESS : 1%
[ 2020-10-18 17:26:22.384 UTC ] ORA-12547: TNS:lost contact
DBCA_PROGRESS : 2%
[ 2020-10-18 17:26:22.546 UTC ] Error while cataloging RMAN Backups
[ 2020-10-18 17:26:22.662 UTC ] DBCA_PROGRESS : DBCA Operation failed.
[oracle@f0542cc4c03c ~]$ cat /opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log
[ 2020-10-18 17:26:22.145 UTC ] Copying database files
DBCA_PROGRESS : 1%
[ 2020-10-18 17:26:22.384 UTC ] ORA-12547: TNS:lost contact
DBCA_PROGRESS : 2%
[ 2020-10-18 17:26:22.546 UTC ] Error while cataloging RMAN Backups
[ 2020-10-18 17:26:22.662 UTC ] DBCA_PROGRESS : DBCA Operation failed.
Additionally, when trying to find the *.trc files, when performing a ls -al /opt/oracle/cfgtoollogs/dbca/ORCLCDB/I only got the following. So no *.trc files
drwxr-x--- 2 oracle oinstall 4096 Oct 18 17:28 .
drwxr-x--- 3 oracle oinstall 4096 Oct 18 17:28 ..
-rw-r----- 1 oracle oinstall 172 Oct 18 17:28 CloneRmanRestore.log
-rw-r----- 1 oracle oinstall 293 Oct 18 17:28 ORCLCDB.log
-rw-r----- 1 oracle oinstall 2122 Oct 18 17:28 initORCLCDBTempOMF.ora
-rw-r----- 1 oracle oinstall 18726912 Oct 18 17:28 tempControl.ctl
-rw-r----- 1 oracle oinstall 862962 Oct 18 17:28 trace.log_2020-10-18_05-28-33-PM
Thanks @ChrisJBurns, can you please retrieve and post the trace.log* file (sorry, thought it ended with *.trc)? Unfortunately, the log file doesn' tell us much new.
@gvenzl
Yep, can do. It's very large the output.. not sure if you want me to hone in on a specific part of the log. I've attached a gist as it exceeds the comment character limit.
https://gist.github.com/ChrisJBurns/3dd26f04d9ae4f397b55dc18d85fc113
@ChrisJBurns I had the same issue and it was because of the memory. I had to delete the docker image and recreate it with increased memory. docker rmi oracle/database:12.2.0.1-ee
Is this still an issue?
As far as I'm aware yes. I will try again and let you know just for clarity. But I believe the same outcome with occur.
Just a note that Docker Desktop for Mac (and Windows) do weird things with the filesystem and networking due to their reliance on a hidden LinuxKit VM in which Docker is actually running.
You may have a better experience on a Mac or Windows using our Oracle Database Vagrant project instead, which leverages Vagrant to deploy Oracle Database inside an Oracle VM VirtualBox instance.
I'll give it another try with more memory as suggested above.👍🏼 I'm currently AFK until Sunday, will update here with results.
I met a similar error and turns out it is because I run as root and the mounted folder is under root permission, and the oracle user inside the container has no permission to write to the target folder. I resolve it by changing the folder owner to oracle user (uid 54321).
Faced same issue since yesterday. Eventually, downgrading Docker desktop for mac from 3.2.1 to 3.0.0 unblocked me.
Container logs showed below message
oracledb | ERROR: oracledb | ORA-12547: TNS:lost contact oracledb | ORA-12547: TNS:lost contact oracledb | LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 10-MAR-2021 16:31:14
This issue is still present for me on an M1 mac using the latest docker desktop (3.3.1). Has there been any progress on this?
@ChrisJBurns Any follow-up on this? I have the same issue, but it might be because I'm on AWS with t2.micro instance.
I've not checked in a few weeks, I'm now on a separate project. But I was always unable to get it working. I had the same error as my original description.
@ChrisJBurns I see, thank you for the response
This issue is still present for me on an M1 mac using the latest docker desktop (3.3.1). Has there been any progress on this?
almost 2 years after the issue is still present. There's no hope for fix, I guess
@Vergil333 the "TNS:lost contact" message is a generic error raised when the Database Configuration Assistant can't create the database. In the case of the OP, the relevant accompanying error was likely a lack of memory. In your case, it's probably an OS compatibility issue that requires re-engineering the build/image for Apple Silicon. The output of the DBCA log would help confirm.
For anyone struggling to capture log/trace output from a container, try mounting the diagnostic directory to a local volume:
-v /some/local/directory:/opt/oracle/diag
That persists all the log files the database generates. They remain available locally even if the container exits. It also prevents the logs from polluting the container's runtime layer, which should receive as few filesystem changes as possible.
Is this still an issue. We now have 19c ARM image available to try on Apple Silicon docker pull container-registry.oracle.com/database/enterprise:19.19.0.0
Closing this issue for now. Reopen if needed.