opened 12:39PM - 17 Sep 21 UTC
Looking at the [docs](https://neo4j.com/labs/apoc/4.3/overview/apoc.uuid/apoc.uu…id.install/) I tried using the apoc uuids in a new empty database. However when I restarted the server new nodes wouldn't get the uuid property anymore. Looking into the `logs\neo4j.log` I found that an exception had been thrown during server startup:
```
failed to start service uuid
org.neo4j.graphdb.NotFoundException: No such property, 'addToSetLabel'.
```
Am I missing something?
## Guidelines
Please note that GitHub issues are only meant for bug reports/feature requests. If you have questions on how to use APOC, please ask on [the Neo4j Discussion Forum](https://community.neo4j.com/c/neo4j-graph-platform/procedures-apoc) instead of creating an issue here.
## Expected Behavior (Mandatory)
After installing the APOC uuid handler to a label, whenever a new node is created with that label the uuid property is added. That also applys when the database gets restarted.
## Actual Behavior (Mandatory)
The uuid property gets added. But on neo4j server restart an exception can be seen in the logs and no uuids get added to new nodes.
## Suspected Cause
The exception (as seen in the logs) gets thrown for `addToSetLabel` and not for the config parameter `addToSetLabels` (notice the missing `s`) and destroys the uuid handler.
## How to Reproduce the Problem
### Simple Dataset (where it's possibile)
```
//Insert here a set of Cypher statements that helps us to reproduce the problem
CREATE CONSTRAINT ON (any:Foo) ASSERT any.uuid IS UNIQUE;
CALL apoc.uuid.install('Foo', {addToExistingNodes: false, uuidProperty: 'uuid'}) yield label, installed, properties, batchComputationResult;
CREATE (n:Foo) RETURN n;
// restart the server
CREATE (n:Foo) RETURN n;
CALL apoc.uuid.install('Foo', {addToExistingNodes: false, uuidProperty: 'uuid'}) yield label, installed, properties, batchComputationResult;
CREATE (n:Foo) RETURN n;
```
### Steps (Mandatory)
1. Create a new empty db
2. Install APOC plugin and and add apoc.conf file with `apoc.uuid.enabled=true`
3. Start the db
4. Execute `CREATE CONSTRAINT ON (any:Foo) ASSERT any.uuid IS UNIQUE;`
5. Execute `CALL apoc.uuid.install('Foo', {addToExistingNodes: false, uuidProperty: 'uuid'}) yield label, installed, properties, batchComputationResult;`
6. Create a new node and find out that it does get an uuid `CREATE (n:Foo) RETURN n;`
7. Restart the server
8. Look at the neo4j-logs (see Screenshots)
9. Create a new node and find out that it does not get an uuid `CREATE (n:Foo) RETURN n;`
10. Execute `CALL apoc.uuid.install('Foo', {addToExistingNodes: false, uuidProperty: 'uuid'}) yield label, installed, properties, batchComputationResult;` again
11. Create a new node and find out that it also does not get an uuid `CREATE (n:Foo) RETURN n;`
12. Check the created nodes again after some time `MATCH (n:Foo) RETURN n;` and find out that the 2 are still missing their uuids (only the first one still has a uuid).
## Screenshots (where it's possibile)
The `logs\neo4j.log` file:
```
Directories in use:
home: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c
config: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\conf
logs: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\logs
plugins: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\plugins
import: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\import
data: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\data
certificates: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\certificates
licenses: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\licenses
run: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\run
Starting Neo4j.
2021-09-17 11:54:15.922+0000 INFO Starting...
2021-09-17 11:54:20.586+0000 INFO ======== Neo4j 4.3.3 ========
2021-09-17 11:54:35.013+0000 INFO Called db.clearQueryCaches(): Query cache already empty.
2021-09-17 11:54:35.497+0000 INFO Sending metrics to CSV file at C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\metrics
2021-09-17 11:54:35.530+0000 INFO Bolt enabled on 127.0.0.1:7687.
2021-09-17 11:54:36.598+0000 INFO Remote interface available at http://localhost:7474/
2021-09-17 11:54:36.600+0000 INFO Started.
2021-09-17 11:58:47.729+0000 INFO Neo4j Server shutdown initiated by request
2021-09-17 11:58:47.729+0000 INFO Stopping...
2021-09-17 11:58:47.729+0000 INFO Stopped.
Directories in use:
home: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c
config: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\conf
logs: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\logs
plugins: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\plugins
import: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\import
data: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\data
certificates: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\certificates
licenses: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\licenses
run: C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\run
Starting Neo4j.
2021-09-17 11:58:56.458+0000 INFO Starting...
2021-09-17 11:59:00.668+0000 INFO ======== Neo4j 4.3.3 ========
2021-09-17 11:59:02.933+0000 ERROR [neo4j/403cbc4a] failed to start service uuid
org.neo4j.graphdb.NotFoundException: No such property, 'addToSetLabel'.
at org.neo4j.kernel.impl.core.NodeEntity.getProperty(NodeEntity.java:439) ~[neo4j-kernel-4.3.3.jar:4.3.3]
at apoc.uuid.UuidHandler.lambda$refresh$6(UuidHandler.java:184) ~[apoc-4.3.0.1.jar:4.3.0.1]
at java.util.Iterator.forEachRemaining(Iterator.java:133) ~[?:?]
at apoc.uuid.UuidHandler.refresh(UuidHandler.java:181) ~[apoc-4.3.0.1.jar:4.3.0.1]
at apoc.uuid.UuidHandler.start(UuidHandler.java:58) ~[apoc-4.3.0.1.jar:4.3.0.1]
at apoc.ApocExtensionFactory$ApocLifecycle.lambda$start$2(ApocExtensionFactory.java:118) ~[apoc-4.3.0.1.jar:4.3.0.1]
at java.util.HashMap.forEach(HashMap.java:1336) ~[?:?]
at apoc.ApocExtensionFactory$ApocLifecycle.lambda$start$3(ApocExtensionFactory.java:116) ~[apoc-4.3.0.1.jar:4.3.0.1]
at apoc.ApocExtensionFactory$ApocLifecycle.withNonSystemDatabase(ApocExtensionFactory.java:93) ~[apoc-4.3.0.1.jar:4.3.0.1]
at apoc.ApocExtensionFactory$ApocLifecycle.start(ApocExtensionFactory.java:115) ~[apoc-4.3.0.1.jar:4.3.0.1]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:442) ~[neo4j-common-4.3.3.jar:4.3.3]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:110) ~[neo4j-common-4.3.3.jar:4.3.3]
at org.neo4j.kernel.extension.AbstractExtensions.start(AbstractExtensions.java:82) ~[neo4j-kernel-4.3.3.jar:4.3.3]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:442) ~[neo4j-common-4.3.3.jar:4.3.3]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:110) ~[neo4j-common-4.3.3.jar:4.3.3]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:442) ~[neo4j-common-4.3.3.jar:4.3.3]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:110) ~[neo4j-common-4.3.3.jar:4.3.3]
at org.neo4j.kernel.database.Database.start(Database.java:505) ~[neo4j-kernel-4.3.3.jar:4.3.3]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:442) ~[neo4j-common-4.3.3.jar:4.3.3]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:110) ~[neo4j-common-4.3.3.jar:4.3.3]
at com.neo4j.dbms.database.EnterpriseDatabase.start(EnterpriseDatabase.java:40) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.database.MultiDatabaseManager.startDatabase0(MultiDatabaseManager.java:235) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.database.MultiDatabaseManager.startDatabase(MultiDatabaseManager.java:214) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.database.MultiDatabaseManager.forSingleDatabase(MultiDatabaseManager.java:178) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.database.MultiDatabaseManager.startDatabase(MultiDatabaseManager.java:156) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.Transition$Prepared.doTransitionAction(Transition.java:101) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.Transition$Prepared.doTransition(Transition.java:88) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.DbmsReconciler.doTransitionStep(DbmsReconciler.java:350) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.DbmsReconciler.doTransitionStep(DbmsReconciler.java:351) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.DbmsReconciler.doTransitionStep(DbmsReconciler.java:351) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.DbmsReconciler.lambda$doTransitions$12(DbmsReconciler.java:319) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.DbmsReconciler.namedJob(DbmsReconciler.java:330) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.DbmsReconciler.doTransitions(DbmsReconciler.java:320) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at com.neo4j.dbms.DbmsReconciler.lambda$doTransitions$10(DbmsReconciler.java:305) ~[neo4j-dbms-enterprise-4.3.3.jar:4.3.3]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) [?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
2021-09-17 11:59:04.771+0000 INFO Called db.clearQueryCaches(): Query cache already empty.
2021-09-17 11:59:13.170+0000 INFO Sending metrics to CSV file at C:\Users\user\.Neo4jDesktop\relate-data\dbmss\dbms-06844194-4167-493d-b9ca-6a9834a5877c\metrics
2021-09-17 11:59:13.199+0000 INFO Bolt enabled on 127.0.0.1:7687.
2021-09-17 11:59:14.194+0000 INFO Remote interface available at http://localhost:7474/
2021-09-17 11:59:14.197+0000 INFO Started.
```
## Specifications (Mandatory)
Currently used versions
### Versions
- OS: Windows 10 1909
- Neo4j: 4.3.3
- Neo4j-Apoc: 4.3.0.1
- Neo4j-Desktop: 1.4.8