Dataform + GitHub SSH: “Failed to parse SSH private key” error

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”

I then referred to this article:
https://www.googlecloudcommunity.com/gc/Data-Analytics/Dataform-quot-Illegal-base64-character-2d-quot-for-Bitbucket-SSH/td-p/912257

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.

Hi @tsubaron ,

Welcome to Google Cloud Community!

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):

-----BEGIN OPENSSH PRIVATE KEY----- ...................................................................................................................................................................................................................................................................... -----END OPENSSH PRIVATE KEY----- 

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.

1 Like

Hi Caryna,

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 again for your support!

I hit the same error. Google Dataform appears to not be working with github on the documented path.

Hello @tsubaron,

What you need to do is:

From GitHub:

github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg= github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk= 

Here, you can use this one:

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl

Hi @LeoK,

Thanks for your detailed guidance earlier. I wanted to confirm that I’ve carefully followed each of the four points you mentioned:

  1. Create your SSH key (private / public)
    → I recreated the key using:
    ssh-keygen -t ed25519 -f ~/.ssh/dataform_ed25519 -N “”

  2. 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”

  3. Use your public key as GitHub Project Deploy keys
    → I added the public key from:
    cat ~/.ssh/dataform_ed25519.pub

  4. 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.