Actions random submodule checkout error

Hello,

I intermittently get this error while checking out a repo with submodules rescursiverly. The strange fact is that it was running ok, nothing changed and I can checkout the repo from anywhere else.

this is the configuration:


jobs:
  build-windows:
      runs-on: windows-2019

      steps:
      - uses: actions/checkout@v3
        with:
          # Fetches only one commit
          fetch-depth: 1
          # builder private sshkey
          ssh-key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
          submodules: recursive

and here is the error I’m getting, please notice that it is not the same submodule failing but one between many, and it happend randomly but from today also frequently:

  fetch-pack: unexpected disconnect while reading sideband packet
  Error: fatal: early EOF
  Error: fatal: unpack-objects failed
  Error: fatal: Fetched in submodule path 'deps/mysubmodule/foo/bar/reponame', but it did not contain 57864918865faa4dddee3bf6365c100fb9908a6d. Direct fetching of that commit failed.

this commit sha exists for sure. It happens after 5 - 6 minutes since the workflow run, appearently no outages happened.

Any tip would be appreciated, I’m stucked.

2 Likes

Sorry, no solution here, but just wanted to say that this also happens to me, intermittently but repeatedly, i.e. retrying the failed build just fails again, but it usually starts working again at some later time. This is really annoying and I don’t see what can be done about it.

Hello @vadz, the only stable solution I’ve found so far is to manually checkout the code with a custom step like this:

      - name: Prepare sources
        shell: powershell
        run: |
          git config --global url."https://${{ secrets.GH_ACCESS_TOKEN }}@github.com/".insteadOf "git@github.com:"
          git clone  git@github.com:myorganization/myrepo.git .
          git fetch origin +refs/pull/*:refs/remotes/*
          git checkout ${{ github.ref_name }}
          git submodule update --init --recursive

It’s a pity that the support couldn’t help me solving this without giving them permissions to access the repository but I couldn’t. At least right know I’m fine but not so happy about the story ending.

hope this could help you to temporary solve it.

1 Like

Thanks, I’m going to try this out. Is GH_ACCESS_TOKEN just your personal access token named like this?

yes,a user token that have repo:read permissions