Something happened to the labels

Something went wrong with my neo4j community 3.3.0 database.
When I run in the browser
match (n) return n limit 1
The query doesn’t return, just keeps spinning in the browser, and I get the following error (in the linux terminal running neo4j )
ERROR Client triggered an unexpected error [LabelAccessFailed]: Label retrieved through kernel API should exist.

When I run this command in the shell
match (n) return n limit 1
I get back something:
| Node[335339]{property1:0,property2:0}

but running schema throws
RuntimeException: org.neo4j.kernel.api.exceptions.LabelNotFoundKernelException: Label by id 8'
and running match (n) return labels(n) limit 1
throws QueryExecutionException: Label by id 1

I tried to google "LabelAccessFailed" and "LabelNotFoundKernelException" but didn't see anything relevant.

Any help, suggestions are appreciated.


You should upgrade at least. .0 releases tend to be the most buggy, you should at least be on the latest patch version for the minor version of interest. Here's the [3.3.x changelog], though you should know we're up to 3.5.x by now.

Hi @andrew.bowman, I'm having similar issues where I'm trying to upgrade from 3.5.6 to either 4.1.9 or 4.2.7. Neither is working and I am receiving an error of:

Caused by: org.neo4j.kernel.impl.storemigration.StoreUpgrader$UnableToUpgradeException: Failure doing migration
	at org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrateToIsolatedDirectory(
	at org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrate(
	at org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrateIfNeeded(
	at org.neo4j.kernel.impl.storemigration.DatabaseMigrator.migrate(
	at org.neo4j.kernel.database.Database.upgradeStore(
	at org.neo4j.kernel.database.Database.start(
	... 14 more
Caused by: org.neo4j.internal.kernel.api.exceptions.LabelNotFoundKernelException: Label with id=15 not found
	at org.neo4j.kernel.impl.storemigration.RecordStorageMigrator.getEntityTokenNames(
	at org.neo4j.kernel.impl.storemigration.RecordStorageMigrator$SchemaNameGiver.ensureHasUniqueName(
	at org.neo4j.kernel.impl.storemigration.RecordStorageMigrator.schemaGenerateNames(
	at org.neo4j.kernel.impl.storemigration.RecordStorageMigrator.migrateSchemaRules(
	at org.neo4j.kernel.impl.storemigration.RecordStorageMigrator.migrateSchemaStore(
	at org.neo4j.kernel.impl.storemigration.RecordStorageMigrator.migrate(
	at org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrateToIsolatedDirectory(
	... 19 more
Caused by: org.neo4j.token.api.TokenNotFoundException: Token for id 15

How do I fix this issue?

Hi @andrew.bowman, can you please explain why we're having the issue stated by David and me but more importantly how to fix it?

I haven't seen that one. You might want to try a consistency check on your db first and make sure that passes. If it spots inconsistencies, then you can use store-utils to copy out the db, omitting anything inconsistent, and checking the state of your labels afterward.

Thank you so much Andrew!
RE: the Consistency checker, having run cmd line C:\Users\owner\Documents\neo4j-community-356\bin>neo4j-admin check-consistency --database graph.db, there are a number of lines that seem to return what has already been confirmed, see this text file...
inconsistencies-2021-06- (2.0 KB)
It seems that running this doesn't fix anything, it just confirms issues.

RE: the store-utils, I'm having difficulty understanding all of the directions and paths. Here's where I'm at...

### Usage
As directed, I've cd'd to the dir for \store-util-3.5.6
I don't understand what either of the following are asking me to do, or where I run or edit...

export NEO4J_HOME=/path/to/neo4j
# remove target db
rm -rf /path/to/fixed.db

### Config
I've set up my file with source and target like this...

### General Usage
I then ran the following in the cmd line...

C:\Users\owner\Documents\store-util-3.5.6> community source.db target.db

I am expecting 'some target .db thing' to show up in my C:\Users\owner\Documents\new356 dir, but no-go at the moment.

What am I missing?