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

arango.exceptions.AsyncJobResultError : job 1530399 not done #226

Closed
aaqibb13 opened this issue Oct 25, 2022 · 7 comments
Closed

arango.exceptions.AsyncJobResultError : job 1530399 not done #226

aaqibb13 opened this issue Oct 25, 2022 · 7 comments
Assignees

Comments

@aaqibb13
Copy link

  • I'm executing AQL queries by creating the AsyncDatabase instance of database from arango.database.StandardDatabase.begin_async_execution and even after executing simple insert queries, it returns AsyncJobResultError too often.
    The query simply looks like:
# db is the AsyncDatabase instance of the database
 result = db.insert_document(
       collection="test",
        document=doc_in_db,
        return_new=return_new,
        sync=sync
    )
 result = wait_for_results(result)
 return result
  • I used the wait_for_results function to wait for the job to finish, but it didn't help either: The wait_for_results looks like this:
def wait_for_results(job):
    while job.status() != 'done':
        time.sleep(0.5)
    time.sleep(0.5)
    return job.result()

It returns:

Any pointers on how the problem can be fixed?

@tjoubert
Copy link
Contributor

@aaqibb13, we are looking into this issue and will send you some feedback soon.

@tjoubert tjoubert self-assigned this Oct 31, 2022
@tjoubert
Copy link
Contributor

tjoubert commented Oct 31, 2022

@aaqibb13, I am trying to reproduce the issue, without any luck so far. Here is the code that I am using:

import time

from arango import (
    ArangoClient,
    AQLQueryExecuteError,
    AsyncJobCancelError,
    AsyncJobClearError
)

client = ArangoClient(hosts="http://localhost:8529")

sdb = client.db('<dbName>', username='<userName>', password='<password>')
adb = sdb.begin_async_execution(return_result=True)

job = adb.collection('<collection_name>').insert(
    document={'name': 'James'},
    return_new=True,
    sync=True)

while job.status() != 'done':
    time.sleep(0.5)

result = job.result()

This code works fine. The value of result on the last line is:
{'_id': 'persons/390575', '_key': '390575', '_rev': '_fA5Mlxq---', 'new': {'_key': '390575', '_id': 'persons/390575', '_rev': '_fA5Mlxq---', 'name': 'James'}}
The name of my collection is persons.

I am using the latest version of the driver (7.5.2) with ArangoDB 3.10. Can you try the above code on your side and confirm whether it works please?
Also, confirm the version of the driver and ArangoDB server that you are using.

@aaqibb13
Copy link
Author

aaqibb13 commented Nov 1, 2022

Hey @tjoubert , thanks for you response. I was using an earlier version of the driver (7.5.1). After I upgraded to the version you specified, my code worked just fine!
Also, I'm using the ArangoDB server version 3.9.3.

Can you kindly confirm whether the issue actually exists with python-arango version 7.5.1?

@tjoubert
Copy link
Contributor

tjoubert commented Nov 1, 2022

Hi @aaqibb13, that's very good news that your code is now working.
FYI, I tested the same code with python-arango 7.5.1 and ArangoDB 3.9.3 and it works.
Thanks for reporting the issue.

@aaqibb13
Copy link
Author

aaqibb13 commented Nov 1, 2022

Hey @tjoubert, I have a CI/CD pipeline for the project that I'm working on. I tried to reproduce the issue locally but to no avail (The same queries works just fine locally). However, when I hit the endpoint where the queries is being run, the problem arises.

The logs I shared (arango.exceptions.AsyncJobResultError : job 1530399 not done) were from my remote (my deployment)

Is there something I'm missing? I'm curious!

@joowani
Copy link
Contributor

joowani commented Nov 2, 2022

Hey @aaqibb13,

This sounds like a server-side issue. Could you provide the full stacktrace of the error? Please include both the HTTP and the DB error code. Thanks.

@joowani
Copy link
Contributor

joowani commented Feb 1, 2023

Closing due to inactivity. @aaqibb13 please feel free to reopen if you still have issues.

@joowani joowani closed this as completed Feb 1, 2023
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

3 participants