I am attempting to connect a Dataform repository to a private Bitbucket repository using SSH authentication. The connection consistently fails with the error message “Illegal base64 character 2d” when trying to link the repository in Dataform settings, and the same error occurs when attempting to create a workspace within the Dataform repository. This indicates a fundamental issue with how the SSH private key is being parsed.
Troubleshooting Steps Performed:
-
SSH Key Generation:
- Initially generated an ED25519 SSH key pair (ssh-keygen -t ed25519).
- Later, generated a new RSA 4096-bit SSH key pair (ssh-keygen -t rsa -b 4096).
- In both cases, confirmed the private keys were generated without a passphrase (-N “”).
-
SSH Key Storage in Google Cloud Secret Manager:
- For both ED25519 and RSA keys, the private key file (without .pub extension) was stored in Google Cloud Secret Manager.
- The file was uploaded directly using the “Upload file” option in Secret Manager to avoid copy-paste formatting issues.
- Confirmed the Dataform service account ([email protected]) has the roles/secretmanager.secretAccessor role on the secret containing the private key.
-
Bitbucket SSH Key Setup:
- The public key (the .pub file content) from the generated key pair was added to the Bitbucket user account’s SSH keys (under Personal Settings → SSH keys). This was done to ensure write access, as Bitbucket’s repository “Access keys” (deploy keys) are read-only.
- Confirmed the Bitbucket user account has “Write” access to the specific repository.
-
Dataform Git Connection Configuration (SSH):
- Remote Repository URL: [email protected]:.git
- Authentication Method: Set to “SSH”.
- Secret: Selected the Secret Manager secret containing the relevant private key.
- SSH Public Host Key Value: Provided the full Bitbucket host key (e.g., bitbucket.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIazEu89wgQZ4bqs3d63QSMzYASSAVa0MuJ2e2gKTKqu+UUO or the RSA equivalent for consistency).
-
Local SSH Test (Crucial Diagnostic):
- Example: "Ran ssh -T -i ~/.ssh/dataform_bitbucket_id_rsa_FINAL [email protected] locally, and it successfully authenticated with ‘authenticated via ssh key.’ This confirms the key pair and Bitbucket setup are functional outside of GCP.
Current Status:
Despite extensive troubleshooting, including trying different SSH key types, meticulous steps for key generation and storage, and even attempting HTTPS authentication, the primary issue of the SSH private key failing to parse with “Illegal base64 character 2d” persists when configuring the Dataform repository and creating workspaces. This indicates a very low-level problem in how Google Cloud (Secret Manager/Dataform) is interpreting the private key content from Secrets Manager. Any help would be appreciated!