fastai / fastpages

An easy to use blogging platform, with enhanced support for Jupyter Notebooks.
https://fastpages.fast.ai/
Apache License 2.0
3.53k stars 756 forks source link

BOOL_SAVE_MARKDOWN - SSH Error (using wrong key?) #611

Closed SamuelCochrane closed 2 years ago

SamuelCochrane commented 2 years ago

Required Prerequisites for filing a bug

You must follow ALL the steps in the troubleshooting guide. Not doing so may result in automatic closure of the issue.

Required information

  1. Steps to reproduce the problem

Please make sure you have the correct access rights and the repository exists.



2. A link to the notebook or markdown file where the error is occurring
This is a clone of the basic repo, so the only ipynb is the test one. https://github.com/SamuelCochrane/fastpages/blob/master/_notebooks/2020-02-20-test.ipynb

3. If the error is happening in GitHub Actions, a link to the specific error along with how you are able to reproduce this error.  You must provide this **in addition to the link to the notebook or markdown file**.
https://github.com/SamuelCochrane/fastpages/runs/4846879725?check_suite_focus=true
repro steps listed above.
4. A screenshot / dump of relevant logs or error messages you are receiving from your local development environment. Instructions of running a local development server is provided in the [development guide](https://github.com/fastai/fastpages/blob/master/_fastpages_docs/DEVELOPMENT.md).
NA, this is a github action issue.
![image](https://user-images.githubusercontent.com/9341531/149847983-9033a4ea-bccf-44c9-8b41-cb8f7b92c332.png)

# Other Notes
I initially ran into this issue when trying to add the `fastai/fastpages@v2.1.5` action to my existing jekyll site, and received the same error.
After a fresh clone of fastpages, doing no alterations except setting the `BOOL_SAVE_MARKDOWN` and `SSH_DEPLOY_KEY` arguments to the action, I still receive the error.
**The "Check If Secret Exists" step in the CI action passes, so it _does_ have an `SSH_DEPLOY_KEY`.**
The deploy key was created at https://8gwifi.org/sshfunctions.jsp per the instructions, with the arguments set to RSA/4096/No-passphrase.
**In the error, it states it is adding `'github.com,140.82.113.4' (ECDSA)`, which is _not_ the algorithm I selected on the website (I selected RSA per instructions)**. Would this indicate it is somehow using/generating the wrong key?
github-actions[bot] commented 2 years ago

Thank you for opening an issue. If this issue is related to a bug, please follow the steps and provide the information outlined in the Troubleshooting Guide. Failure to follow these instructions may result in automatic closing of this issue.

SamuelCochrane commented 2 years ago

Bumping this as it's been open for 2+ weeks with no response.

hamelsmu commented 2 years ago

You are problem using the wrong keys in the wrong place. Maybe you swapped them by accident?

SamuelCochrane commented 2 years ago

Hi @hamelsmu, could you elaborate?

As per above, I'm testing this on a fresh clone of Fastpages, which only has one key (SSH_DEPLOY_KEY) image ^ only one key in environment image ^ same key being used in the build action to (successfully) build the website.

    - name: convert notebooks and word docs to posts
      uses: ./_action_files
      with:
          BOOL_SAVE_MARKDOWN: true
          SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY}}

^ same key being used (unsuccessfully) to trigger the save markdown action

hamelsmu commented 2 years ago

No I mean that the private key/ public key you swapped them by accident

SamuelCochrane commented 2 years ago

I'm a little confused.

Like I mentioned the site builds OK using the SSH_DEPLOY_KEY. Would it still have worked even if it had the wrong value inside the secret?

And sidenote, have you tried my reproduction steps? It should be fairly quick using my notes to see if you get the same issue from a fresh clone of the fastpages repo. If you don't, then it's probably user error - but I'd like to confirm that you're able to get it working yourself before I close the ticket for that reason.

hamelsmu commented 2 years ago

Hello @SamuelCochrane the issue seems to be permissions. You can resolve that by setting the right permissions in your repo.

I would suggest starting over again and it should work now! I have also made some modifications to the fastpages repo such that hopefully, you will have an easier time.

I'll also update the instructions

hamelsmu commented 2 years ago

@SamuelCochrane Actually becaues of changes in GitHub Actions, you have to take extra steps for the setup to work. I have added detailed instructions in the setup section of the README to show how to resolve this error

akvsak commented 2 years ago

Thanks for your patience in helping resolve this. I too seem to be having a similar issue.

I tried re-running the failed build actions but it still gives the same error. Anything else I can do to help you identify the bug? Thanks.

p.s. normal builds without book_save_markdown = true are working fine.

This is my ci.yml file


    - name: Deploy
      if: github.event_name == 'push'
      uses: peaceiris/actions-gh-pages@v3
      with:
        deploy_key: ${{ secrets.SSH_DEPLOY_KEY }}
        publish_dir: ./_site

    - name: convert notebooks and word docs to posts
      uses: fastai/fastpages@master
      with:
        BOOL_SAVE_MARKDOWN: true
        SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}

This is the error log of the build:

1s
Run fastai/fastpages@master
  with:
    BOOL_SAVE_MARKDOWN: true
    SSH_DEPLOY_KEY: ***

  env:
    SSH_AUTH_SOCK: /tmp/ssh-auth.sock
/usr/bin/docker run --name df00be658c6c34d8a88e2c088a44c7af9_b200b1 --label 08450d --workdir /github/workspace --rm -e SSH_AUTH_SOCK -e INPUT_BOOL_SAVE_MARKDOWN -e INPUT_SSH_DEPLOY_KEY -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/www/www":"/github/workspace" 08450d:f00be658c6c34d8a88e2c088a44c7af9
Agent pid 10
No notebooks were modified
Identity added: _mykey (_mykey)
Warning: Permanently added 'github.com,140.82.112.3' (ECDSA) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

These are my permission settings:

image

hamelsmu commented 2 years ago

@akvsak I think you have switched your public/private keys

akvsak commented 2 years ago

I will check up on this and just to be clear, should the SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} be a public key or a private key?

hamelsmu commented 2 years ago

oh I see I'm not sure about this - is your repo public?

akvsak commented 2 years ago

oh I see I'm not sure about this - is your repo public?

Yes. github.com/akvsak/www/