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

[Bug]: Resolver fails at the "Create draft PR or push branch" step due to openhands.resolver.patching.exceptions.HunkApplyException #6140

Open
1 task done
oconnorjoseph opened this issue Jan 8, 2025 · 7 comments
Assignees
Labels
bug Something isn't working resolver Related to OpenHands Resolver

Comments

@oconnorjoseph
Copy link

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Describe the bug and reproduction steps

The resolver fails at the "Create draft PR or push branch" step due to the following error:

Run if [ "true" == "true" ]; then
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/pydantic/_internal/_config.py:345: UserWarning: Valid config keys have changed in V2:
* 'fields' has been removed
  warnings.warn(message, UserWarning)
ERROR:root:  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/openhands/resolver/send_pull_request.py", line 766, in <module>
    main()
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/openhands/resolver/send_pull_request.py", line 750, in main
    process_single_issue(
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/openhands/resolver/send_pull_request.py", line 574, in process_single_issue
    apply_patch(patched_repo_dir, resolver_output.git_patch)
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/openhands/resolver/send_pull_request.py", line 105, in apply_patch
    new_content = apply_diff(diff, split_content)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/openhands/resolver/patching/apply.py", line 97, in apply_diff
    raise HunkApplyException(

ERROR:root:<class 'openhands.resolver.patching.exceptions.HunkApplyException'>: context line [38](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12662963041/job/35314099526#step:13:39), "      return type.getCallSignatures().length > 0;" does not match "", in hunk #1
Copied repository to output/patches/issue_130

All of the previous steps appear to run succesfully. The action ran quickly in <4mins. Attached below are the entirety of the logs.

OpenHands Installation

Docker command in README

OpenHands Version

0.19.0

Operating System

None

Logs, Errors, Screenshots, and Additional Context

logs_32793611898.zip

@mamoodi
Copy link
Collaborator

mamoodi commented Jan 8, 2025

CC @neubig and @malhotra5

@runofthemillgeek
Copy link

Seeing this as well.

@neubig
Copy link
Contributor

neubig commented Jan 8, 2025

@openhands-agent please investigate this by trying to write a test that fails with this error, and then fix the underlying problem.

@openhands-agent
Copy link
Contributor

OpenHands started fixing the issue! You can monitor the progress here.

@neubig
Copy link
Contributor

neubig commented Jan 9, 2025

@neubig neubig assigned neubig and unassigned malhotra5 Jan 9, 2025
@neubig
Copy link
Contributor

neubig commented Jan 9, 2025

OK, I have examined this and it's confusing. For some reason the resolver is trying to apply a patch to a file that differs from the actual source file that was used to generate the patch. I'm not sure why this is happening, or what might have changed in our code to cause this to break now, given that the underlying code has not changed in several weeks. This needs further investigation. I'll assign to @malhotra5 but if I have time to take a look myself I will as well.

@neubig neubig assigned malhotra5 and unassigned neubig Jan 9, 2025
@oconnorjoseph
Copy link
Author

Thank you @neubig and @malhotra5!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolver Related to OpenHands Resolver
Projects
None yet
Development

No branches or pull requests

6 participants