Peter Groves
Peter Groves

Reputation: 411

Neo4j property parsing error in embedded GraphDatabaseServer

I'm trying to load an existing neo4j database on a new machine. The old machine was running 1.9.M05, while the new one is running 1.9RC1. I simply copied the data/graph.db file from the old installation to the new one.

The server starts fine and the webadmin interface looks like everything is operating correctly.

However, when I try to access the database as an EmbeddedDatabase from Java, I get the error below saying it can't parse the mapped_memory propery. When I grep for the "bad value" of "94M" in the code base and the neo4j source, I can't find any mention of it. The webadmin interface reports the mapped_memory property is set to 45M.

If there is a bad value stored in the db files, is there a way to force a specified .props file before loading the broken settings?

The calling code:

GraphDatabaseFactory factory =                                                                                                                              
    new org.neo4j.graphdb.factory.GraphDatabaseFactory();                                                                                                   
GraphDatabaseService graphDb = factory                                                                                                                      
    .newEmbeddedDatabaseBuilder(DB_PATH)                                                                                                                    
       .loadPropertiesFromFile(NEO_HOME + "conf/neo4j.properties" )                                                                                        
          .newGraphDatabase();                                                                                                                            

The Exception:

 [java] Exception in thread "main" java.lang.IllegalArgumentException: Bad value '-94M' for setting 'neostore.propertystore.db.strings.mapped_memory': value does not match expression:\d+[kmgKMG]?
 [java]     at org.neo4j.helpers.Settings$DefaultSetting.apply(Settings.java:788)
 [java]     at org.neo4j.helpers.Settings$DefaultSetting.apply(Settings.java:708)
 [java]     at org.neo4j.graphdb.factory.GraphDatabaseSetting$SettingWrapper.apply(GraphDatabaseSetting.java:215)
 [java]     at org.neo4j.graphdb.factory.GraphDatabaseSetting$SettingWrapper.apply(GraphDatabaseSetting.java:189)
 [java]     at org.neo4j.kernel.configuration.ConfigurationValidator.validate(ConfigurationValidator.java:50)
 [java]     at org.neo4j.kernel.configuration.Config.applyChanges(Config.java:121)
 [java]     at org.neo4j.kernel.InternalAbstractGraphDatabase.create(InternalAbstractGraphDatabase.java:337)
 [java]     at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:254)
 [java]     at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:90)
 [java]     at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:85)
 [java]     at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:205)
 [java]     at com.mycompany.CMDRunner.printNeoSegments(CMDRunner.java:27)

Upvotes: 1

Views: 530

Answers (2)

Axel Morgner
Axel Morgner

Reputation: 2312

This error message is probably a bug in Neo4j which only occurs if there's not enough physical RAM available. There should be a better error message clearly indicating what prevents the startup.

Try adding more physical RAM to your machine, I recommend 1 GB or more.

Bug report: https://github.com/neo4j/neo4j/issues/746

Upvotes: 2

Nicholas
Nicholas

Reputation: 7501

Check your neo4j.properties for neostore.propertystore.db.strings.mapped_memory, as that seems to be where your problem is.

Upvotes: 2

Related Questions