Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled Neo4jGraphQLSubscriptionsCDCEngine produces approx. 112 erroneous CDC queries per minute #6096

Closed
andreloeffelmann opened this issue Mar 17, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@andreloeffelmann
Copy link

Describe the bug
We have the Neo4jGraphQLSubscriptionsCDCEngine active with flag onlyGraphQLEvents set to true.
No other configurations set.

This setup leads to CDC queries (CALL db.cdc.query...) within the database producing the errors 52N37 and 50N42.
The errors/queries occur around 112 times / minute.
The generated queries all look the same according to the Aura Ops Manager:

CALL db.cdc.query(******, [{ select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }, { select: ******, labels: [******], txMetadata: { app: $param0 } }])

Expected behavior
An enabled subscription engine should not produce faulty CDC queries

Screenshots

Image

Image

System

@andreloeffelmann andreloeffelmann added the bug Something isn't working label Mar 17, 2025
@angrykoala
Copy link
Member

angrykoala commented Mar 18, 2025

Hi @andreloeffelmann

I've double checked and the query seems to be correct. I've noticed that those two error codes are sent when attempting to query CDC events on a database where the CDC is not enabled. Is CDC enable in FULL mode for that database?
The instructions to enable CDC for an Aura database: https://neo4j.com/docs/cdc/current/get-started/aura/

@andreloeffelmann
Copy link
Author

andreloeffelmann commented Mar 18, 2025

Hi @angrykoala, yes, CDC is enabled in FULL mode.

@angrykoala
Copy link
Member

Ok, I'm gonna need some more info then to debug this one. The number of errors seem to roughly match the CDC polling for subscriptions (~1 second, with 2 errors per failed query)

  • Do subscriptions work without the onlyGraphQLEvents flag?
  • Is the GraphQL server logging any errors?
  • Is there a GraphQL schema that you could share to replicate this issue?

Thanks

@andreloeffelmann
Copy link
Author

  • Do subscriptions work without the onlyGraphQLEvents flag?
  • Is the GraphQL server logging any errors?
    • we indeed have some error logs within the GraphQL server. But they do occur less frequently than the errors in the database
    • the following error was logged 4 times within the last 6 hours: gqlStatusDescription: 'error: general processing exception - unexpected error. Failed to connect to server. Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0. Caused by: read ECONNRESET'
    • this error was logged 2 times within the last 6 hours: gqlStatusDescription: "error: general processing exception - unexpected error. Failed to connect to server. Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0. Caused by: Connection lost. Server didn't respond in 60000ms"
    • no other errors have been logged
  • Is there a GraphQL schema that you could share to replicate this issue?
    • this is not easily possible. it's kind of internal stuff. if absolutely required we could try to find a way how to sanitize it somehow

@angrykoala
Copy link
Member

Yeah, those errors seem to be unrelated to this particular issue. Are you able to try a smaller schema to test if that still fails? I'm suspecting that this issue may be cause by the txMetadata filter having problems to filter through so many CDC events but I'd like to rule out it being a malformed query by the graphql library

@andreloeffelmann
Copy link
Author

andreloeffelmann commented Mar 24, 2025

Hey @angrykoala , so it turns out that we have had an old server with an old version of neo4j-graphql (v.6.2.0) running in parallel to our current one which no one was aware of anymore 🙄
Switching that server of solved the issue - no more failed queries.
Sorry for the inconvenience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants