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

actions/checkout@v2 breaks with "The process '/usr/bin/git' failed with exit code 1" #391

Closed
RamLavi opened this issue Nov 18, 2020 · 11 comments

Comments

@RamLavi
Copy link

RamLavi commented Nov 18, 2020

I'm running a very simple gitAction job, and it breaks in actions/checkout@v2: link

    - name: Check out code into the Go module directory
      uses: actions/checkout@v2
      with:
        ref: $BASE_BRANCH

it fails on : Fetching the repository step

Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/$BASE_BRANCH*:refs/remotes/origin/$BASE_BRANCH* +refs/tags/$BASE_BRANCH*:refs/tags/$BASE_BRANCH*
  The process '/usr/bin/git' failed with exit code 1
  Waiting 17 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/$BASE_BRANCH*:refs/remotes/origin/$BASE_BRANCH* +refs/tags/$BASE_BRANCH*:refs/tags/$BASE_BRANCH*
  The process '/usr/bin/git' failed with exit code 1
  Waiting 16 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/$BASE_BRANCH*:refs/remotes/origin/$BASE_BRANCH* +refs/tags/$BASE_BRANCH*:refs/tags/$BASE_BRANCH*
  Error: The process '/usr/bin/git' failed with exit code 1

link to full job logs

@chrispat
Copy link
Member

Do you have a ref called $BASE_BRANCH? You need to make sure you pass a valid ref or the git will fail to fetch it.

@RamLavi
Copy link
Author

RamLavi commented Nov 22, 2020

I recently moved from using set-env, using this example.
Perhaps I wasn't using it well, Issued a fix, will update here if so.

@RamLavi
Copy link
Author

RamLavi commented Nov 25, 2020

update: This issue was unrelated to the checkout repo, and fixed with this PR.
closing issue. Thanks for the help :)

@rela589n
Copy link

Having similar issue while running inside docker container.

Run actions/checkout@v2
/usr/bin/docker exec  6f48d5bd3bd6db725c4eca845768c89fe5ba74794c59e4a55c7c42c36bf0b0d7 sh -c "cat /etc/*release | grep ^ID"
Syncing repository: rela589n/doctrine-event-sourcing
Getting Git version info
Deleting the contents of '/__w/doctrine-event-sourcing/doctrine-event-sourcing'
Initializing the repository
  /usr/bin/git init /__w/doctrine-event-sourcing/doctrine-event-sourcing
  /__w/doctrine-event-sourcing/doctrine-event-sourcing/.git: Permission denied
  Error: The process '/usr/bin/git' failed with exit code 1

@hsteinshiromoto
Copy link

I have exactly the same issue. Does anyone know what's going on?

@MakisH
Copy link

MakisH commented Aug 12, 2021

I have exactly the same issue. Does anyone know what's going on?

In my case, it looks like this action works only when the active user is root, because the default directory belongs to root. I found out that I can provide an option to run as a specific user:

container:
      image: <URL>
      options: --user root

I debugged this not based on Git (as the output was not very helpful anyway), but trying to write a simple file, e.g. with date | tee dummy.log.

So, the error seems to originate from the container itself, not from the action.

Edit: See the issue #211 for a more detailed discussion and more possible solution approaches.

@AllanOricil
Copy link

@MakisH I tried what you said and it did not work. This is the container Im using

https://hub.docker.com/r/synhf/docker-sfdx-cli

What do you think it is the problem?


FROM node:latest

RUN apt-get update -y \
 && apt-get upgrade -y \
 && apt-get install -y --no-install-recommends gnupg apt-utils apt-transport-https curl git openssh-client ca-certificates jq gettext xmlstarlet bash python3 libxml2 libxml2-utils \
 && rm -rf /var/lib/apt/lists/*

# add an apt repository of chrome
# google-chrome.list will be overwritten by installing google-chrome-stabe
RUN curl -fsSL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list

# install several packages for CI
RUN apt-get update -y \
  && apt-get install -y --no-install-recommends wget gnupg google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
  && rm -rf /var/lib/apt/lists/*

RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
    && mkdir -p /home/pptruser/Downloads \
    && chown -R pptruser:pptruser /home/pptruser

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
    PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
WORKDIR /usr/app

RUN npm install -g sfdx-cli  --unsafe-perm=true --allow-root
RUN npm install -g vlocity --unsafe-perm=true --allow-root
RUN npm install puppeteer --unsafe-perm=true --allow-root
USER pptruser
# Set Default values for SFDX
ENV SFDX_AUTOUPDATE_DISABLE=false
ENV SFDX_JSON_TO_STDOUT=true
ENV SFDX_USE_GENERIC_UNIX_KEYCHAIN=true
ENV SFDX_DOMAIN_RETRY=true
ENV SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE=true
ENV SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE=true

# revert to low privilege user
ENV SHELL /bin/bash

WORKDIR /home/pptruser

COPY scripts/ scripts/

RUN echo 'y' | sfdx plugins:install sfdx-git-delta
RUN sfdx --version
RUN sfdx plugins --core
RUN vlocity -v

@dpc10ster
Copy link

I had a similar problem, but mine was a newbie error: I needed to create a gh-pages branch. That solved the problem.

Run actions/checkout@v2
Syncing repository: dpc10ster/RJafrocQuickStart
Getting Git version info
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/gh-pages*:refs/remotes/origin/gh-pages* +refs/tags/gh-pages*:refs/tags/gh-pages*
  The process '/usr/bin/git' failed with exit code 1
  Waiting 11 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/gh-pages*:refs/remotes/origin/gh-pages* +refs/tags/gh-pages*:refs/tags/gh-pages*
  The process '/usr/bin/git' failed with exit code 1
  Waiting 15 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/gh-pages*:refs/remotes/origin/gh-pages* +refs/tags/gh-pages*:refs/tags/gh-pages*
  Error: The process '/usr/bin/git' failed with exit code 1

@Hainesy
Copy link

Hainesy commented Mar 2, 2022

I had the same issue with ref: origin/develop instead of ref: develop. It would help to have a better error message here.

@roj1512
Copy link

roj1512 commented Mar 25, 2022

Same problem

@poojatiwari01
Copy link

I had the same issue with ref: origin/develop instead of ref: develop. It would help to have a better error message here.

I had a similar problem, but mine was a newbie error: I needed to create a gh-pages branch. That solved the problem.

Run actions/checkout@v2
Syncing repository: dpc10ster/RJafrocQuickStart
Getting Git version info
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/gh-pages*:refs/remotes/origin/gh-pages* +refs/tags/gh-pages*:refs/tags/gh-pages*
  The process '/usr/bin/git' failed with exit code 1
  Waiting 11 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/gh-pages*:refs/remotes/origin/gh-pages* +refs/tags/gh-pages*:refs/tags/gh-pages*
  The process '/usr/bin/git' failed with exit code 1
  Waiting 15 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/gh-pages*:refs/remotes/origin/gh-pages* +refs/tags/gh-pages*:refs/tags/gh-pages*
  Error: The process '/usr/bin/git' failed with exit code 1

Hello, how did you create github-pages branch, can you please share in code format or screenshot.

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

10 participants