Explanation of start failure “java.lang.NoClassDefFoundError: org/neo4j/kernel/impl/logging/LogService”

Upon starting Neo4j 3.5 if one encounters the following error in the logs/neo4j.log Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component ‘org.neo4j.kernel.extension.GlobalKernelExtensions@14c16d’ failed to initialize. Please see the attached cause exception “org.neo4j.kernel.impl.logging.LogService”. at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:434) at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:66) at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:102) at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:203) … 9 more Caused… Read more →

How do I view the column headers of a CSV file with LOAD CSV

If one has a CSV file with the following content id,name,dob,addr1,addr2,city,state,country 1,Joe Smith,04/23/1971,121 Main Street,San Mateo,CA,USA 2,Bill Williams,09/21/2008,43 Overlook St,San Mateo,CA, USA and one simply wants to run a LOAD CSV command to have the column headers returned, the following… Read more →

How to configure off-heap transaction state

Warning This feature is experimental in 3.5, on by default in 4.0. Commencing with Neo4j 3.5, it is possible to store some of transactions’ data in off-heap memory. This can help to reduce GC pressure and/or prevent OOM crashes in… Read more →

How to avoid costly traversals with join hints

When matching a pattern using Cypher, the number of possible paths to evaluate often correlates with query execution time. When there is a supernode in the path (a node with a high number of relationships whose type are included in… Read more →

Causal Cluster FAQ for heavy workloads

Lagging of follower instances and what causes it? The main reason for followers to fall behind is highly concurrent and continuous read/write workloads. This can cause the instances get overwhelmed which causes some extra latency in propagating the data to… Read more →

Importing CSV Files: Neo4j Desktop and Sandbox

Loading various kinds of files into Neo4j requires different locations depending on the tool you are using. Import methods we will cover: 1. Neo4j Desktop 2. Neo4j Sandbox Neo4j Desktop Filepath for Neo4j Desktop will vary based on your operating… Read more →

Properly escaping input data for neo4j-import

Note neo4j-import is intended to populate a new, empty database. It cannot be used to import into an existing database. When importing data using neo4j-import, make sure to review the required CSV file structure and considerations before moving on. http://neo4j.com/docs/stable/import-tool.html… Read more →

Recreating Indexes and Constraints on 3.5

This article describes the process to drop and recreate all indexes and constraints on 3.5.x. This is a recommended step after upgrading from versions earlier then 3.5 so that all indexes and constraints can be rebuilt with the latest index… Read more →

How activation keys work

Summary Activation keys are mini-contracts that are signed by Neo4j, granting access to a “feature”. Typically, features are entire applications like “Neo4j Desktop” or “Neo4j Bloom” but they may be also be used to toggle features within an application, like… Read more →

Explanation of error “DeadlockDetectedException: ForsetiClient[0] can’t acquire ExclusiveLock…​ …​”

Under specific scenarios a DeadlockDetectedException may be encountered and the behavior is described at http://neo4j.com/docs/stable/transactions-deadlocks.html. When a DeadlockDetected is encountered one option is to simply retry the statement. As a deadlock detection error is a safe-to-retry error and the user… Read more →

Neo4j specific http request user agent strings

For those APOC commands that retrieve data using HTTP/HTTPS, and or running Cypher LOAD CSV the request will be sent with Neo4j specific user-agent/browser identifiers. Below is an example log from an Apache webservers access log at /var/log/apache2/access.log and includes… Read more →

Understanding transaction and lock timeouts

One way to handle runaway queries is to impose a time limit that will terminate a query when exceeded. There are some subtleties here that need to be understood to ensure proper behavior and avoid confusion. Defining a transaction timeout… Read more →

Control number of file handles created per Lucene Index

In the more recent Neo4j versions (3.4 onwards), the number of file handles opened by Neo4j may seem to increase compared with that in older versions. Native indexes require a per-index constant number of file handles, and this number scales… Read more →

How do I configure init and max java heap when running bin/neo4j-backup

When running $NEO4J_HOME/bin/neo4j-backup if a Java out of heap/memory error occurs you may want define the init and max Java heap to be used by neo4j-backup. The default behavior is to allow the JVM to define the init and max… Read more →

Explanation of error “Security Error: 18” when using Internet Explorer and Neo4j Browser

When connecting to the Neo4j Browser http://localhost:7474 and using Internet Explorer 11, submission of cypher statements may result in error message Security Error: 18 As the Neo4j Browser is using websockets to connect , for example ws://localhost, you would need… Read more →

Understanding Database Growth

The easiest way to determine the size of your graph is through the filesystem and summing up the size of the files named *store.db*. For example on linux implementations one can run du -hc $NEO4J_HOME/data/databases/graph.db/*store.db* and this should be run… Read more →

Where is my neo4j.log in Ubuntu Linux?

In most Neo4j server environments, all logs will be found in NEO4J_HOME/logs. However, when Neo4j is running as a service on a Ubuntu (debian) Linux environment, usually installed via apt-get install neo4j or similar, the neo4j.log is not present. To… Read more →

java.lang.OutOfMemoryError: unable to create new native thread

When a client application establishes a session with a Neo4j server via the bolt or bolt+routing protocols, the server allocates a thread to serve as the server-side bolt worker to handle that connection. There is no server-side limitation on the… Read more →

Retired: Changing your Garbage Collection Method to G1

Note This is already the default Garbage Collector in Neo4j 2.3+. This guide is only intended for previous versions. When to Use G1: By default, Neo4j versions 2.2 and earlier use Concurrent Mark and Sweep (CMS) for garbage collection. Customers… Read more →

A light weight approach to validating network port connectivity

If it becomes necessary to validate, particularly in a clustered environment whether Causal Cluster or High Availability, whether or not 1 instance can talk to another instance on a given port one can use linux command netcat. To Validate connectivity… Read more →

Stopping the Neo4j docker image in order to restore from a backup

In a neo4j docker installation, the neo4j-admin restore requires the neo4j service to be stopped as one can’t do a restore on a running database. Subsequently, running as a docker image, stopping neo4j server could be done using a Ctrl-C… Read more →

How do I compare two graphs for equality

If you are looking to compare 2 graphs (or sub-graphs) to determine if they are equivalent, the following Cypher will produce a md5sum of the nodes and properties to make that comparison. For example, you may wish to compare a… Read more →

Will execution_guard_enabled work in my release of Neo4j?

Background From the beginning, the execution guard was never meant to be used by the general public. However, the feature was there in the product, though undocumented, and it did work for the purpose of preventing long running queries from… Read more →

Comparing relationship properties within a path

You want to compare relationship-properties of a path, either by a global value or parameter, or with each other within a path. Basic model: (:Person {person_id:’123′})-[:FRIEND {date:’1972-01-01′}]->(m:Person {person_id:’456′}) Make sure to have an constraint OR index on your nodes: Constraint… Read more →

Launching Neo4j Desktop in Linux (Ubuntu & Debian) with an .appimage file

Note: Neo4j installation on Linux using apt-get, as per the process here: https://neo4j.com/docs/operations-manual/current/installation/linux/debian/ distributes installation files across multiple system directories e.g. var/etc, var/log, /home/neo4j etc.. A quicker way to install is using the .appimage file directly from https://neo4j.com/download/ The download… Read more →