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

Client stuck on query execution with security manager enabled #1565

Open
hzerip opened this issue Aug 1, 2024 · 0 comments
Open

Client stuck on query execution with security manager enabled #1565

hzerip opened this issue Aug 1, 2024 · 0 comments

Comments

@hzerip
Copy link

hzerip commented Aug 1, 2024

Neo4j version: 5-aura
Neo4j Mode: AuraDB
Driver version: Java language driver 5.22.0
Operating system: macOS/Linux

Steps to reproduce

  1. Push some data to db
  2. Create a Java Client
  3. Enable security manager
  4. Run query to get number of items
  5. The query gets stuck
  public static void main(String[] args) {
          var boltUrl = "bolt+s://%s".formatted(address);
          var driver =  GraphDatabase.driver(boltUrl, AuthTokens.basic(username, password));
  
          for (int i = 1; i <= 20; i++) {
              driver.executableQuery("CREATE (:TestSource {name: $name})")
                  .withParameters(Map.of("name", "name-" + i))
                  .execute();
          }
  
          var result = driver.executableQuery("MATCH (a: TestSource) RETURN count(a) as count").execute();
          var count = result.records().get(0).get("count").asInt();
          System.out.println("Count: " + count);
          driver.close();
  }

Execution will stuck at this line var result = driver.executableQuery("MATCH (a: TestSource) RETURN count(a) as count").execute();

After doing some debugging I found that the messageDecoderCumulator property is read at this line. Since the JSM is enabled and this property is not allowed to be read the JVM throws a SecurityException and I believe the code calls here doesn't properly handle the exception and causes client to stuck. It worked after adding this line to policy file permission java.util.PropertyPermission "messageDecoderCumulator", "read";.

It's not trivial to find the cause since there is no log, I could find it after several hours 🤦

@hzerip hzerip changed the title No query is returned even though there is data Client stuck on query execution with security manager enabled Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant