Database 'neo4j' is unavailable. Cannot reset neo4j database
Asked Answered
R

4

6

I have my community 4.1.1 neo4j service installed on the ubuntu commandline running on my windows machine. I have been using neo4j steadily for a month or two now, just recently it has prevented me from accessing the neo4j database, it will say this in neo4j browser:

Database 'neo4j' is unavailable. Run :sysinfo for more info.

I have tried uninstalling neo4j and reinstalling but that has not worked either. I tried playing around with the default listen address previously, but now with the reinstall all config data is back to normal. Running ./neo4j-community-4.1.1/bin/cypher-shell under bin does not work. It says:

Unable to establish connection in 3000ms

If I run ./neo4j-community-4.1.1/bin/cypher-shell -a 192.168.0.19 it says:

Database 'neo4j' is unavailable

When I run ./neo4j-community-4.1.1/bin/neo4j-admin check-consistency --database=neo4j it also states:

.2020-08-18 22:12:16.868+0000 WARN [o.n.c.ConsistencyCheckService] Index was dirty on startup which means it was not shutdown correctly and need to be cleaned up with a successful recovery. Index file: /home/thomp105/neo4j-community-4.1.1/data/databases/neo4j/neostore.relationshipgroupstore.db.id.

I would love to reset everything from scratch but I am unsure how At this point I cannot even access the browser at localhost:7474. It hangs indefinitely trying to load.

I am truly stumped. Anyone have any advice on how I navigate this issue?

Radiophotograph answered 18/8, 2020 at 22:18 Comment(0)
C
8

I had this problem running on a linux server. The server was up but got this error on any query: Database 'neo4j' is unavailable. To troubleshoot I ran sudo neo4j console and the problem went away. When I ran the console as user ne04j the problem came back.

$ /usr/share/neo4j/bin/neo4j console
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

So I tried: sudo chown -R neo4j:neo4j /var/lib/neo4j/data and the problem went away. Apparently when I'd done a restore of the database I'd run the neo4j server as root and when the system runs neo4j it does it as the user neo4j so couldn't read any of its data. It seems that an error like this would warrant an easy to parse error message but verbosity is not the neo4j way.

Cicely answered 17/4, 2021 at 18:17 Comment(1)
Worth noting that after running a DB restore using "load" (neo4j.com/docs/operations-manual/current/backup-restore/…) - you'll need to run the chown again.Tubercular
B
4

It's not easy to guess the issue without seeing your system, but may I ask if you can try to delete your default database, i.e. neo4j physically from the disk (e.g. rm -rf /home/thomp105/neo4j-community-4.1.1/data/databases/neo4j/), and then try to create another database with different name instead (open neo4j.conf, search for dbms.active_database, which point out on default database, and change it to some other name)?

Blondell answered 19/8, 2020 at 8:43 Comment(1)
For community edition there was no option dbms.active_database but all was required was ending processes for port 7474 and deleting db. Connection to port 7474 was not immediately failing so that means it was hanging. Attempting to end processes with taskkill did not work so it required me to download "Process Hacker". Run netstat -ano | findstr :7474 in command line. End all processes found from command from process hacker. Delete neo4j db under neo4j-community/data/databases/neo4j (or backup if you want) as you suggested and then run neo4j again. Leaving this here for anyone with same issue.Radiophotograph
S
0

I observed the situation that when neo4j database selected on UI, I cannot run "start database neo4j" with success. In this case, I got "Database 'neo4j' is unavailable. Run :sysinfo for more info." After switching selected db from neo4j to system, then "start database neo4j" runs successfully.

** I recognized the situation that giving permissions to /data folder is necessary. After running chmod command previous answer works.

Silvie answered 6/3, 2023 at 11:27 Comment(0)
C
0

When i started the neo4j EC2 Instance, neo4j browser says: neo4j database offline status. Neo4j database is not available.

I tried to start from the ec2 console and problem solved.

[root@xxxxxxxxxxxxxx ~]# neo4j restart Stopping Neo4j....... stopped. Directories in use: home: /var/lib/neo4j config: /etc/neo4j logs: /var/log/neo4j plugins: /var/lib/neo4j/plugins import: ****** data: /var/lib/neo4j/data certificates: /var/lib/neo4j/certificates licenses: /var/lib/neo4j/licenses run: /var/lib/neo4j/run Starting Neo4j. Started neo4j (pid:18525). It is available at http://0.0.0.0:7474 There may be a short delay until the server is ready.

name type aliases access address role writer requestedStatus currentStatus statusMessage default home

"neo4j" "standard" [] "read-write" "localhost:7687" "primary" true "online" "online" "" true true

Cantle answered 26/5, 2023 at 8:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.