DozerDB / dozerdb-core

DozerDB Plugin Core Project
GNU General Public License v3.0
17 stars 1 forks source link

Staring with Neo4j 5.14.0 - Neo4j community checks for a procedure called dbms.licenseAgreementDetails which does not exist in community #3

Closed jmsuhy closed 7 months ago

jmsuhy commented 7 months ago

Staring with Neo4j 5.14.0 - Neo4j community checks for a procedure called dbms.licenseAgreementDetails which does not exist in community.

This does not cause an issue - but it logs an error message indicating the procedure does not exist in the log.

We can fix this by simply Overwriting the BoltStateHandler.java class to return the default instead of checking if a license exists.

Before:

private LicenseDetails getTrialStatus() { try { final var record = session.run("CALL dbms.licenseAgreementDetails()", SYSTEM_TX_CONF) .single(); return LicenseDetails.parse( record.get("status").asString(), record.get("daysLeftOnTrial", 0L), record.get("totalTrialDays", 0L)); } catch (Exception e) { log.warn("Failed to fetch trial status", e); return LicenseDetailsImpl.YES; } }

TO

private LicenseDetails getTrialStatus() { return LicenseDetailsImpl.YES; }

Error that is shown in logs in community.

org.neo4j.bolt.protocol.common.fsm.error.TransactionStateTransitionException: There is no procedure with the name dbms.licenseAgreementDetails registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed. at org.neo4j.bolt.protocol.common.fsm.transition.transaction.CreateStatementStateTransition.process(CreateStatementStateTransition.java:56) at org.neo4j.bolt.protocol.common.fsm.transition.transaction.CreateStatementStateTransition.process(CreateStatementStateTransition.java:32) at org.neo4j.bolt.protocol.common.fsm.transition.transaction.TransactionalStateTransition.process(TransactionalStateTransition.java:42) at org.neo4j.bolt.fsm.state.MultiTransitionState.process(MultiTransitionState.java:53) at org.neo4j.bolt.fsm.StateMachineImpl.process(StateMachineImpl.java:151) at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.lambda$submit$4(AtomicSchedulingConnection.java:122) at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.executeJob(AtomicSchedulingConnection.java:336) at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.doExecuteJobs(AtomicSchedulingConnection.java:315) at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.executeJobs(AtomicSchedulingConnection.java:221) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)

jmsuhy commented 7 months ago

We can actually disable this via the dozerdb-browser much easier as the query is originating from the browser.

jmsuhy commented 7 months ago

Fixed this in the dozerdb-browser project.