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

random python exception on publish #320

Open
zoranbosnjak opened this issue Jan 9, 2025 · 0 comments
Open

random python exception on publish #320

zoranbosnjak opened this issue Jan 9, 2025 · 0 comments

Comments

@zoranbosnjak
Copy link

I have observed a situation where the publish action had succeeded (I've got a new version on test.pypi.org), but the action reported error at the end and the run is marked as failed. This problem was only observed once and I am not able to reproduce it. Nevertheless, it looks like an internal error from this action (python exception comming from requests module). The previous (manual) and subsequent (scheduled) actions were without any error. A full log of the failed run is attached. I hope the maintainers will get an idea of what went wrong from the log file. Please also let me know if there is a problem in the workflow description or if there is anything I can do to help reproduce or narrow down a problem.

1_pypi-publish.txt
0_release-build.txt

...
2025-01-09T16:20:58.4533676Z   File "/root/.local/lib/python3.12/site-packages/requests/models.py", line 822, in generate
2025-01-09T16:20:58.4534144Z     raise ChunkedEncodingError(e)
2025-01-09T16:20:58.4534940Z requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read, 106 more expected)', IncompleteRead(0 bytes read, 106 more expected))
2025-01-09T16:20:58.6396253Z Post job cleanup.
2025-01-09T16:20:58.6444404Z Cleaning up orphan processes
name: Upload Python Package

on:
  schedule:
    - cron: '0,20,40 * * * *'
  workflow_dispatch: {}

permissions:
  contents: read

jobs:
  release-build:
    runs-on: ubuntu-latest

    outputs:
      update: ${{ steps.check.outputs.update }}

    steps:
      - uses: actions/checkout@v4

      - uses: cachix/install-nix-action@master

      - name: Check versions
        id: check
        run: |
            v1=$(curl https://test.pypi.org/pypi/libasterix/json | jq '.info | .version')
            echo "Published version: $v1"

            v2=$(cat libs/python/pyproject.toml | grep "^version" | sed -e 's/version = //')
            echo "Current version: $v2"

            if [ "$v1" != "$v2" ]; then
                echo "update=proceed" | tee -a "$GITHUB_OUTPUT";
            else
                echo "update=skip" | tee -a "$GITHUB_OUTPUT";
            fi

      - name: Build release distributions
        run: |
          cd libs/python
          nix-shell
          python -m pip install build
          python -m build

      - name: Upload distributions
        uses: actions/upload-artifact@v4
        with:
          name: release-dists
          path: libs/python/dist/

  pypi-publish:
    if: ${{ needs.release-build.outputs.update == 'proceed' }}
    runs-on: ubuntu-latest
    needs:
      - release-build
    permissions:
      id-token: write

    steps:
      - name: Retrieve release distributions
        uses: actions/download-artifact@v4
        with:
          name: release-dists
          path: dist/

      - name: Publish release distributions to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          repository-url: https://test.pypi.org/legacy/
          packages-dir: dist/
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

No branches or pull requests

1 participant