getappmap / navie-benchmark

Navie benchmarks
MIT License
0 stars 0 forks source link

Connection error #53

Closed kgilpin closed 1 month ago

kgilpin commented 2 months ago

https://github.com/getappmap/navie-benchmark/actions/runs/10941138268/job/30380171392#step:7:1645

Based on what I see in navie-editor, I don't understand the trace that I'm seeing here.

https://github.com/getappmap/navie-editor/commit/e9e9c3047ff8cf0315655e5eaf9b2535426b7ea0#diff-0129a1ed4d7e98d4ae385fab8eea2a28c3b2ac992ffbf18c78bc4d7936d48fdfR378

github-actions[bot] commented 2 months ago

Title

Resolve Connection Error in GitHub Actions Workflow for navie-benchmark

Problem

The GitHub Actions workflow for the navie-benchmark project is failing due to a connection error, and the trace provided is unclear.

Analysis

The connection error could arise from various factors such as network issues, incorrect configurations, or missing dependencies. Based on the provided workflow configuration and the trigger context, it's important to examine several points where connections are made to external resources. Potential culprits include the setup of Python environments, Docker registry login, AppMap, or interactions with external APIs like Navie or OpenAI.

Given that the provided link points to a commit in the navie-editor repository, this implies dependency or integration issues between navie-benchmark and navie-editor.

Proposed Changes

To resolve the connection error:

  1. Check Network Connectivity and Configurations:

    • Ensure that all network calls in the workflows are valid and the endpoints are reachable.
  2. Verify API Keys and Secrets:

    • Make sure the OPENAI_API_KEY, GITHUB_TOKEN, and any other required secrets are correctly configured in the GitHub repository settings.
  3. Validate Dependencies:

    • Ensure all dependencies are correctly installed and accessible. Pay special attention to virtual environments and the installation of navie-editor dependencies.
  4. Add Logging for Better Traceability:

    • Enhance logging within the workflow steps to provide more granular information about where the failure might be occurring.

Specific Changes

  1. .github/workflows/solve.yml:

    • Add Additional Debugging: Enhance logging to capture more detailed information about the errors.
  2. solver/workflow/solve_base.py:

    • Improve Error Handling: Add more robust error handling and logging within the key methods interacting with external resources. This will aid in diagnosing the issue.
  3. solver/workflow/summarize_test_errors.py:

    • Review API Interaction: Since the summarize_test_errors relies on Editor.ask, confirm that the Editor instance is connecting correctly to its backend services.

Example Adjustments:

  1. .github/workflows/solve.yml: Add a step to print environment variables and check network connectivity.

      - name: Print Environment Variables and Check Connectivity
        run: |
          env
          curl -I https://api.openai.com/v1/models
  2. solver/workflow/solve_base.py: Enhance error handling in critical methods.

    <!-- file: /home/runner/work/navie-benchmark/navie-benchmark/solver/workflow/solve_base.py -->
    ```python
        try:
            subprocess.run(cmd, shell=True, check=True, capture_output=True)
        except subprocess.CalledProcessError as e:
            self.log("workflow", f"Error resetting git state: {e}")
            raise
  3. solver/workflow/summarize_test_errors.py: Ensure detailed logging when interacting with the Editor.

    <!-- file: /home/runner/work/navie-benchmark/navie-benchmark/solver/workflow/summarize_test_errors.py -->
    ```python
    try:
        errors = editor.ask(
            question,
            options="/noprojectinfo /nocontext /noclassify",
        )
    except Exception as e:
        log("summarize-test-errors", f"Error querying editor: {e}")
        raise

These changes aim to provide more context around the failure and ensure that all necessary components are appropriately configured and logged. This should help in identifying and resolving the connection issue.

dividedmind commented 2 months ago

It seems that the command replaces the log file instead of appending to it.

kgilpin commented 2 months ago

Can you fix it?

kgilpin commented 1 month ago

Resolved via updates to appmap-js.