ssh-deploy icon indicating copy to clipboard operation
ssh-deploy copied to clipboard

Build keeps failing to Flywheel

Open sabrinamatthews opened this issue 3 years ago • 1 comments

[INPUTS] SSH_PRIVATE_KEY is mandatory ⚠️ [INPUTS] REMOTE_USER is mandatory ⚠️ [INPUTS] Inputs not valid, aborting ...

I have been following this doc https://getflywheel.com/wordpress-support/deploying-to-flywheel-via-ssh-and-github-actions/ to deploy to my website hosted on Flywheel. It is an organization and I know my SSH_USER is correct, team+org-name+site-name which is what I have. I am pretty sure my SSH_REMOTE_KEY is incorrect. Currently I have my id_ed25519 private key pasted in the secret. But it is saying to have it in PEM version. When I run this command in my Terminal on my Macbook Pro 2019, I get this error:

Command: openssl rsa -in ~/.ssh/id_rsa -outform pem | pbcopy Response: unable to load Private Key 4658441900:error:09FFF06C:PEM routines:CRYPTO_internal:no start line:/System/Volumes/Data/SWE/macOS/BuildRoots/2288acc43c/Library/Caches/com.apple.xbs/Sources/libressl/libressl-56.60.2/libressl-2.8/crypto/pem/pem_lib.c:684:Expecting: ANY PRIVATE KEY

I am not that great with GIT workflows, this is my first set up for a workflow so bear with me. But can anyone tell me why this is wrong?????

My private key that I pasted into my secrets within my Repo:

-----BEGIN OPENSSH PRIVATE KEY----- long key code goes here, removed for security -----END OPENSSH PRIVATE KEY-----

Everything else is working great. I am able to check in code, check out code, edit, add, delete. I really need to be able to deploy.

sabrinamatthews avatar Aug 22 '21 06:08 sabrinamatthews

Usually no start line error indicates that the PEM file is missing the indicator that the key portion has begun.

Just try openssl rsa -in ~/.ssh/id_rsa -outform pem and see if the generated id_rsa key generated is in the following format

-----Begin <Type>-----

Key Information

-----End <Type>-----

limatgans avatar Oct 13 '21 07:10 limatgans

Having the same issue here!

alexmacarthur avatar Dec 09 '22 05:12 alexmacarthur

Macbook using RSA, Linux using ed25519

in the Live site Flywheel using RSA --> it will works and Staging site is using ed25519 --> i've still no luck with this one

dwinurhadia avatar Dec 09 '22 17:12 dwinurhadia

@dwinurhadia I faced a similar issue. Seems like ssh-deploy supports only RSA and not ed25519. Mods and admins, Please correct me if I am wrong

I tried creating a new RSA key and it worked. Try again by generating a RSA key. (Refer https://github.com/easingthemes/ssh-deploy#1-ssh_private_key-required).

limatgans avatar Dec 09 '22 17:12 limatgans

@limatgans please deploy with runs-on: macos-latest

it will works

dwinurhadia avatar Dec 09 '22 18:12 dwinurhadia

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Feb 03 '23 02:02 github-actions[bot]

I was able to solve for this by updating my yml file to use the latest version of easingthemes/ssh-deploy. I was on 2.1.5. Here is my new updated working yml file. This is for develop branch. I have another for my master branch as well. Hope this is helpful to someone.

name: Development Deploy on: push: branches: [ develop ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Deploy to Server uses: easingthemes/[email protected] env: SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} REMOTE_HOST: ssh.getflywheel.com REMOTE_USER: ${{ secrets.REMOTE_USER_DEVELOPMENT }} REMOTE_PORT: '22 -o PubkeyAcceptedKeyTypes=+ssh-rsa' ARGS: -rltgoDzvO --exclude .git --exclude .github TARGET: /www/wp-content/themes/

ghost avatar Mar 07 '23 22:03 ghost

Thanks for the update.

SSH_CMD_ARGS are now available as a param (ENV var), so no need to use REMOTE_PORT hack. Screenshot 2023-03-08 at 21 23 40

https://github.com/easingthemes/ssh-deploy#11-ssh_cmd_args-optional-default--o-stricthostkeycheckingno

easingthemes avatar Mar 08 '23 20:03 easingthemes

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Apr 08 '23 01:04 github-actions[bot]