Closed eranhazout closed 8 years ago
The only solution I have found for now is to modify the /etc/init.d/neo4j file to use root as user for daemon: [ -n "${NEO_USER}" ] || NEO_USER=root
Would you mind trying to reproduce this issue on 3.0.0
?
Also, could the permissions in /var/run/neo4j
be such that the user neo4j is not authorized to create files in that location?
I will try with 3.0.0 later today and update you. Yes, the /var/run directory is on user root. but neo4j is trying to create a directory under /var/run as this: /var/run/neo4j/neo4j.pid So I created the /var/run/neo4j manually but the stop script is deleting this directory. is it ok to run neo4j as root user? and disadvantages or security risks?
Thanks
Where can I find 3.0.0?
@eranhazout http://debian.neo4j.org/
To avoid running as root (which is not recommended), you can add this to the start of the do_start()
method in /etc/init.d/neo4j
:
# Make sure that /var/run/neo4j exists
[ -d "/var/run/${NAME}" ] || mkdir -p "/var/run/${NAME}"
# And that it has correct permissions
if [ "${NEO_USER}" != "root" ]; then
chown "${NEO_USER}" "/var/run/${NAME}"
fi
That way, the directory is created if missing on each startup, which should solve your issue. We'll update the script to do this as well.
Yes, it fix the problem. Thanks
This will be fixed in 3.0.2. In the meantime, an alternative workaround is to manually create and chown
/var/run/neo4j
after a reboot.
Hi,
I am using neo4j 3.2.1 and I have exactly the same issue...
Same as @Baptiste-Garcin with the identical issue. Installed 3.2.1 on a virgin 16.04 server
root@ip-172-xx-xx-113:/home/ubuntu# uname -a
Linux ip-172-xx-xx-113 4.4.0-1020-aws #29-Ubuntu SMP Wed Jun 14 15:54:52 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
root@ip-172-xx-xx-113:/home/ubuntu# /usr/bin/neo4j start
Active database: graph.db
Directories in use:
home: /var/lib/neo4j
config: /etc/neo4j
logs: /var/log/neo4j
plugins: /var/lib/neo4j/plugins
import: /var/lib/neo4j/import
data: /var/lib/neo4j/data
certificates: /var/lib/neo4j/certificates
run: /var/run/neo4j
Starting Neo4j.
WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
/usr/share/neo4j/bin/neo4j: line 411: /var/run/neo4j/neo4j.pid: No such file or directory
Suggestions?
Hi,
I struggled during hours with permission and manual install. At the end, a simple apt-get install neo4j / sudo service neo4j start worked well
I am pretty sure using apt did'nt work the first time. Hope it somehow helps...
I think this is related to the use of neo4j start
instead of service neo4j start
or systemctl start neo4j
?
@spacecowboy would it be possible to have neo4j start
output an error message that points to the correct way of starting the server on linux? And perhaps highlight this more in the documentation?
@Baptiste-Garcin @jmvbxx @jexp
If you have installed neo4j via the debian package (or RPM), stop running neo4j start
.
The correct way to starting/stopping neo4j in a package install is by using service neo4j start
or systemctl start neo4j
.
When neo4j is running using systemd (neo4j 3.1.0
and above) no pid file is created and no /var/run/neo4j directory is created because systemd handles all of the backgrounding busy work for us and it does it way better.
This is also why you'll have to use journalctl -u neo4j
to look at the log and there is no /var/log/neo4j/neo4j.log file anymore.
@spacecowboy pointed to this in the docs:
https://neo4j.com/docs/operations-manual/3.2/installation/linux/systemd/
I was having an issues trying to launch neo4j using service neo4j start
(neo4j 3.2.1, Ubuntu 16.04, installed using apt-get). Checking journalctl -u neo4j
it reported "/var/log/neo4j/debug.log (Permission denied)". Changing the folder's group to neo4j and making it group writable seems to have solved it.
The way I resolved this was to manually create the /var/run/neo4j directory and chgrp to neo4j.
@spacecowboy Couldn't you build in @jmouka's solution in the setup process?
@spacecowboy Im, having a very similar issue. This is my etc/neo4j/neo4j.conf data
#
dbms.directories.data=/var/lib/neo4j/data dbms.directories.plugins=/var/lib/neo4j/plugins dbms.directories.certificates=/var/lib/neo4j/certificates dbms.directories.logs=/var/log/neo4j dbms.directories.lib=/usr/share/neo4j/lib dbms.directories.run=/var/run/neo4j dbms.directories.metrics=/var/lib/neo4j/metrics
LOAD CSV
import files to be under the import
directory. Remove or comment it out toLOAD CSV
section of the manual for details.dbms.directories.import=/var/lib/neo4j/import
This is the error that i get as soon as i click on connect.
Ok, the Neo4j is installed on a open stack server. And im creating a ssh channel like this
ssh -L :7474:127.0.0.1:7474 ubuntu@208.75.00.001 -v -v
from my mac os terminal.
the firewall on the remote server is off as well.
I have tried many things. Please any help here would be really appreciated.
I'm running neo4j in a Docker container and none of the above workarounds helped me (there is no neo4j
user on my system).
Running sudo chmod -R 777 ~/neo4j
did the trick for now, though I still can't figure out why it needs these high permissions. Neither 770
or 766
are good enough for logging, apparently.
I've read through this (and other) posts many times and got things to work once, but had to uninstall so am now starting from scratch. I'm running Ubuntu 17.10 and have followed all installation steps painstakingly. Undoubtedly my naivete with the ubuntu interface is part of the issue, but after 3-4 hours I'm pretty much begging for help on this.
Thank you!
Until figuring out the long term solution I did a manual install from the tarball. Not elegant, so I really look forward to learning the best way to do this - and maybe having a stable, consistent and well documented way to install this software in the future.
I have use the @spacecowboy tricks, but still have an error while starting neo4j on ubuntu (remote server)
systemctl restart neo4j ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === Authentication is required to restart 'neo4j.service'. Multiple identities can be used for authentication:
But, while i check status of neo4j, it have not active yet.
ardan7779@serverx:/$ neo4j status Neo4j is not running
Optional solution: Go and edit the next file:
cd /usr/share/neo4j/conf
vim neo4j.conf
uncomment the line 9 dbms.active_database=graph.db This should works, if you have problems with the database connection.
tarting Neo4j. WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual. ./bin/neo4j: line 451: /usr/share/neo4j/run/neo4j.pid: No such file or directory ./bin/neo4j: line 450: /usr/share/neo4j/logs/neo4j.log: No such file or directory
udo service neo4j start Failed to start neo4j.service: Unit neo4j.service not found.
Created manually folders. sudo neo4j start Active database: graph.db Directories in use: home: /usr/share/neo4j config: /usr/share/neo4j/conf logs: /usr/share/neo4j/logs plugins: /usr/share/neo4j/plugins import: /usr/share/neo4j/import data: /usr/share/neo4j/data certificates: /usr/share/neo4j/certificates run: /usr/share/neo4j/run Starting Neo4j. WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual. Started neo4j (pid 4394). It is available at http://localhost:7474/ There may be a short delay until the server is ready. See /usr/share/neo4j/logs/neo4j.log for current status. kali@kali:~/Desktop/htb/StartingPoint/Pathfinde$ cat /usr/share/neo4j/logs/neo4j.log nohup: ignoring input 2020-07-19 16:40:19.282+0000 INFO ======== Neo4j 3.5.3 ======== 2020-07-19 16:40:19.313+0000 INFO Starting... 2020-07-19 16:40:29.697+0000 INFO Bolt enabled on 127.0.0.1:7687. kali@kali:~/Desktop/htb/StartingPoint/Pathfinde$
systemctl start neo4j Failed to start neo4j.service: Unit neo4j.service not found.
I have noticed that a fresh install of neo4j enterprise is not creating pid file on /var/run/neo4j directory. Also if I'm creating this directory manually it's been deleted by neo4j stop procedure. The result is an instance of neo4j which is not controllable by neo4j bin file. This occurs after first reboot of the server and in order to stop neo4j I forced to kill -9 the process.
Neo4j Version: 3.0M03
Operating System: Ubuntu 14.04
Steps to reproduce
#service neo4j stop / start
Expected behavior
neo4j start procedure should create neo4j.pid file on upstart neo4j stop procedure should delete neo4j.pid
Actual behavior
neo4j start procedure is not creating neo4j.pid file on upstart