question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

should console.sh look for .orientdb_history in the home directory of the user who invoked it?

See original GitHub issue

I’m managed to successfully install orientdb-community-2.0.1 on Ubuntu 14.04.2 in /opt using the instructions at http://www.famvdploeg.com/blog/2013/01/setting-up-an-orientdb-server-on-ubuntu/; when I try running console.sh as myself, however, I observe the following exception:

History file not found
java.io.FileNotFoundException: .orientdb_history (Permission denied)
    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:64)
    at com.orientechnologies.orient.graph.console.OGremlinConsole.main(OGremlinConsole.java:60)
Exception in thread "main" com.orientechnologies.common.exception.OException: Cannot access to the input stream. Check permissions of running process
    at com.orientechnologies.common.console.TTYConsoleReader.<init>(TTYConsoleReader.java:84)
    at com.orientechnologies.orient.graph.console.OGremlinConsole.main(OGremlinConsole.java:60)

I can run the console via sudo -u orientdb /opt/orientdb-community-2.0.1/bin/console.sh; however, shouldn’t the presence of a Unix user in the orientdb group and making console.sh group executable be sufficient to enable one to run the console as that user?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nagarajasrcommented, Jul 17, 2015

i tried to reproduce the issue in my local environment and it appears the issue is happening due to the console trying to read/write the history file in current directory (which the script has previously set to $ORIENTDB_HOME). since the normal user does not have write permission to ORIENTDB_HOME, it fails.

as a workaround, you can comment out the line in console.sh that says ‘cd $ORIENTDB_HOME/bin’. this will cause the history file to be read/written from the current directory where the normal user runs the console script (which could of course change between runs)

it is also possible to work around this problem by giving write permission to $ORIENTDB_HOME to the orientdb group, but that could result in other security issues, like users being able to read each other’s command history (including passwords)

i am inclined to think the proper fix for the issue would be for the console program to read write the history file from the user’s home directory.

1reaction
nagarajasrcommented, Jul 17, 2015

if you have previously run the console as root (using sudo), the .orientdb_history file would have been created as root in the current user’s home directory and so a normal user would subsequently not be able to write to that file. that’s why you are seeing permission denied error. delete this file (it contains the history of commands run at the console, somewhat along the same lines as .bash_history, so if you don’t need the history it is safe to delete it) and restart the console as normal user you should be good to go.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run the console · OrientDB Manual
The OrientDB console is now running. From this prompt you can connect to and manage any remote or local databases available to you....
Read more >
OrientDB - Quick Guide - Tutorialspoint
Use the following command to copy the console.sh file from OrientDB installation directory that is $ORIENTDB_HOME/bin to the system bin directory ...
Read more >
OrientDB-Manual.pdf
In the following parts of this tutorial, we will look closely at OrientDB ... This creates a directory called orientdb-community-2.2.37 with ...
Read more >
ArcadeDB Manual
Once inserted the password for the root user, you should see this output. ... Run the console by executing console.sh under bin directory:....
Read more >
OrientDB - Wikipedia
OrientDB is an open source NoSQL database management system written in Java. ... It has a strong security profiling system based on users...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found