Friday, April 25, 2025

Exadata cellcli throws 'OutOfMemoryError' exception

After installation of the QFSDP for Exadata, I found that I couldn't run any cellcli command on one particular storage cell in interactive mode. Switch '-n' (non-interactive mode) for cellcli worked fine though. 

The culprit was a cellcli history file :

/root/.jline3-oracle.ossmgmt.ms.cli.CellCLI.history 

which contained almost 1M lines. As the result the CPU of a storage server was overloaded by java trying to build an array of command history in the memory and after couple of minutes java thrown the exception like this :

CellCLI> help
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
CellCLI> help   at java.util.Arrays.copyOfRange(Arrays.java:3664)
        at java.lang.String.<init>(String.java:207)
        at java.lang.String.substring(String.java:1933)
        at org.jline.reader.impl.history.DefaultHistory.lambda$trimHistory$2(DefaultHistory.java:255)
        at org.jline.reader.impl.history.DefaultHistory$$Lambda$187/1144648478.accept(Unknown Source)
        at java.util.Iterator.forEachRemaining(Iterator.java:116)
        at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
        at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
        at org.jline.reader.impl.history.DefaultHistory.trimHistory(DefaultHistory.java:252)
        at org.jline.reader.impl.history.DefaultHistory.internalWrite(DefaultHistory.java:241)
        at org.jline.reader.impl.history.DefaultHistory.save(DefaultHistory.java:219)
        at org.jline.reader.impl.history.DefaultHistory.add(DefaultHistory.java:384)
        at oracle.ossmgmt.common.util.MyLineReader$MyHistory.add(MyLineReader.java:329)
        at org.jline.reader.impl.LineReaderImpl.finish(LineReaderImpl.java:1140)
        at org.jline.reader.impl.LineReaderImpl.finishBuffer(LineReaderImpl.java:1109)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:689)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:468)
        at oracle.ossmgmt.common.util.MyLineReader.readLine(MyLineReader.java:197)
        at oracle.ossmgmt.common.util.MyLineReader.readLineCliImpl(MyLineReader.java:173)
        at oracle.ossmgmt.ms.cli.CellCLI.readAndProcessLine(CellCLI.java:695)
        at oracle.ossmgmt.common.cli.CLIImpl.processCommands(CLIImpl.java:595)
        at oracle.ossmgmt.ms.cli.CellCLI.processCommands(CellCLI.java:639)
        at oracle.ossmgmt.ms.cli.CellCLI.main(CellCLI.java:355)

The solution - to rename (to move) the cellcli history file.

Wednesday, January 29, 2025

ssh: Bad server host key: Invalid key length

 Add the option to the ssh command :

-o RequiredRSASize=1024