I’m having trouble resolving a “Failed to parse SSH private key.” error when trying to connect Dataform with GitHub.
Here’s what I’ve tried so far:
I generated a private key using:
ssh-keygen -t rsa -b 4096 -m PEM -f ~/.ssh/xxx
When I pasted the private key including the header (-----BEGIN RSA PRIVATE KEY-----) and footer (-----END RSA PRIVATE KEY-----) into the Dataform UI, I got the following error “Illegal base64 character 2d”
and tried removing the header/footer and pasting only the Base64-encoded body. However, that resulted in
“Failed to parse SSH private key.”
According to ChatGPT, I should be able to fix the “Failed to parse SSH private key.” error by including the header/footer and pasting the full private key,but doing so leads to the original “Illegal base64 character 2d error instead.”
What is the correct way to register a private key in Dataform for GitHub SSH integration? Any advice would be greatly appreciated.
When you copy the private key, make sure it has no spaces, line breaks or special characters, as these can render the key invalid. For example for ssh-rsa it will be (imagine base64 chars instead of dots):
You should also include these rows *-----BEGIN RSA PRIVATE KEY-----*and -----END RSA PRIVATE KEY----- parts.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Thank you for the warm welcome and for the detailed guidance. I selected the private key file in the Dataform UI (including the header “-----BEGIN OPENSSH PRIVATE KEY-----” and footer “-----END OPENSSH PRIVATE KEY-----”), so there shouldn’t be any extra spaces or special characters.
However, I’m still getting the following error:
“Illegal base64 character 2d”
Could you advise if there’s anything else I should check or adjust?
Thanks for your detailed guidance earlier. I wanted to confirm that I’ve carefully followed each of the four points you mentioned:
Create your SSH key (private / public) → I recreated the key using: ssh-keygen -t ed25519 -f ~/.ssh/dataform_ed25519 -N “”
Use your private key as Dataform secret (with header / footer) → I registered the private key directly from file (so no chance of formatting issues): gcloud secrets versions add DATAFORM_SSH_KEY –project=“$PROJECT_ID” –data-file=“$HOME/.ssh/dataform_ed25519”
Use your public key as GitHub Project Deploy keys → I added the public key from: cat ~/.ssh/dataform_ed25519.pub
Use GitHub’s SSH key fingerprints as SSH public host key value → I corrected this as suggested and entered the value in the exact format: ALGORITHM BASE64_KEY_VALUE
So from my perspective, points 1–4 should all be covered. However, I’m still getting the error:
Illegal base64 character a
At this point, I’m not sure what else could be wrong — whether it’s something about the key type/format that Dataform expects, or a different issue altogether.
Do you have any further suggestions or know of any pitfalls beyond the four steps above that could cause this error?
I also ran into the “Failed to parse SSH private key” error while trying to connect Dataform with GitHub. In my case, the issue came from formatting — the private key needed to be in the correct PEM format without extra spaces or line breaks. I solved it by regenerating the SSH key, copying it carefully (using pbcopy on Mac helped), and then re-adding it in the Dataform settings. Another tip is to make sure you’re not mixing RSA with newer Ed25519 keys if your setup doesn’t support them.
For anyone who’s still struggling, this (URL Removed by Staff) can provide more clarity on handling SSH keys and GitHub integrations.