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]: fix-me-experimental fails with "no such file or directory pyproject.toml" #6223

Open
1 task done
neubig opened this issue Jan 13, 2025 · 5 comments · May be fixed by #6350
Open
1 task done

[Bug]: fix-me-experimental fails with "no such file or directory pyproject.toml" #6223

neubig opened this issue Jan 13, 2025 · 5 comments · May be fixed by #6350
Assignees
Labels
bug Something isn't working

Comments

@neubig
Copy link
Contributor

neubig commented Jan 13, 2025

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Describe the bug and reproduction steps

The fix-me-experimental workflow is failing with a "no such file or directory" error on the OpenHands repo:

13:57:45 - openhands:INFO: resolve_issue.py:476 - Finished.
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/resolve_issue.py", line 652, in <module>
    main()
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/openhands/resolver/resolve_issue.py", line 631, in main
    asyncio.run(
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/asyncio/base_events.py", line 686, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/openhands/resolver/resolve_issue.py", line [45](https://github.com/All-Hands-AI/OpenHands/actions/runs/12748739518/job/35529589182#step:10:46)9, in resolve_issue
    output = await process_issue(
             ^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/openhands/resolver/resolve_issue.py", line 195, in process_issue
    await runtime.connect()
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/openhands/runtime/impl/docker/docker_runtime.py", line 133, in connect
    self.runtime_container_image = build_runtime_image(
                                   ^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/openhands/runtime/utils/runtime_build.py", line 137, in build_runtime_image
    result = build_runtime_image_in_folder(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/openhands/runtime/utils/runtime_build.py", line 173, in build_runtime_image_in_folder
    lock_tag = f'oh_v{oh_version}_{get_hash_for_lock_files(base_image)}'
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/openhands/runtime/utils/runtime_build.py", line 312, in get_hash_for_lock_files
    with open(src, 'rb') as f:
         ^^^^^^^^^^^^^^^

ERROR:root:<class 'FileNotFoundError'>: [Errno 2] No such file or directory: '/opt/hostedtoolcache/Python/3.12.8/x[64](https://github.com/All-Hands-AI/OpenHands/actions/runs/12748739518/job/35529589182#step:10:65)/lib/python3.12/site-packages/pyproject.toml'

OpenHands Installation

Other

OpenHands Version

main

Operating System

None

Logs, Errors, Screenshots, and Additional Context

No response

@neubig neubig added the bug Something isn't working label Jan 13, 2025
@enyst
Copy link
Collaborator

enyst commented Jan 13, 2025

This looks related to or a consequence of #5972

When trying to build the runtime image, it doesn't have the openhands project paths set as expected - it doesn't look for pyproject.toml in the project directory.

Note: the resolver builds with pip, while we use poetry. Now that it's integrated in the core openhands, we should probably consider migrating installations in the resolver to poetry, otherwise this discrepancy can introduce subtle, time-consuming bugs.
(while I'm not sure it's the cause here, it's at least part of the difficulty to debug this kind of issue. The github action linked above installed "openhands experimental" with pip.)

@zchn
Copy link

zchn commented Jan 18, 2025

@openhands-agent might be able to fix it: the bug is because when publishing to pypi, the workflow uses ./build.sh, and in ./build.sh, it copies both pyproject.toml and poetry.lock to the openhands directory at line 4 before running poetry build -v. However, when using the fix-me-experimental feature in the .github/workflows/openhands-resolver.yml workflow, it executes pip install git+https://github.com/all-hands-ai/openhands.git to install the openhands-ai package, so there is no cp pyproject.toml poetry.lock openhands executed before the package installation and consequently no pyproject.toml and poetry.lock in the package installed.

Instead of running cp pyproject.toml poetry.lock openhands in build.sh, the right way to add additional files into the build package should be changing the packages section in pyproject.toml from

{ include = "openhands/**/*" }

to

  { include = "openhands/**/*" },
  { include = "pyproject.toml", to = "openhands" },
  { include = "poetry.lock", to = "openhands" }

The cp pyproject.toml poetry.lock openhands command in build.sh should be removed since it is no longer needed.

See zchn@5c78a59 for how I changed pyproject.toml based on the description above.

@enyst
Copy link
Collaborator

enyst commented Jan 19, 2025

@openhands-agent Read @zchn 's comment, read the files it mentions, and implement the fix.

NOTE: this issue is #6223 and you need to read all posts in it to understand the issue. You can use github API to do that.

@openhands-agent
Copy link
Contributor

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

@openhands-agent
Copy link
Contributor

A potential fix has been generated and a draft PR #6350 has been created. Please review the changes.

yanrui27 added a commit to yanrui27/OpenHands that referenced this issue Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
5 participants