jeffreytse / jekyll-deploy-action

🪂 A Github Action to deploy the Jekyll site conveniently for GitHub Pages.
MIT License
329 stars 44 forks source link

The deployment occasionally silently fails #64

Closed nietaki closed 6 months ago

nietaki commented 1 year ago

It's happened a couple of times for me already: the jeffreytse/jekyll-deploy-action@v0.4.0 action runs and it gets marked as successful, but doesn't push the built site to the deployment branch.

Looking at the job logs I see the following:

Deploying to nietaki/nietaki.github.io on branch gh-pages
Deploying to ***github.com/nietaki/nietaki.github.io.git
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
Initialized empty Git repository in /github/workspace/build/.git/
[master (root-commit) b482d39] jekyll build from Action c9750a65641e00149d94784206bb9204a98320d1
 158 files changed, 34502 insertions(+)
 create mode 100644 .nojekyll
 (... many lines here cut"
 create mode 100644 til/index.html
error: RPC failed; curl 55 Send failure: Connection reset by peer
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date

It doesn't happen consistently, but only every once in a while, but makes me unable to trust my CI.

I'm not sure what the error...

error: RPC failed; curl 55 Send failure: Connection reset by peer
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly

...refers to specifically, but regardless, I don't think it should be failing silently.

My workflow is pretty standard, with barely anything modified from the defaults:

name: Build and Deploy to Github Pages

on:
  push:
    branches:
      - master
  schedule:
    - cron: '30 5 * * *'

jobs:
  build_and_deploy:
    # permissions: write-all
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      # Use GitHub Actions' cache to cache dependencies on servers
      - uses: actions/cache@v3
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-

      # Use GitHub Deploy Action to build and deploy to Github
      - uses: jeffreytse/jekyll-deploy-action@v0.4.0
        with:
          provider: 'github'
          token: ${{ secrets.GITHUB_TOKEN }} # It's your Personal Access Token(PAT)
          repository: ''             # Default is current repository
          branch: 'gh-pages'         # Default is gh-pages for github provider
          jekyll_src: './'           # Default is root directory
          jekyll_cfg: '_config.yml'  # Default is _config.yml
          jekyll_baseurl: ''         # Default is according to _config.yml
          bundler_ver: '>=0'         # Default is latest bundler version
          cname: 'nietaki.com'                  # Default is to not use a cname
          actor: ''                  # Default is the GITHUB_ACTOR
          pre_build_commands: ''     # Installing additional dependencies (Arch Linux)

Let me know if there are any other details I should provide

jeffreytse commented 1 year ago

Hi @nietaki Could you provide the repo address? So that I can have a further check. : )

nietaki commented 1 year ago

The repo is https://github.com/nietaki/nietaki.github.io - I made it private recently, so I'll add you as a collaborator.

I was looking through the build history to find a run with this problem, but I think I re-ran the builds that had this problem and there doesn't seem to be any evidence left over, sorry about that. I'll keep an eye out for when it happens again.

jtmullen commented 1 year ago

having the same issue, except got the same result when I re-ran the job. Latest run can be viewed here; https://github.com/jtmullen/fsgp-2023-results/actions/runs/5021239571/jobs/9003481203

I'll try to investigate some more tomorrow.

jtmullen commented 1 year ago

I see that this may be an issue external to this action: https://github.com/orgs/community/discussions/55820

Of course it would still be better that the action fail in this scenario.

malachi-constant commented 1 year ago

I was able to resolve this for my use case by forking the action and adding git configuration to increase the http post buffer size. An optional argument for post buffer size would be a nice improvement.

longavailable commented 1 year ago

Having the same issue. The jekell repo is longavailable/longavailable.github.io.

jeffreytse commented 1 year ago

Hi @nietaki, @longavailable, @jtmullen

Thanks for your reporting. Now the issue should be fixed. Please update to the latest version jeffreytse/jekyll-deploy-action@master and try again. : )

Thanks & Regards

jeffreytse commented 1 year ago

I was able to resolve this for my use case by forking the action and adding git configuration to increase the http post buffer size. An optional argument for post buffer size would be a nice improvement.

For the alternative solution, you can use pre_build_commands option as below:

pre_build_commands: git config --global http.version HTTP/1.1; git config --global http.postBuffer 524288000;
pgpbpadilla commented 1 year ago

I was able to resolve this for my use case by forking the action and adding git configuration to increase the http post buffer size. An optional argument for post buffer size would be a nice improvement.

For the alternative solution, you can use pre_build_commands option as below:

pre_build_commands: git config --global http.version HTTP/1.1; git config --global http.postBuffer 524288000;

I just tried the version using pre_build_commands ^1 but still got

error: RPC failed; curl 55 Send failure: Connection reset by peer
send-pack: unexpected disconnect while reading sideband packet

I then reverted the change and it also failed with the same error^2. I don't know what to think anymore 😢 l

It's also quite strange that the script fails but the action reports success 🤔

For reference:

MDesplats commented 1 year ago

Hi @nietaki, @longavailable, @jtmullen

Thanks for your reporting. Now the issue should be fixed. Please update to the latest version jeffreytse/jekyll-deploy-action@master and try again. : )

Thanks & Regards

Switching to master fixed the issue for me! Thanks!

jeffreytse commented 1 year ago

Hi @pgpbpadilla, could you try to use action jeffreytse/jekyll-deploy-action@master again?

zhizhang77 commented 1 year ago

I've tried jeffreytse/jekyll-deploy-action@master but the issue still exists.

For reference: https://github.com/zhizhang77/zhizhang77.github.io/actions/runs/5047908336/jobs/9055409011

pgpbpadilla commented 1 year ago

Hi @pgpbpadilla, could you try to use action jeffreytse/jekyll-deploy-action@master again?

I did try to use your master branch, plus pre-build options and that failed. Please see the first link in my previous comment.

jeffreytse commented 1 year ago

Hi @pgpbpadilla, could u try with below command?

pre_build_commands: pacman -S --noconfirm git-lfs; git config --global http.version HTTP/1.1; git config --global http.postBuffer 524288000
davidalpert commented 1 year ago

it seems to me that this discussion is about two separate issues:

  1. the error: RPC failed; curl 55 Send failure: Connection reset by peer git error; and
  2. the step failure is silent

above I see a discussion about the git issue.

is it perhaps worth opening a second issue to discuss the fact that this action can fail silently such that the workflow can report success and you have to read the build log to see that it did not actually succeed?

jeffreytse commented 11 months ago

Hi @davidalpert @nietaki, @longavailable, @jtmullen

Now the latest version has supported to deploy site via the SSH protocol for better stability comparing with HTTP protocol, here I suggest you to switch to the SSH protocol as saying. : )

Thanks & Regards

longavailable commented 11 months ago

Hi @jeffreytse

I tested the SSH approach and met an error of ssh: command not found fatal: Could not read from remote repository.

https://github.com/longavailable/longavailable.github.io/actions/runs/5576548017/jobs/10187998571#step:5:931

Any suggestion?

Hi @davidalpert @nietaki, @longavailable, @jtmullen

Now the latest version has supported to deploy site via the SSH protocol for better stability comparing with HTTP protocol, here I suggest you to switch to the SSH protocol as saying. : )

Thanks & Regards

jeffreytse commented 11 months ago

@longavailable Could you try one more time? And before you try, you need to create a new secret named SSH_PRIVATE_KEY which content is a private key format in your repository Settings > Secrets and Variables > Actions as the following screenshot.

image

longavailable commented 11 months ago

Great job @jeffreytse . The latest commit works like a charm 👏