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

Batch stuck in generating #1518

Open
matsstralbergiis opened this issue Oct 8, 2024 · 2 comments
Open

Batch stuck in generating #1518

matsstralbergiis opened this issue Oct 8, 2024 · 2 comments
Labels
documentation documentation

Comments

@matsstralbergiis
Copy link

I have set up my own instance on Ubuntu 22.04.5 LTS, following the batch setup instructions. While I can run tests interactively via the web interface without any issues, I encounter a problem when submitting a batch job with multiple domains (8 in this case). The job’s status changes to “generating,” but then it stalls, and no further progress is made.

Here’s the JSON response after submitting the job:

{ "requests": [ { "name": "Web test - 2024-10-08 15:26", "submit_date": "2024-10-08T14:27:54.756007+00:00", "finished_date": "2024-10-08T14:28:21.870057+00:00", "request_type": "web", "status": "generating", "request_id": "78324c7d75084dc48636ce116cb6a94e" } ], "api_version": "2.4.0" }

Upon examining the logs, I noticed a recurring error message from node-exporter:

node-exporter-1 | ts=2024-10-08T14:42:47.302Z caller=collector.go:169 level=error msg="collector failed" name=systemd duration_seconds=0.004339166 err="couldn't get dbus connection: An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\"(null)\" (inactive) interface=\"org.freedesktop.DBus\" member=\"Hello\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.DBus\" (bus)"

Is there something specific I’m missing in my setup that might be causing this issue? Any guidance or recommendations would be greatly appreciated!

@bwbroersma
Copy link
Collaborator

The API is lying to you, it's not generating a thing because you're doing a List requests.
This is not well documented.

I think you're doing a List requests, which does:

for batch_request in batch_requests:
request_dict = batch_request.to_api_dict()

and via to_api_dict calls _api_status:

Internet.nl/checks/models.py

Lines 1149 to 1152 in fdaa0eb

elif self.status == BatchRequestStatus.done:
if self.has_report_file():
return "done"
return "generating"

The issue is: actually this does not generate a report, but the model tells you it is.
Enabling this would however generate a lot of reports if you have a lot of old/uncached reports and would do a ?limit=0 listing.

Only a Request status, aka get_request actually does this:

if batch_request.status == BatchRequestStatus.done and not batch_request.has_report_file():
batch_async_generate_results.delay(user=user, batch_request=batch_request, site_url=get_site_url(request))

So try calling /api/batch/v2/requests/78324c7d75084dc48636ce116cb6a94e a few times.

@matsstralbergiis
Copy link
Author

Sorry for late reply. Thank you for clarifying this. Now it works as expected.

@bwbroersma bwbroersma added the documentation documentation label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation documentation
Development

No branches or pull requests

2 participants