Orientdb: Error on reading console input: null, java.lang.NullPointerException on console.sh (never ends)

Created on 11 Feb 2015  Â·  6Comments  Â·  Source: orientechnologies/orientdb

whenever I start the orientdb-console command it would show unlimited lines of orientdb and no key could be pressed (except for ctrl+C for exit the program)

$ uname -a
Linux pc1 3.18.3-1-ArchLinux #1 SMP PREEMPT Fri Jan 16 21:08:54 UTC 2015 x86_64 GNU/Linux                                         

$ java -version
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (Arch Linux build 7.u75_2.5.4-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)

$ orientdb-console --help                                                                                     
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel                                                                                                                       

OrientDB console v.2.0.1 (build 0) www.orientechnologies.com                                                                     
Type 'help' to display all the supported commands.                                                                               
Installing extensions for GREMLIN language v.2.6.0      

$ ll `which orientdb-console`                                                                                 
lrwxrwxrwx 1 root root 28 2015.02.10 19:19 /usr/bin/orientdb-console -> /opt/orientdb/bin/console.sh*  

$ orientdb-console
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel

OrientDB console v.2.0.1 (build 0) www.orientechnologies.com
Type 'help' to display all the supported commands.
Installing extensions for GREMLIN language v.2.6.0

orientdb> 
orientdb> 
orientdb> 
orientdb> 
orientdb> 
orientdb> 
orientdb> 
orientdb> 
orientdb> 

^ infinite

after pressing ctrl+C, the shell (bash) would show another prompt on the same line when pressing enter, and any key won't show when pressed.

orientdb>
^C
$ $ $ $ $ $

version tested: orientdb-community 2.0.1-1 from https://aur.archlinux.org/packages/orientdb-community/

Most helpful comment

Seems to work now after granting all privileges to /bin/.orientdb_history

sudo chmod 777 .orientdb_history

All 6 comments

I found that by running ./bin/console.sh there are some erros shown endlessly:

orientdb> Error on reading console input: null
java.lang.NullPointerException
        at com.orientechnologies.common.console.TTYConsoleReader.readLine(TTYConsoleReader.java:94)
        at com.orientechnologies.common.console.OConsoleApplication.run(OConsoleApplication.java:130)
        at com.orientechnologies.orient.graph.console.OGremlinConsole.main(OGremlinConsole.java:62)

also there are an error on startup:

Error creating history file.
java.io.IOException: Permission denied
        at java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.io.File.createNewFile(File.java:1006)
        at com.orientechnologies.common.console.TTYConsoleReader.getHistoryFile(TTYConsoleReader.java:443)
        at com.orientechnologies.common.console.TTYConsoleReader.<init>(TTYConsoleReader.java:60)
        at com.orientechnologies.orient.graph.console.OGremlinConsole.main(OGremlinConsole.java:60)
History file not found
java.io.FileNotFoundException: .orientdb_history (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:146)
        at java.io.FileReader.<init>(FileReader.java:72)
        at com.orientechnologies.common.console.TTYConsoleReader.<init>(TTYConsoleReader.java:63)
        at com.orientechnologies.orient.graph.console.OGremlinConsole.main(OGremlinConsole.java:60)

This should be already fixed in 2.0.2

I am getting the same error Luca. Mine is deployed in AWS. I installed Orientdb from the marketplace. I also raised an issue for not being able to create a database. Could you pls update the market place version? Or kindly let me know how to resolve this issue. I really loved using OrientDB in my local while developing our app but so many issues when we are getting close to deployment :'(

Same error, using the community 2.0.6 AMI deployed in AWS:

orientdb> help
Error on reading console input: null
java.io.FileNotFoundException: .orientdb_history (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
    at java.io.FileWriter.<init>(FileWriter.java:90)
    at com.orientechnologies.common.console.TTYConsoleReader.writeHistory(TTYConsoleReader.java:314)
    at com.orientechnologies.common.console.TTYConsoleReader.readLine(TTYConsoleReader.java:288)
    at com.orientechnologies.common.console.OConsoleApplication.run(OConsoleApplication.java:130)
    at com.orientechnologies.orient.graph.console.OGremlinConsole.main(OGremlinConsole.java:62)

Seems to work now after granting all privileges to /bin/.orientdb_history

sudo chmod 777 .orientdb_history
Was this page helpful?
0 / 5 - 0 ratings