Skip to content

Invalid private key, Error code 0002 #1089

@filipqlrf

Description

@filipqlrf

I'm trying to deploy the connector using a private key option. To hide the private key, I wanted to use some of the config providers.
I tried AWS secretManager, file and env provider. All of the fail with the same issue:

Exception: Invalid private key
Error Code: 0002
Detail: private key should be a valid PEM RSA private key
Message: java.security.InvalidKeyException: Unable to decode key

I am sure the private key is correct, when I paste it directly into the configuration, the connector works.
My config is as follows:

"config.providers": "env",
"config.providers.file.class": "org.apache.kafka.common.config.provider.EnvVarConfigProvider",
"connector.class": "com.snowflake.kafka.connector.SnowflakeSinkConnector",
"snowflake.schema.name": "public",
"snowflake.private.key": "${env:SNOWFLAKE_SECRET}",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"value.converter": "com.snowflake.kafka.connector.records.SnowflakeJsonConverter",
...

Are there any restrictions for the config providers? What is the best way to inject the secret values?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions