Error: Private Key Must Include Matching PEM Headers and Footers
Issue
When configuring a Snowflake Activation source using key-pair authentication, saving fails with the following error, even though the private key contains the required PEM header and footer:
Private key must include matching PEM headers and footers: -----BEGIN PRIVATE KEY-----/-----END PRIVATE KEY----- or -----BEGIN ENCRYPTED PRIVATE KEY-----/-----END ENCRYPTED PRIVATE KEY-----.
Environment
- Activations
- Source: Snowflake
- Authentication: Key-pair
Resolution
To resolve this issue:
- Open your Snowflake
.p8private key file in a plain text editor. - Confirm that the key contains actual line breaks and matching headers and footers:
-----BEGIN ENCRYPTED PRIVATE KEY----- <key line 1> <key line 2> ... -----END ENCRYPTED PRIVATE KEY----- - Copy the complete, unmodified contents of the file, including the header and footer.
- In Fivetran, go to Activations > Activation Sources.
- Find your Snowflake source, then click Edit.
- Paste the key directly into the Private Key field in Fivetran. If the key contains literal
\ncharacters, replace each one with an actual line break before pasting. - Click Save Activation Source.
Cause
This issue occurs when the private key doesn’t contain valid, matching PEM headers and footers. For example, the headers or footers may be missing or mismatched, or the key may contain escaped newline characters (\n) instead of actual line breaks.