Skip to content

[Bug]: Donot expect clean output when running bench command #451

Description

@Bowrna

Information about bug

When running agent job and when executing the bench command, do not load the data assuming that the data parsed will be a perfect json. Having custom apps in the folder and that could contain print statement could mess up the output of the bench commands. Say example in this case, we are getting installed apps.
Expected output:
bench --site hrms.frappe.cloud execute frappe.get_installed_apps
["frappe","erpnext"]

But for a user with custom apps and having logged prints in std out:
Actual output:
bench --site randomhrms.frappe.cloud execute frappe.get_installed_apps
✅ Duckwalk override: ...
["frappe", "erpnext", "insights", "greendigit"]

We can parse the output and figure out the expected pattern using regex and use that as input to run this job step. Otherwise the jobs will get failed.

https://github.com/frappe/agent/blob/bf88493ed9998c17fc6b42153577ef9f86ce564a/agent/site.py#L632-640

Steps to Reproduce

Run a new site from backup job in bench with custom apps having stdout prints.

In my case, the output for the bench looked like the above one.

Relevant log output / Stack trace / Full Error Message.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions