Mazars-Tech/AD_Miner

exists(variable.property) is no longer supported. Please use variable.property IS NOT NULL instead

Closed this issue · 2 comments

T8aZ commented

Describe the bug
AD-miner fails with the following error when launched with default command line :

AD-miner -c -cf name  -u neo4j -p password

Tested on a Kali install, a fresh Kali docker and a fresh scoop + pipx Windows install.

Terminal Output: Kali

File "/root/.local/bin/AD-miner", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/root/.local/share/pipx/venvs/ad-miner/lib/python3.11/site-packages/ad_miner/__main__.py", line 145, in main
    extract_date, total_objects, number_relations, boolean_azure = pre_request(arguments)
                                                                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/pipx/venvs/ad-miner/lib/python3.11/site-packages/ad_miner/sources/modules/neo4j_class.py", line 90, in pre_request
    for record in tx.run(
                  ^^^^^^^
  File "/root/.local/share/pipx/venvs/ad-miner/lib/python3.11/site-packages/neo4j/_sync/work/transaction.py", line 156, in run
    result._tx_ready_run(query, parameters)
  File "/root/.local/share/pipx/venvs/ad-miner/lib/python3.11/site-packages/neo4j/_sync/work/result.py", line 120, in _tx_ready_run
    self._run(query, parameters, None, None, None, None)
  File "/root/.local/share/pipx/venvs/ad-miner/lib/python3.11/site-packages/neo4j/_sync/work/result.py", line 166, in _run
    self._attach()
  File "/root/.local/share/pipx/venvs/ad-miner/lib/python3.11/site-packages/neo4j/_sync/work/result.py", line 274, in _attach
    self._connection.fetch_message()
  File "/root/.local/share/pipx/venvs/ad-miner/lib/python3.11/site-packages/neo4j/_sync/io/_common.py", line 180, in inner
    func(*args, **kwargs)
  File "/root/.local/share/pipx/venvs/ad-miner/lib/python3.11/site-packages/neo4j/_sync/io/_bolt.py", line 658, in fetch_message
    res = self._process_message(tag, fields)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/pipx/venvs/ad-miner/lib/python3.11/site-packages/neo4j/_sync/io/_bolt5.py", line 317, in _process_message
    response.on_failure(summary_metadata or {})
  File "/root/.local/share/pipx/venvs/ad-miner/lib/python3.11/site-packages/neo4j/_sync/io/_common.py", line 247, in on_failure
    raise Neo4jError.hydrate(**metadata)
neo4j.exceptions.CypherSyntaxError: {code: Neo.ClientError.Statement.SyntaxError} {message: The property existence syntax `... exists(variable.property)` is no longer supported. Please use `variable.property IS NOT NULL` instead. (line 1, column 17 (offset: 16))
"MATCH (n) WHERE EXISTS(n.tenantid) return n LIMIT 1

Terminal Output: Windows

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "c:\users\pantoufle\.local\bin\AD-miner.exe\_main_.py", line 7, in <module>
  File "C:\Users\pantoufle\pipx\venvs\ad-miner\Lib\site-packages\ad_miner\_main_.py", line 145, in main
    extract_date, total_objects, number_relations, boolean_azure = pre_request(arguments)
                                                                   ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\pantoufle\pipx\venvs\ad-miner\Lib\site-packages\ad_miner\sources\modules\neo4j_class.py", line 90, in pre_request
    for record in tx.run(
                  ^^^^^^^
  File "C:\Users\pantoufle\pipx\venvs\ad-miner\Lib\site-packages\neo4j\_sync\work\transaction.py", line 156, in run
    result._tx_ready_run(query, parameters)
  File "C:\Users\pantoufle\pipx\venvs\ad-miner\Lib\site-packages\neo4j\_sync\work\result.py", line 120, in _tx_ready_run
    self._run(query, parameters, None, None, None, None)
  File "C:\Users\pantoufle\pipx\venvs\ad-miner\Lib\site-packages\neo4j\_sync\work\result.py", line 166, in _run
    self._attach()
  File "C:\Users\pantoufle\pipx\venvs\ad-miner\Lib\site-packages\neo4j\_sync\work\result.py", line 274, in _attach
    self._connection.fetch_message()
  File "C:\Users\pantoufle\pipx\venvs\ad-miner\Lib\site-packages\neo4j\_sync\io\_common.py", line 180, in inner
    func(*args, **kwargs)
  File "C:\Users\pantoufle\pipx\venvs\ad-miner\Lib\site-packages\neo4j\_sync\io\_bolt.py", line 658, in fetch_message
    res = self._process_message(tag, fields)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\pantoufle\pipx\venvs\ad-miner\Lib\site-packages\neo4j\_sync\io\_bolt5.py", line 317, in _process_message
    response.on_failure(summary_metadata or {})
  File "C:\Users\pantoufle\pipx\venvs\ad-miner\Lib\site-packages\neo4j\_sync\io\_common.py", line 247, in on_failure
    raise Neo4jError.hydrate(**metadata)
neo4j.exceptions.CypherSyntaxError: {code: Neo.ClientError.Statement.SyntaxError} {message: The property existence syntax ... exists(variable.property) is no longer supported. Please use variable.property IS NOT NULL instead. (line 1, column 17 (offset: 16))
"MATCH (n) WHERE EXISTS(n.tenantid) return n LIMIT 1"
                 ^}

System information

  • Windows and Kali
  • Python version 3.11

Additional context
Worked very well with last week's install. Downgrade to pipx 1.5 does not resolve the problem.

Hi
You are obviously using neo4j v5.x which is not supported by BH. You should stick to v4.x

Having said that, we should definitely modify queries where the EXISTS() function is used in lieu of IS NOT NULL. This is like the 15th time that this is reported so we will try to make an effort and adapt the few queries where this is used as to make those compliant with both v4 and v5.

I'm closing this as the initial issue is you using a version of neo4j that is clearly stated as not compatible by the BH team.

T8aZ commented

Hi You are obviously using neo4j v5.x which is not supported by BH. You should stick to v4.x

Indeed, they quote performance regression issues

Having said that, we should definitely modify queries where the EXISTS() function is used in lieu of IS NOT NULL. This is like the 15th time that this is reported so we will try to make an effort and adapt the few queries where this is used as to make those compliant with both v4 and v5.

Good to know AdMiner is not compatible with version 5. Updating the Readme might be a quicker solution. Great tool btw !