Skip to content

Conversation

@Grand-Duc
Copy link
Contributor

It seems that commit ba590a7 introducing modification to database.py broke az.py filter_kwargs dict :

[lib.cuckoo.core.scheduler] ERROR: Failed to find next serviceable task
Traceback (most recent call last):
File "/opt/CAPEv2/lib/cuckoo/core/scheduler.py", line 119, in do_main_loop_work
task, machine = self.find_next_serviceable_task(max_machines_reached)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/CAPEv2/lib/cuckoo/core/scheduler.py", line 154, in find_next_serviceable_task
task, machine = self.find_pending_task_to_service()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/CAPEv2/lib/cuckoo/core/scheduler.py", line 196, in find_pending_task_to_service
machine = self.machinery_manager.find_machine_to_service_task(task_candidate)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/CAPEv2/lib/cuckoo/core/machinery_manager.py", line 209, in find_machine_to_service_task
machine = self.machinery.find_machine_to_service_task(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/CAPEv2/modules/machinery/az.py", line 627, in find_machine_to_service_task
filtered_machines = self.db.filter_machines_to_task(include_reserved=False, **filter_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: _Database.filter_machines_to_task() got an unexpected keyword argument 'machines'

As 'machines' was replaced with 'statement' in filter_machines_to_task()

I did not review and understood all changes which resulted from this commit, but it corrected the issue on my tests.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Grand-Duc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses and fixes a TypeError that was introduced in the Azure machinery module (az.py) following a recent commit to database.py. The error specifically arose because the filter_kwargs dictionary was passing an incorrect keyword argument (machines instead of statement) to the filter_machines_to_task function. The change ensures that the machine filtering logic functions correctly for Azure environments, restoring proper operation.

Highlights

  • Bug Fix: Resolves a TypeError in modules/machinery/az.py that occurred when calling _Database.filter_machines_to_task() due to an unexpected keyword argument.
  • Parameter Alignment: Updates the filter_kwargs dictionary in az.py to use statement instead of machines as the key for passing the machine query, aligning with recent changes in database.py.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes a critical bug in the Azure machinery module, where a TypeError occurred due to a keyword argument name change in a recent commit. The fix replaces machines with statement in the filter_kwargs dictionary, aligning with the updated filter_machines_to_task function signature. My review confirms this change is correct and necessary. I've also added a comment regarding a related code style inconsistency with SQLAlchemy versions for future maintainability improvements.

@doomedraven doomedraven merged commit 2debad2 into kevoreilly:master Nov 20, 2025
3 checks passed
@doomedraven
Copy link
Collaborator

thank you

@doomedraven
Copy link
Collaborator

could you please check this update to use sqlalchemy 2? #2756

@Grand-Duc Grand-Duc deleted the fix/azure branch November 20, 2025 13:59
doomedraven added a commit that referenced this pull request Nov 30, 2025
* Update AdaptixBeacon yara and add NitrogenBunnyDownloader yara

* add missing hash

* add missing update

* Gemini nags

* Additional Rhadamanthys patterns

* Switch Suricata installation to version 7.0

Comment out the repository for Suricata 8 and use Suricata 7.0 instead.

* Remove test_handle_process_invalid_data() from tests/test_analyzer.py

* Tweak Rhadamanthys patterns

- removed highly variable jump size in conditional jump (0x2e6 bytes code, size highly brittle)
- replaced eax register in nice characteristic pattern as it can only be eax, since pattern contains the xor eax, eax instruction by which the code zeroes)

* Rhadamanthys anti-anti detonation bypass

* Rhadamanthys detection patterns

* Enable protocol extended information to be generated without a TLS master secret (#2739)

* Update NitroBunnyDownloader yara

* Bump django from 5.1.13 to 5.1.14 (#2742)

Bumps [django](https://github.com/django/django) from 5.1.13 to 5.1.14.
- [Commits](django/django@5.1.13...5.1.14)

---
updated-dependencies:
- dependency-name: django
  dependency-version: 5.1.14
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update startup.py

* Fix path handling for SHA256 calculation

* Update startup.py

* Monitor updates: see changelog for details

* analyzer: remove obsolete 'suspended' parameter from CommandPipeHandler

* Update routing.rst

* Fix error list entry format in demux.py

* prevent linux parsing errors (#2744)

* Rhadamanthys unhook bypass

* Add Suricata host (#2745)

* Rename surihhost to surihost in search.html

* Add 'surihost' key to Suricata alert mapping

* Update lib/cuckoo/common/web_utils.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Monitor update: Add config option for monitor injection into supplied pid or "explorer" for shell: monitor=<pid/"explorer">

* SmokeLoader 2025

* Update installation step to include KnowledgeBaseBot

Install dependencies from both requirements files.

* Bump django from 5.1.13 to 5.1.14 (#2749)

Bumps [django](https://github.com/django/django) from 5.1.13 to 5.1.14.
- [Commits](django/django@5.1.13...5.1.14)

---
updated-dependencies:
- dependency-name: django
  dependency-version: 5.1.14
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ci: Update requirements.txt

* Refactor auto_answer.yml to streamline dependency installation

Updated the workflow to install dependencies using uv run with specified requirements files.

* fix docs

* Fix a bug that prevents terminal status from being reported by the agent (#2753)

Updates the POST /status endpoint to unset the async subprocess if the new status is terminal. This makes GET /status report the final analysis state, rather than the child process state.

* Fix 'machines' vars on Azure (#2755)

* Monitor update: Fix issue with RESUME: monitor message from NtResumeProcess hook

* Bump pypdf from 5.2.0 to 6.4.0 (#2757)

Bumps [pypdf](https://github.com/py-pdf/pypdf) from 5.2.0 to 6.4.0.
- [Release notes](https://github.com/py-pdf/pypdf/releases)
- [Changelog](https://github.com/py-pdf/pypdf/blob/main/CHANGELOG.md)
- [Commits](py-pdf/pypdf@5.2.0...6.4.0)

---
updated-dependencies:
- dependency-name: pypdf
  dependency-version: 6.4.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Prevent on_complete execution for matched signatures (#2758)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: enzok <7831008+enzok@users.noreply.github.com>
Co-authored-by: Yung Binary <93540406+YungBinary@users.noreply.github.com>
Co-authored-by: Kevin O'Reilly <kevoreilly@gmail.com>
Co-authored-by: Fernando Domínguez <6620286+FernandoDoming@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Santos <44490090+dsecuma@users.noreply.github.com>
Co-authored-by: Bart <3075118+bartblaze@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <action@github.com>
Co-authored-by: Josh Feather <142008135+josh-feather@users.noreply.github.com>
Co-authored-by: Lilian <86776930+Grand-Duc@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

2 participants