checkout: maxBuffer length exceeded

Hi, I get the below error when running checkoutv2 I always need to delete the contents of the repo for all build. _work/api

Deleting the contents of '/home/ubuntu/actions-runner/_work/api/api'
##[error]stderr maxBuffer length exceeded

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 20
  • Comments: 20 (4 by maintainers)

Most upvoted comments

Adding the below step before the checkout step fixed the problem. It would be a hack until this is fixed or know why this is happening? Maybe the docker image checkouts the branch as root?

    - name: cleanup #https://github.com/actions/checkout/issues/211
      run: |
        sudo chown -R $USER:$USER $GITHUB_WORKSPACE

The logs for the same. The list is huge for permissions denied just pasting the top ones.

Run actions/checkout@v2
Syncing repository: ***********
Getting Git version info
/usr/bin/git config --local --get remote.origin.url
https://github.com/*******/*******
Removing previously created refs, to avoid conflicts
Cleaning the repository
##[warning]Unable to clean or reset the repository. The repository will be recreated instead.
Deleting the contents of '/home/ubuntu/actions-runner/_work/api/api'
##[error]Command failed: rm -rf "/home/ubuntu/actions-runner/_work/api/api/storage"
rm: cannot remove '/home/ubuntu/actions-runner/_work/api/api/storage/************': Permission denied
rm: cannot remove '/home/ubuntu/actions-runner/_work/api/api/storage/l*************': Permission denied

My solution has been to add a step in pipeline executing a SSH command to delete project folder in _work folder (first step of them)

FYI: I observed that after rebasing branch in git. As a temporary workaround I removed _work directory and restarted the runner

I think we the gitlab runner user should not have admin privileges using sudo, if so anyone with permissions to modify the github actions pipeline could cause damage to the self runner if he wanted. If the checkout actions is not able to remove existing files from the workspace it could be because these files are not own by the gitlab runner user. Maybe another github actions that ran previously has a defect and creates files in the folder owned by the root user.

Sounds like a permission issue. The issue below seems to be related. https://github.com/actions/checkout/issues/211#issue-596402242