oracle / weblogic-image-tool

WebLogic Image Tool
https://oracle.github.io/weblogic-image-tool/
Universal Permissive License v1.0
58 stars 26 forks source link

Image tool fails to build the image due to the error "Unable to locate the startup/shiphome directory" running the WLS installer #356

Closed denismaggior8 closed 2 years ago

denismaggior8 commented 2 years ago

My setup

Image tool version

$ ./imagetool.sh --version
imagetool:1.11.1

Docker version

$ docker info | grep  "Server Version"
 Server Version: 20.10.13

macOS version

$ sw_vers
ProductName:    macOS
ProductVersion: 12.3
BuildVersion:   21E230

Apple platform

$ uname -a
Darwin Deniss-MacBook-Pro.local 21.4.0 Darwin Kernel Version 21.4.0: Mon Feb 21 20:36:53 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T8101 arm64

How to reproduce

Add the WLS binary into the cache

$ imagetool.sh cache addInstaller --path=fmw_12.2.1.4.0_wls_quick_slim.jar --type=wls --version=12.2.1.4.0

Add the JDK binary into the cache

$ imagetool.sh cache addInstaller --path=jdk-8u202-linux-arm64-vfp-hflt.tar.gz --type=jdk --version=8u202

Create the image

$ imagetool.sh create \
--type wls \
--version 12.2.1.4.0 \
--tag wls:122140 \
--user 123.465@mydomain.com \
--password xyz

Relevant errors:

#15 0.248 INSTALLING MIDDLEWARE
#15 0.248 INSTALLING wls
#15 0.437 Launcher log file is /tmp/OraInstall2022-04-11_08-52-36PM/launcher2022-04-11_08-52-36PM.log.
#15 0.477 Extracting the installer . . . . Done
#15 1.514 Checking if CPU speed is above 300 MHz.  Actual unknown.   Failed <<<<
#15 1.515 Checking swap space: must be greater than 512 MBChecking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
#15 1.516 Checking temp space: must be greater than 300 MB.   Actual 284083 MB    Passed
#15 1.517
#15 1.517 >>> Ignoring failure(s) of required prerequisite checks and continuing.
#15 1.517 Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2022-04-11_08-52-36PM
#15 2.424 Log: /tmp/OraInstall2022-04-11_08-52-36PM/install2022-04-11_08-52-36PM.log
#15 2.749 Setting ORACLE_HOME...
#15 3.639 Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
#15 3.641 Reading response file..
#15 3.651 Skipping Software Updates
#15 3.652 Validations are disabled for this session.
#15 3.652 Verifying data
#15 3.668 Copying Files
#15 3.741 Internal Error: File Copy failed. Aborting Install
#15 3.751 Apr 11, 2022 8:52:40 PM oracle.as.install.engine.modules.configuration.ConfigurationModule onExit
#15 3.751 INFO: Cleaning up Configuration Module
#15 3.765
#15 3.765 The log(s) can be found here: /tmp/OraInstall2022-04-11_08-52-36PM.
#15 3.787
#15 3.787 ]]
#15 3.787 [2022-04-11T20:52:40.357+00:00] [as] [ERROR] [] [oracle.as.install.engine.modules.install.updates.AutoUpdateUtil] [host: localhost] [nwaddr: 127.0.0.1] [tid: 13] [userId: oracle] [ecid: 0000O0QPaRIFw000jzwkno1YL9KN000004,0] oracle.sysman.nextgen.NextGenInstallerException: Unable to locate the startup/shiphome directory[[
#15 3.787 oracle.sysman.nextgen.NextGenAutoUpdatesException: oracle.sysman.nextgen.NextGenInstallerException: Unable to locate the startup/shiphome directory
#15 3.787   at oracle.sysman.nextgen.impl.NextGenAutoUpdatesImpl.getFailedPatches(NextGenAutoUpdatesImpl.java:1213)
#15 3.787   at oracle.as.install.engine.modules.install.updates.AutoUpdateUtil.getFailedPatches(AutoUpdateUtil.java:543)
#15 3.787   at oracle.as.install.engine.modules.silent.SilentInstaller.updateFailedPatchInfo(SilentInstaller.java:1456)
#15 3.787   at oracle.as.install.engine.modules.silent.SilentInstaller.processModuleEvent(SilentInstaller.java:702)
#15 3.787   at oracle.as.install.engine.modules.util.PartnerModuleImpl.processEvent(PartnerModuleImpl.java:121)
#15 3.787   at oracle.as.install.engine.InstallEngine.notifyListeners(InstallEngine.java:708)
#15 3.787   at oracle.as.install.engine.InstallEngine.processEvent(InstallEngine.java:666)
#15 3.787   at oracle.as.install.engine.modules.util.PartnerModuleImpl.notifyAllEventListenersHelper(PartnerModuleImpl.java:230)
#15 3.787   at oracle.as.install.engine.modules.util.PartnerModuleImpl.notifyListeners(PartnerModuleImpl.java:194)
#15 3.787   at oracle.as.install.engine.modules.install.InstallModule.onError(InstallModule.java:504)
#15 3.787   at oracle.as.install.engine.modules.install.action.NextGenAPIInstallManager.notifyError(NextGenAPIInstallManager.java:142)
#15 3.787   at oracle.as.install.engine.modules.install.command.InstallErrorCommand.execute(InstallErrorCommand.java:22)
#15 3.787   at oracle.as.install.engine.modules.install.action.NextGenAPIInstallManager.onInstallEvent(NextGenAPIInstallManager.java:150)
#15 3.787   at oracle.as.install.engine.modules.install.action.AbstractOUIHandler.fireInstallEvent(AbstractOUIHandler.java:187)
#15 3.787   at oracle.as.install.engine.modules.install.action.AbstractNextGenInstaller.start(AbstractNextGenInstaller.java:240)
#15 3.787   at oracle.as.install.engine.modules.install.action.NextGenAPIInstallManager.launchOUI(NextGenAPIInstallManager.java:104)
#15 3.787   at oracle.as.install.engine.modules.install.InstallModule.launchOUI(InstallModule.java:165)
#15 3.787   at oracle.as.install.engine.modules.install.InstallModule$1.run(InstallModule.java:262)
#15 3.787 Caused by: oracle.sysman.nextgen.NextGenInstallerException: Unable to locate the startup/shiphome directory
#15 3.787   at oracle.sysman.nextgen.factory.GdrSessionFactory.getDistributionSession(GdrSessionFactory.java:274)
#15 3.787   at oracle.sysman.nextgen.factory.GdrSessionFactory.initInstallerSession(GdrSessionFactory.java:228)
#15 3.787   at oracle.sysman.nextgen.factory.GdrSessionFactory.getInstallerSession(GdrSessionFactory.java:170)
#15 3.787   at oracle.sysman.nextgen.factory.GdrSessionFactory.getGdrInstallSession(GdrSessionFactory.java:82)
#15 3.787   at oracle.sysman.nextgen.impl.NextGenAutoUpdatesImpl.getAttachedPatches(NextGenAutoUpdatesImpl.java:1360)
#15 3.787   at oracle.sysman.nextgen.impl.NextGenAutoUpdatesImpl.getFailedPatches(NextGenAutoUpdatesImpl.java:1168)
#15 3.787   ... 17 more
#15 3.787
#15 3.787 ]]
#15 3.787 Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
#15 3.787 #This is the time taken for the interview/data collection phase.
#15 3.787 Interview Time : 0 seconds.
#15 3.787 #Time taken to copy files to the machine
#15 3.787 Install Time : 0 seconds.
#15 3.787 #Time taken to link files on the machine. This is not applicable to Windows Systems.
#15 3.787 Link Time : 0 seconds.
#15 3.787 #Time taken to configure the product.
#15 3.787 Configuration Time : 0 seconds.
#15 3.787 #This is the time taken to complete the full install session.
#15 3.787 Session Time : 1 seconds.
#15 3.787 #Operating System on the machine
#15 3.787 Operating System : Linux
#15 3.787 #Processor on the machine
#15 3.787 Processor Architecture : aarch64
#15 3.787 #The cycle speed of the CPU
#15 3.787 CPU Speed : 0.000 MHz
#15 3.787 #This is the number of CPUs available to the installer's JVM
#15 3.787 CPU Number : 6 Processors.
#15 3.787 #This is the total RAM on the system
#15 3.787 Total Memory : 0 MB.
#15 3.787 #RAM available to the installer's JVM during the install session.
#15 3.787 Available Memory : 0 MB.
#15 3.787 #Available Swap space on this machine when installer started
#15 3.787 Available Swap Space : 0 MB.
#15 3.787 #Maximum number of threads at any given instance during this install session.
#15 3.787 Peak Thread Count : 7 Threads.
#15 3.787 #Installation Directory
#15 3.787 Oracle Home : /u01/oracle
#15 3.787 #Indicates SILENT or GUI mode install type.
#15 3.787 Install Mode : SILENT
#15 3.787 #Total size of files copied on the machine by the installer
#15 3.787 Oracle Home Size : 5.3085386753082275E-8 GB.
#15 3.787 #The location of the shiphome
#15 3.787 Installed From : ../stage/products.xml
#15 3.787 #Time taken to remove files from the machine
#15 3.787 Deinstall Time : 0 seconds.
#15 3.787
#15 3.787
#15 ERROR: executor failed running [/bin/sh -c echo "INSTALLING MIDDLEWARE"     && echo "INSTALLING wls"     &&  /u01/jdk/bin/java -Xmx1024m -jar /tmp/imagetool/fmw_12.2.1.4.0_wls_quick_slim.jar -silent ORACLE_HOME=/u01/oracle     -responseFile /tmp/imagetool/wls.rsp -invPtrLoc /u01/oracle/oraInst.loc -ignoreSysPrereqs -force -novalidation   && test $? -eq 0 && chmod -R g+r /u01/oracle || (grep -vh "NOTIFICATION" /tmp/OraInstall*/install*.log && exit 1)]: exit code: 1
------
 > [wls_build 5/5] RUN echo "INSTALLING MIDDLEWARE"     && echo "INSTALLING wls"     &&  /u01/jdk/bin/java -Xmx1024m -jar /tmp/imagetool/fmw_12.2.1.4.0_wls_quick_slim.jar -silent ORACLE_HOME=/u01/oracle     -responseFile /tmp/imagetool/wls.rsp -invPtrLoc /u01/oracle/oraInst.loc -ignoreSysPrereqs -force -novalidation   && test $? -eq 0 && chmod -R g+r /u01/oracle || (grep -vh "NOTIFICATION" /tmp/OraInstall*/install*.log && exit 1):
------
executor failed running [/bin/sh -c echo "INSTALLING MIDDLEWARE"     && echo "INSTALLING wls"     &&  /u01/jdk/bin/java -Xmx1024m -jar /tmp/imagetool/fmw_12.2.1.4.0_wls_quick_slim.jar -silent ORACLE_HOME=/u01/oracle     -responseFile /tmp/imagetool/wls.rsp -invPtrLoc /u01/oracle/oraInst.loc -ignoreSysPrereqs -force -novalidation   && test $? -eq 0 && chmod -R g+r /u01/oracle || (grep -vh "NOTIFICATION" /tmp/OraInstall*/install*.log && exit 1)]: exit code: 1

The comple log can be found here:

imagetool.log

@mriccell @markxnelson please advise

ddsharpe commented 2 years ago

@denismaggior8 Are you building on an ARM host machine? I tried on an Oracle cloud VM and on my laptop with a standard Oracle JVM, but I am unable to reproduce this error.

denismaggior8 commented 2 years ago

Yes, MacBook Pro with M1 processor. The issue seems to be the WebLogic installer, not image-tool itself. I need to build an ARM-native WebLogic image (just for testing purpose) because the x86 one, emulated with qemu, is too slow on my laptop. I'm wondering what's wrong with the installer on M1 processor, the JDK version is among the supported ones... I can help you troubleshoot this issue, do you know what it means "Unable to locate the startup/shiphome directory" ?

ddsharpe commented 2 years ago

@denismaggior8 I am not sure what this is referring to. I have a couple guesses. The easiest first step to debug is to disable Docker buildkit so that we can see the log. If we don't get any information that way, we can alter the Dockerfile to print the installer log. To disable: export DOCKER_BUILDKIT=0 To modify the Dockerfile, you or I will need to modify src/main/resources/docker-files/install-middleware.mustache on or near line 47 to echo /tmp/OraInstall*/install*.log

ddsharpe commented 2 years ago

@denismaggior8 Can you run the same installer locally on your Mac? It would be much easier to see the log that way versus being in a container.

mriccell commented 2 years ago

We do not support WebLogic Server installers on ARM on MacOS

denismaggior8 commented 2 years ago

Hi @mriccell, nice to meet you again. We met a couple of years ago at a customer's HQ in Moncalieri (Turin/Italy). I understand you don't support the WebLogic's installer on Apple M1 processors but, since this architecture will be massively adopted by developers using macOs in the next few years, I can offer my support to to start testing it, what do you think?

@ddsharpe thanks for your kind support, I have disabled BuildKit using export DOCKER_BUILDKIT=0 and then re-run

$  imagetool.sh create \
--type wls \
--version 12.2.1.4.0 \
--tag wls:122140 \
--user 123.465@mydomain.com \
--password xyz

The build.log that I got is the one attached to this comment.

Let me know. Denis

denismaggior8 commented 2 years ago

@denismaggior8 Can you run the same installer locally on your Mac? It would be much easier to see the log that way versus being in a container.

I've set up this repo for testing purpose, docker build gives me the same "Unable to locate the startup/shiphome directory" error as image tool.

ddsharpe commented 2 years ago

@denismaggior8 posted to your repo in the issues. Awaiting feedback.

ddsharpe commented 2 years ago

@denismaggior8 should we keep this open? I don't see any traffic here or in your repo.

denismaggior8 commented 2 years ago

Yes please, I had some busy weeks but since tomorrow I'll be back working on it. I'll update you soon

hfatnaci commented 2 years ago

Hi

facing the same issue , any luck on finding workaround to this ? I am trying to build new 12214 image on arm64 platform using my macOS/dockerDesktop.. the same image I can then upload to my private repo and then reuse it to create my Weblogic domain in 2 nodes-K8S cluster running on Debian VMs on my MACOS also using the ARM64, VMs are running on UTM( kinda virtual box..) the default 12214 image is built on x64 platform and I can't deploy it in my ARM64-K8S cluster, thus the reason for me to create new 12214 image that can be supported and run in ARM64 arch and using docker on macOS

any hints are much appreciated

denismaggior8 commented 2 years ago

Hi @hfatnaci, the error seems to be related to a bug that affects the installer when run from an arm64 JDK. I think that @ddsharpe already opened an issue to the dev team, meanwhile you can follow this guide to build your own arm64 WLS image (bypassing the installer) https://github.com/sunnyvale-it/oracle-weblogic-apple-arm64-docker-image

Tell me if it works for you.

ddsharpe commented 2 years ago

@hfatnaci @denismaggior8 This is not an Image Tool issue. The Oracle installer fails on MacOS ARM with or without Docker and the Image Tool involved. I have filed an issue with the Oracle team. If this is an issue for you or your company, please file a "me too" support case with Oracle Support. Filing a support case would help let the support team know how many people this affects, and will help you get notified when a fix is available.

hfatnaci commented 2 years ago

Thanks @denismaggior8 for the prompt reply.. the guide was indeed helpful to build an few 12214 image with arm64 platform ...still need to try to run it in my k8S cluster also running on arm64 arch agree @ddsharpe , when launching the imagetool to create the image, the error is occurring during the installation process of the middleware which is basically a java process against the installer jar.. the workaround on the guide provided by @denismaggior8 is basically copying an existing installation from x86 image to an image built on arm64 with jdk that is also arm64.. I still have to see if that image will work smoothly :) but it seems the actual support of fmw is not entirely there for ARM64, according the matrix support : https://www.oracle.com/technetwork/middleware/fmw-122140-certmatrix-5763476.xlsx the support for 12214 on ARM64 is only on OEL7, so in theory the imagetool should also support this and able to build an image of 12214 on OEL7 on ARM64 arch.. the image can be then executed on docker on macOS or a Linux VM on macOS and that should be still supported by oracle.. as we are not trying to run/install fmw12214 on a bare macOS which we know isn't supported

ddsharpe commented 2 years ago

Oracle JDK and FMW teams are working on support for MacOS ARM. For now, Image Tool will have to wait.