Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OracleDatabase/23.5.0] Unable to build a new extended image based on oracle/database:23.5.0-free because listener does not work #2870

Open
doberkofler opened this issue Sep 22, 2024 · 0 comments

Comments

@doberkofler
Copy link

doberkofler commented Sep 22, 2024

I'm trying to extend the Oracle Database image generated by buildContainerImage.sh but when building the new image the listener cannot be started with the following error message:

#11 0.371 Configuring Oracle Listener.
#11 1.827 Listener configuration failed. Check log '/opt/oracle/cfgtoollogs/netca/netca_configure_out.log' for more details.
#11 1.830 Netca configuration log
#11 1.830
#11 1.830 Parsing command line arguments:
#11 1.830     Parameter "orahome" = /opt/oracle/product/23ai/dbhomeFree
#11 1.830     Parameter "instype" = typical
#11 1.830     Parameter "inscomp" = client,oraclenet,javavm,server,ano
#11 1.830     Parameter "insprtcl" = tcp
#11 1.830     Parameter "cfg" = local
#11 1.830     Parameter "authadp" = NO_VALUE
#11 1.830     Parameter "responsefile" = /opt/oracle/product/23ai/dbhomeFree/network/install/netca_typ.rsp
#11 1.830     Parameter "silent" = true
#11 1.830     Parameter "orahnam" = OraHomeFree
#11 1.830     Parameter "listenerparameters" = DEFAULT_SERVICE=FREE
#11 1.830     Parameter "lisport" = 1521
#11 1.830 Done parsing command line arguments.
#11 1.830 Oracle Net Services Configuration:
#11 1.830 Profile configuration complete.
#11 1.830 Listener is using the port provided in the command line:1521
#11 1.830 Oracle Net Listener Startup:
#11 1.830 No valid IP Address returned for the host buildkitsandbox.
#11 1.830 Check the trace file for details: /opt/oracle/cfgtoollogs/netca/trace_OraDBHome23aiFree-2409228AM2107.log
#11 1.830 Oracle Net Services configuration failed.  The exit code is 1

This is my configuration using docker desktop 4.34.2 running macOS 15.0 on an Intel MacBook Pro:

  1. I created the base image using the following command:
./buildContainerImage.sh -v 23.5.0 -f -o '--progress=plain'`
  1. I use the following script to build the extended image:
export TARGET_IMAGE=oracle/database_ext:23.5.0-free
export DOCKERFILE=Dockerfile

docker image rm --force ${TARGET_IMAGE}
docker build --file=${DOCKERFILE} --progress=plain --rm --tag=${TARGET_IMAGE} --no-cache --ulimit nofile=1024:65536 --ulimit nproc=2047:16384 --ulimit stack=10485760:33554432 --ulimit memlock=3221225472 --memory="5g" --memory-swap="16g" .
  1. I use the following (reduced) Dockerfile:
FROM oracle/database:23.5.0-free

USER oracle

RUN /opt/oracle/runOracle.sh --nowait || true && \
	cat /opt/oracle/cfgtoollogs/netca/netca_configure_out.log

ENTRYPOINT [ "bash" ]

Interestingly when running the base image the listener and the database start as expected:

docker run --name test -p 1521:1521 -p 5500:5500 -p 2484:2484 --ulimit nofile=1024:65536 --ulimit nproc=2047:16384 --ulimit stack=10485760:33554432 --ulimit memlock=3221225472 -e ORACLE_PWD=manager oracle/database:23.5.0-free

Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:
Confirm the password:
Configuring Oracle Listener.
Listener configuration succeeded.
Configuring Oracle Database FREE.
Enter SYS user password:
********
Enter SYSTEM user password:
********
Enter PDBADMIN User Password:
*******
Prepare for db operation
Copying database files
Creating and starting Oracle instance
Completing Database Creation
Creating Pluggable Databases
Executing Post Configuration Actions
Running Custom Scripts
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/FREE.
Database Information:
Global Database Name:FREE
System Identifier(SID):FREE
Look at the log file "/opt/oracle/cfgtoollogs/dbca/FREE/FREE.log" for further details.
Connect to Oracle Database using one of the connect strings:
     Pluggable database: 38678ca8bf07/FREEPDB1
     Multitenant container database: 38678ca8bf07
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sun Sep 22 09:50:08 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle.  All rights reserved.
Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
SQL>
System altered.
SQL>
Pluggable database altered.
SQL>
PL/SQL procedure successfully completed.
SQL> SQL>
Session altered.
SQL>
User created.
SQL>
Grant succeeded.
SQL>
Grant succeeded.
SQL>
Grant succeeded.
SQL>
User altered.
SQL> SQL> Disconnected from Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
The Oracle base remains unchanged with value /opt/oracle
The Oracle base remains unchanged with value /opt/oracle
#########################
DATABASE IS READY TO USE!
#########################
The following output is now a tail of the alert.log:
FREEPDB1(3):Tablespace created: USERS ts# 6
FREEPDB1(3):Completed: CREATE SMALLFILE TABLESPACE "USERS" LOGGING  DATAFILE  '/opt/oracle/oradata/FREE/FREEPDB1/users01.dbf' SIZE 5M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED  EXTENT MANAGEMENT LOCAL  SEGMENT SPACE MANAGEMENT  AUTO
FREEPDB1(3):ALTER DATABASE DEFAULT TABLESPACE "USERS"
FREEPDB1(3):Completed: ALTER DATABASE DEFAULT TABLESPACE "USERS"
ALTER PLUGGABLE DATABASE FREEPDB1 SAVE STATE
Completed: ALTER PLUGGABLE DATABASE FREEPDB1 SAVE STATE
2024-09-22T09:50:08.994379+00:00
ALTER SYSTEM SET local_listener='' SCOPE=BOTH;
ALTER PLUGGABLE DATABASE FREEPDB1 SAVE STATE
Completed: ALTER PLUGGABLE DATABASE FREEPDB1 SAVE STATE
2024-09-22T09:50:51.444090+00:00
TABLE SYS.WRP$_REPORTS: ADDED AUTOLIST FRAGMENT SYS_P362 (2) VALUES (( 1452402374, TO_DATE(' 2024-09-16 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian') ))
TABLE SYS.WRP$_REPORTS_DETAILS: ADDED AUTOLIST FRAGMENT SYS_P363 (2) VALUES (( 1452402374, TO_DATE(' 2024-09-16 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian') ))
TABLE SYS.WRP$_REPORTS_TIME_BANDS: ADDED AUTOLIST FRAGMENT SYS_P366 (2) VALUES (( 1452402374, TO_DATE(' 2024-09-16 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian') ))

Based on a ChatGPT suggestion, I just discovered that when not using the deprecated legacy builder instead of buildkit the listener actually starts during the build but unfortunately when then using the new image it still fails and it is not possible to connect to the database when using the listener.

I used the following command line to start the build:

docker build --file=${DOCKERFILE} --progress=plain --rm --tag=${TARGET_IMAGE} --build-arg BASE_IMAGE=${BASE_IMAGE} --no-cache --ulimit nofile=1024:65536 --ulimit nproc=2047:16384 --ulimit stack=10485760:33554432 --ulimit memlock=3221225472 --memory="5g" --memory-swap="16g" .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0 environment-variable.

and this allows to to actually perform the build.

Unfortunately when running the image, it is not possible to connect using the listener as it still seems to be misconfigured.
Starting the image using docker run -it --name test -p 1521:1521 -p 5500:5500 -p 2484:2484 --ulimit nofile=1024:65536 --ulimit nproc=2047:16384 --ulimit stack=10485760:33554432 --ulimit memlock=3221225472 -e ORACLE_PWD=manager oracle/database_extended:23.5.0-free now shows:

Oracle Database instance FREE started.

Failed to start Oracle Net Listener using /opt/oracle/product/23ai/dbhomeFree/bin/tnslsnr and Oracle Database using /opt/oracle/product/23ai/dbhomeFree/bin/sqlplus.
+ '[' -n manager ']'
+ '[' -e /opt/oracle/oradata/FREE/.prebuiltdb ']'
+ /opt/oracle/setPassword.sh manager
The Oracle base remains unchanged with value /opt/oracle

SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Mon Sep 23 05:33:36 2024
Version 23.5.0.24.07

Copyright (c) 1982, 2024, Oracle.  All rights reserved.


Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07

SQL>
User altered.

SQL>
User altered.

SQL>
Session altered.

SQL>
User altered.

SQL> Disconnected from Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
+ for i in 1 2 4 8
+ /opt/oracle/checkDBStatus.sh
The Oracle base remains unchanged with value /opt/oracle
+ status=0
+ '[' 0 -eq 5 ']'
+ break
+ '[' 0 -eq 0 ']'
+ echo '#########################'
#########################
+ echo 'DATABASE IS READY TO USE!'
DATABASE IS READY TO USE!
+ echo '#########################'
#########################

Using sqlplus sys/manager as sysdba in the container works:

sh-4.4$ sqlplus sys/manager as sysdba
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Mon Sep 23 05:36:02 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle.  All rights reserved.
Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
SQL> 

Using sqlplus sys/manager@localhost:1521/FREE as sysdba does not:

sh-4.4$ sqlplus sys/manager@localhost:1521/FREE as sysdba
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Mon Sep 23 05:37:49 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle.  All rights reserved.
ERROR:
ORA-12541: Cannot connect. No listener at host 127.0.0.1 port 1521.
Help: https://docs.oracle.com/error-help/db/ora-12541/
Enter user-name: 
@doberkofler doberkofler changed the title [OracleDatabase/23.5.0] Unable to build a new extended image based on oracle/database:23.5.0-free [OracleDatabase/23.5.0] Unable to build a new extended image based on oracle/database:23.5.0-free because listener does not work Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant