<@U04S8PLJWMT> "Internal Server Error: That secret...
# ask-ai
q
@kapa.ai "Internal Server Error: That secret was not found in the store! Coordinate: airbyte_workspace_d8bd2125-a963-40b9-961d-42244259635f_secret_f7007b3f-9f0d-47fc-81a5-7b1f65da731a_v1" lỗi này là gì? fix như nào?
k
Lỗi “Internal Server Error: That secret was not found in the store! Coordinate: ...” trong Airbyte xuất hiện khi hệ thống cố gắng truy xuất một secret (thông tin nhạy cảm như mật khẩu, token, v.v.) theo mã định danh (secret coordinate) nhưng không tìm thấy secret đó trong hệ thống lưu trữ secrets (như AWS Secrets Manager, GCP Secret Manager, Kubernetes Secret, v.v.). Nguyên nhân phổ biến: - Secret đã bị xóa hoặc chưa từng được lưu trữ thành công. - Có sự không đồng bộ giữa cấu hình Airbyte và hệ thống lưu trữ secrets. - Khi cập nhật cấu hình connector, Airbyte sẽ tăng version của secret (ví dụ: _v1 → _v2), nếu version mới không tồn tại hoặc bị xóa, lỗi này sẽ xảy ra. - Đôi khi thao tác qua các công cụ ngoài (như Terraform) hoặc lỗi trong quá trình migrate/deploy cũng có thể gây ra tình trạng này. Ví dụ thực tế: - Khi xóa hoặc chỉnh sửa một destination/source mà secret liên quan không còn tồn tại, bạn sẽ gặp lỗi này và có thể không thể xóa/chỉnh sửa qua UI hoặc API nữa [[destination-snowflake] Creating Snowflake destination through Terraform breaks Airbyte](https://github.com/airbytehq/airbyte/issues/34767). - Lỗi này cũng xuất hiện khi sử dụng external secret manager như AWS hoặc GCP mà secret coordinate không tồn tại hoặc không có version phù hợp [[kubernetes/secret-manager] GCP secret manager cannot store secrets](https://github.com/airbytehq/airbyte/issues/36442), [[When using AWS Secrets Manager for persisting secrets, updating a connector deletes its secret](https://github.com/airbytehq/airbyte/issues/46097)]. Cách khắc phục: 1. Kiểm tra secret coordinate: Xác định secret coordinate bị lỗi (ví dụ:
airbyte_workspace_d8bd2125-a963-40b9-961d-42244259635f_secret_f7007b3f-9f0d-47fc-81a5-7b1f65da731a_v1
) và kiểm tra xem nó có tồn tại trong hệ thống lưu trữ secrets không. 2. Khôi phục hoặc tạo lại secret: Nếu secret bị xóa, bạn cần tạo lại hoặc khôi phục secret đó với đúng coordinate và version. 3. Cập nhật lại cấu hình connector: Nếu không thể khôi phục secret, hãy xóa và tạo lại connector/source/destination liên quan để Airbyte tạo secret mới. 4. Kiểm tra cấu hình secret manager: Đảm bảo Airbyte được cấu hình đúng với hệ thống lưu trữ secrets (quyền truy cập, versioning, v.v.). 5. Tránh thao tác ngoài luồng: Hạn chế chỉnh sửa/xóa secrets trực tiếp trên secret manager mà không thông qua Airbyte để tránh mất đồng bộ. Nếu không thể tự xử lý, có thể bạn sẽ phải xóa hoàn toàn resource liên quan và tạo lại từ đầu [[destination-snowflake] Creating Snowflake destination through Terraform breaks Airbyte](https://github.com/airbytehq/airbyte/issues/34767). --- Tóm lại: Lỗi này là do Airbyte không tìm thấy secret cần thiết trong hệ thống lưu trữ secrets. Bạn cần kiểm tra, khôi phục hoặc tạo lại secret, hoặc xóa và tạo lại connector liên quan để khắc phục.
q
"Could not connect with provided configuration. Private key provided is invalid or not supported: rsa_key.p8: Cannot invoke "net.snowflake.client.jdbc.internal.org.bouncycastle.util.io.pem.PemObject.getContent()" because the return value of "net.snowflake.client.jdbc.internal.org.bouncycastle.util.io.pem.PemReader.readPemObject()" is null " Lỗi này thì sao @kapa.ai
k
A message from kapa.ai
Lỗi
"Could not connect with provided configuration. Private key provided is invalid or not supported: rsa_key.p8: Cannot invoke ... PemObject.getContent() ... because ... PemReader.readPemObject() is null"
xuất hiện khi Airbyte không thể đọc hoặc giải mã private key bạn cung cấp cho kết nối Snowflake bằng key pair authentication. Nguyên nhân phổ biến theo tài liệu Airbyte: - File private key không đúng định dạng PEM hoặc bị mã hóa sai. - Private key không phải là loại unencrypted PKCS8 PEM như Snowflake yêu cầu. - Nội dung file bị thiếu, hỏng, hoặc copy-paste không đủ dòng (ví dụ: mất dòng BEGIN/END hoặc xuống dòng). Cách khắc phục theo hướng dẫn chính thức: 1. Tạo private key đúng định dạng: Airbyte yêu cầu private key ở định dạng PKCS8 PEM, không mã hóa (unencrypted). Bạn nên tạo bằng lệnh sau:
Copy code
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
2. Kiểm tra nội dung file: Đảm bảo file bắt đầu bằng
-----BEGIN PRIVATE KEY-----
và kết thúc bằng
-----END PRIVATE KEY-----
, không bị thiếu dòng hoặc ký tự nào. 3. Không dùng private key đã mã hóa: Nếu bạn dùng lệnh tạo private key có mật khẩu (encrypted), Snowflake/Airbyte sẽ không đọc được trừ khi bạn cung cấp mật khẩu giải mã, mà hiện tại chưa hỗ trợ trực tiếp. 4. Copy-paste cẩn thận: Khi nhập key vào UI Airbyte, hãy đảm bảo giữ nguyên các dòng xuống dòng (line breaks). Nếu cần, dùng thuộc tính
"multiline": true
trong spec connector để hỗ trợ nhập nhiều dòng [[Multi-line String inputs](https://docs.airbyte.com/platform/connector-development/connector-specification-reference#multi-line-string-inputs)]. Tài liệu tham khảo: - [Snowflake source: Key pair authentication](https://docs.airbyte.com/integrations/sources/snowflake#key-pair-authentication) Nếu bạn đã làm đúng các bước trên mà vẫn gặp lỗi, hãy kiểm tra lại nội dung file private key và thử tạo lại từ đầu bằng lệnh trên.
q
@kapa.ai "Could not connect with provided configuration. Private key provided is invalid or not supported: rsa_key.p8: overrun, bytes = 1197" lỗi gì đây?
k
A message from kapa.ai
Lỗi
"Could not connect with provided configuration. Private key provided is invalid or not supported: rsa_key.p8: overrun, bytes = 1197"
thường xuất hiện khi private key bạn cung cấp cho Airbyte (kết nối Snowflake) không đúng định dạng hoặc bị lỗi trong quá trình tạo/copy. Theo tài liệu chính thức của Airbyte, để sử dụng key pair authentication với Snowflake, bạn cần tạo private key ở định dạng PKCS8 PEM, không mã hóa. Lệnh tạo đúng là:
Copy code
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
Sau đó, kiểm tra file phải bắt đầu bằng
-----BEGIN PRIVATE KEY-----
và kết thúc bằng
-----END PRIVATE KEY-----
, giữ nguyên các dòng xuống dòng khi nhập vào Airbyte [[Key pair authentication](https://docs.airbyte.com/integrations/sources/snowflake#key-pair-authentication)]. Lỗi "overrun, bytes = ..." thường do: - Private key không đúng định dạng PKCS8 PEM (có thể là PKCS1 hoặc bị mã hóa). - File bị lỗi, thiếu dòng, hoặc copy-paste không đủ dòng (mất line breaks). - Sử dụng private key đã mã hóa (có passphrase), trong khi Airbyte/Snowflake yêu cầu unencrypted key. Cách khắc phục: 1. Tạo lại private key bằng đúng lệnh trên. 2. Đảm bảo copy-paste đầy đủ, giữ nguyên line breaks. 3. Không dùng private key đã mã hóa hoặc ở định dạng khác. Nếu vẫn gặp lỗi, hãy kiểm tra lại nội dung file và thử tạo lại từ đầu theo hướng dẫn của Airbyte.
q
@kapa.ai T vừa tạo private key và public key theo tài liệu này
Copy code
In order to configure key pair authentication you will need a private/public key pair.
If you do not have the key pair yet, you can generate one using openssl command line tool
Use this command in order to generate an unencrypted private key file:

   `openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt`

Alternatively, use this command to generate an encrypted private key file:

  `openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -v1 PBE-SHA1-RC4-128 -out rsa_key.p8`

Once you have your private key, you need to generate a matching public key.
You can do so with the following command:

  `openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub`

Finally, you need to add the public key to your Snowflake user account.
You can do so with the following SQL command in Snowflake:

  `alter user <user_name> set rsa_public_key=<public_key_value>;`

and replace `<user_name>` with your user name and `<public_key_value>` with your public key.
Sau đó set public key vào snowflake thành công, sau đó, tạo destination bên airbyte với private key thì gặp lỗi
Copy code
at io.airbyte.cdk.db.jdbc.DefaultJdbcDatabase.unsafeQuery(DefaultJdbcDatabase.kt:118)
	at io.airbyte.cdk.db.jdbc.JdbcDatabase.unsafeQuery(JdbcDatabase.kt:198)
	at io.airbyte.integrations.destination.snowflake.typing_deduping.SnowflakeDestinationHandler.isSchemaExists(SnowflakeDestinationHandler.kt:504)
	at io.airbyte.integrations.destination.snowflake.typing_deduping.SnowflakeDestinationHandler.createNamespaces(SnowflakeDestinationHandler.kt:492)
	at io.airbyte.integrations.destination.snowflake.SnowflakeDestination.check(SnowflakeDestination.kt:133)
	at io.airbyte.cdk.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.kt:166)
	at io.airbyte.cdk.integrations.base.IntegrationRunner.run(IntegrationRunner.kt:119)
	at io.airbyte.cdk.integrations.base.IntegrationRunner.run$default(IntegrationRunner.kt:113)
	at io.airbyte.cdk.integrations.base.adaptive.AdaptiveDestinationRunner$Runner.run(AdaptiveDestinationRunner.kt:68)
	at io.airbyte.integrations.destination.snowflake.SnowflakeDestinationKt.main(SnowflakeDestination.kt:350)
2025-07-17 18:01:47 info INFO main i.a.c.i.b.IntegrationRunner(runInternal):224 Completed integration: io.airbyte.integrations.destination.snowflake.SnowflakeDestination
2025-07-17 18:01:47 info INFO main i.a.c.i.b.a.AdaptiveDestinationRunner$Runner(run):69 Completed destination: io.airbyte.integrations.destination.snowflake.SnowflakeDestination
2025-07-17 18:01:47 info Checking for optional control message...
2025-07-17 18:01:47 info Optional control message not found. Skipping...
2025-07-17 18:01:47 info Writing output of 424892c4-daac-4491-b35d-c6688ba547ba_e350ca1a-9924-4861-99d0-0ad124e606d3_0_check to the doc store
2025-07-17 18:01:47 info Marking workload 424892c4-daac-4491-b35d-c6688ba547ba_e350ca1a-9924-4861-99d0-0ad124e606d3_0_check as successful
2025-07-17 18:01:47 info Deliberately exiting process with code 0.
2025-07-17 18:01:47 info
2025-07-17 18:01:47 info ----- END CHECK -----
2025-07-17 18:01:47 info
k
A message from kapa.ai
Dựa trên log bạn cung cấp, quá trình check connection của Airbyte với Snowflake không báo lỗi rõ ràng mà kết thúc với exit code 0 (thành công). Tuy nhiên, bạn nói là gặp lỗi khi tạo destination với private key. Một số điểm cần lưu ý từ tài liệu và các nguồn liên quan: 1. Tạo private key đúng định dạng: Bạn đã dùng đúng lệnh tạo private key không mã hóa (
-nocrypt
), đây là định dạng mà Airbyte và Snowflake yêu cầu [[Key pair authentication](https://docs.airbyte.com/integrations/sources/snowflake#key-pair-authentication)]. 2. Set public key vào Snowflake: Bạn đã thực hiện đúng bước này. 3. Log không có lỗi rõ ràng: Log bạn gửi chỉ cho thấy các bước kiểm tra schema, tạo namespace, và kết thúc thành công. Không có dòng nào báo lỗi về key hoặc kết nối. 4. Các lỗi thường gặp khi dùng key pair: Nếu private key sai định dạng, bị mã hóa, hoặc copy-paste thiếu dòng, thường sẽ có lỗi rõ ràng như “private key provided is invalid or not supported” hoặc “overrun, bytes = ...” [[Key pair authentication](https://docs.airbyte.com/integrations/sources/snowflake#key-pair-authentication)]. 5. Trường hợp check connection thành công nhưng sync thất bại: Một số trường hợp, check connection thành công nhưng khi sync thực tế lại gặp lỗi do permission hoặc cấu hình schema/warehouse chưa đúng [[Confusing Error - No active warehouse selected in the current session](https://github.com/airbytehq/airbyte/issues/40615)]. --- ### Gợi ý xử lý - Nếu bạn chỉ gặp lỗi khi sync (không phải khi check connection): Hãy kiểm tra lại quyền của user trên Snowflake (role, warehouse, schema) vì có thể user chưa đủ quyền để tạo schema/table hoặc warehouse chưa được chọn mặc định. - Nếu gặp lỗi ở bước khác: Hãy gửi thêm log chi tiết ở bước bị lỗi thực tế (thường sẽ có dòng báo lỗi rõ ràng về key hoặc permission). - Kiểm tra lại nội dung private key: Đảm bảo file bắt đầu bằng
-----BEGIN PRIVATE KEY-----
và kết thúc bằng
-----END PRIVATE KEY-----
, không bị thiếu dòng hoặc ký tự nào. --- Tóm lại: Theo log bạn gửi, Airbyte không báo lỗi về private key và quá trình check connection đã thành công. Nếu bạn gặp lỗi ở bước khác, hãy cung cấp log chi tiết hơn ở bước đó để có thể hỗ trợ chính xác hơn. Nếu sync thất bại, hãy kiểm tra lại quyền truy cập warehouse/schema của user trên Snowflake [[Confusing Error - No active warehouse selected in the current session](https://github.com/airbytehq/airbyte/issues/40615)].
q
@kapa.ai Hình như t gửi nhầm log lỗi, log lôi đây
Copy code
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:111)
	at io.airbyte.cdk.db.jdbc.DefaultJdbcDatabase.unsafeQuery(DefaultJdbcDatabase.kt:118)
	at io.airbyte.cdk.db.jdbc.JdbcDatabase.unsafeQuery(JdbcDatabase.kt:198)
	at io.airbyte.integrations.destination.snowflake.typing_deduping.SnowflakeDestinationHandler.isSchemaExists(SnowflakeDestinationHandler.kt:504)
	at io.airbyte.integrations.destination.snowflake.typing_deduping.SnowflakeDestinationHandler.createNamespaces(SnowflakeDestinationHandler.kt:492)
	at io.airbyte.integrations.destination.snowflake.SnowflakeDestination.check(SnowflakeDestination.kt:133)
	at io.airbyte.cdk.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.kt:166)
	at io.airbyte.cdk.integrations.base.IntegrationRunner.run(IntegrationRunner.kt:119)
	at io.airbyte.cdk.integrations.base.IntegrationRunner.run$default(IntegrationRunner.kt:113)
	at io.airbyte.cdk.integrations.base.adaptive.AdaptiveDestinationRunner$Runner.run(AdaptiveDestinationRunner.kt:68)
	at io.airbyte.integrations.destination.snowflake.SnowflakeDestinationKt.main(SnowflakeDestination.kt:350)
2025-07-17 18:04:24 info INFO main i.a.c.i.b.IntegrationRunner(runInternal):224 Completed integration: io.airbyte.integrations.destination.snowflake.SnowflakeDestination
2025-07-17 18:04:24 info INFO main i.a.c.i.b.a.AdaptiveDestinationRunner$Runner(run):69 Completed destination: io.airbyte.integrations.destination.snowflake.SnowflakeDestination
2025-07-17 18:04:24 info Checking for optional control message...
2025-07-17 18:04:24 info Optional control message not found. Skipping...
2025-07-17 18:04:24 info Writing output of 424892c4-daac-4491-b35d-c6688ba547ba_1e27b924-dd2e-4a3b-968b-e198fef7c533_0_check to the doc store
2025-07-17 18:04:24 info Marking workload 424892c4-daac-4491-b35d-c6688ba547ba_1e27b924-dd2e-4a3b-968b-e198fef7c533_0_check as successful
2025-07-17 18:04:24 info Deliberately exiting process with code 0.
2025-07-17 18:04:24 info 
2025-07-17 18:04:24 info ----- END CHECK -----
2025-07-17 18:04:24 info
k
A message from kapa.ai
Dựa trên log bạn cung cấp, quá trình check connection của Airbyte với Snowflake kết thúc với exit code 0 (thành công) và không có dòng báo lỗi rõ ràng về private key hoặc kết nối. Các dòng log chỉ thể hiện quá trình kiểm tra schema, tạo namespace, và hoàn thành check connection. Tuy nhiên, nếu bạn vẫn gặp lỗi khi sử dụng private key để tạo destination, các nguồn tài liệu Airbyte cho thấy: - Nếu private key sai định dạng, bị mã hóa, hoặc copy-paste thiếu dòng, thường sẽ có lỗi rõ ràng như “private key provided is invalid or not supported” hoặc “overrun, bytes = ...” [[Key pair authentication](https://docs.airbyte.com/integrations/sources/snowflake#key-pair-authentication)]. - Nếu check connection thành công nhưng sync thất bại, có thể do user không đủ quyền trên Snowflake hoặc warehouse/schema chưa được cấu hình đúng [[Confusing Error - No active warehouse selected in the current session](https://github.com/airbytehq/airbyte/issues/40615)]. Tóm lại: Theo log hiện tại, Airbyte không báo lỗi về private key và quá trình check connection đã thành công. Nếu bạn gặp lỗi ở bước khác (ví dụ khi sync), hãy cung cấp log chi tiết hơn ở bước đó để có thể hỗ trợ chính xác hơn. Nếu sync thất bại, hãy kiểm tra lại quyền truy cập warehouse/schema của user trên Snowflake và đảm bảo cấu hình đúng như tài liệu hướng dẫn [[Key pair authentication](https://docs.airbyte.com/integrations/sources/snowflake#key-pair-authentication)].
q
Copy code
2025-07-17 18:04:23 info 
2025-07-17 18:04:23 info ----- START CHECK -----
2025-07-17 18:04:23 info 
2025-07-17 18:04:23 info Connector exited, processing output
2025-07-17 18:04:23 info Output file jobOutput.json found
2025-07-17 18:04:23 info Connector exited with exit code 0
2025-07-17 18:04:23 info Reading messages from protocol version 0.2.0
2025-07-17 18:04:24 info INFO main i.a.c.i.b.a.AdaptiveDestinationRunner$Runner(getDestination):54 Running destination under deployment mode: OSS
2025-07-17 18:04:24 info INFO main i.a.c.i.b.a.AdaptiveDestinationRunner$Runner(run):67 Starting destination: io.airbyte.integrations.destination.snowflake.SnowflakeDestination
2025-07-17 18:04:24 info INFO main i.a.c.i.b.IntegrationCliParser$Companion(parseOptions):144 integration args: {check=null, config=/config/connectionConfiguration.json}
2025-07-17 18:04:24 info INFO main i.a.c.i.b.IntegrationRunner(runInternal):130 Running integration: io.airbyte.integrations.destination.snowflake.SnowflakeDestination
2025-07-17 18:04:24 info INFO main i.a.c.i.b.IntegrationRunner(runInternal):131 Command: CHECK
2025-07-17 18:04:24 info INFO main i.a.c.i.b.IntegrationRunner(runInternal):132 Integration config: IntegrationConfig{command=CHECK, configPath='/config/connectionConfiguration.json', catalogPath='null', statePath='null'}
2025-07-17 18:04:24 warn WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword pattern_descriptor - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2025-07-17 18:04:24 warn WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword order - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2025-07-17 18:04:24 warn WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword multiline - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2025-07-17 18:04:24 warn WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword airbyte_secret - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2025-07-17 18:04:24 warn WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword airbyte_hidden - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2025-07-17 18:04:24 info INFO main c.z.h.HikariDataSource(getConnection):109 HikariPool-1 - Starting...
2025-07-17 18:04:24 error ERROR main i.a.i.d.s.SnowflakeDestination(check):171 Exception while checking connection: net.snowflake.client.jdbc.SnowflakeSQLLoggedException: Private key provided is invalid or not supported: rsa_key.p8: overrun, bytes = 1195
	at net.snowflake.client.jdbc.DefaultSFConnectionHandler.initialize(DefaultSFConnectionHandler.java:117) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
	at net.snowflake.client.jdbc.DefaultSFConnectionHandler.initializeConnection(DefaultSFConnectionHandler.java:85) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
	at net.snowflake.client.jdbc.SnowflakeConnectionV1.initConnectionWithImpl(SnowflakeConnectionV1.java:116) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
	at net.snowflake.client.jdbc.SnowflakeConnectionV1.<init>(SnowflakeConnectionV1.java:96) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
	at net.snowflake.client.jdbc.SnowflakeDriver.connect(SnowflakeDriver.java:187) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:137) ~[HikariCP-5.1.0.jar:?]
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:360) ~[HikariCP-5.1.0.jar:?]
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:202) ~[HikariCP-5.1.0.jar:?]
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:461) ~[HikariCP-5.1.0.jar:?]
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:550) ~[HikariCP-5.1.0.jar:?]
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:98) ~[HikariCP-5.1.0.jar:?]
	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:111) ~[HikariCP-5.1.0.jar:?]
	at io.airbyte.cdk.db.jdbc.DefaultJdbcDatabase.unsafeQuery(DefaultJdbcDatabase.kt:118) ~[airbyte-cdk-core-0.44.19.jar:?]
	at io.airbyte.cdk.db.jdbc.JdbcDatabase.unsafeQuery(JdbcDatabase.kt:198) ~[airbyte-cdk-core-0.44.19.jar:?]
	at io.airbyte.integrations.destination.snowflake.typing_deduping.SnowflakeDestinationHandler.isSchemaExists(SnowflakeDestinationHandler.kt:504) ~[io.airbyte.airbyte-integrations.connectors-destination-snowflake.jar:?]
	at io.airbyte.integrations.destination.snowflake.typing_deduping.SnowflakeDestinationHandler.createNamespaces(SnowflakeDestinationHandler.kt:492) ~[io.airbyte.airbyte-integrations.connectors-destination-snowflake.jar:?]
	at io.airbyte.integrations.destination.snowflake.SnowflakeDestination.check(SnowflakeDestination.kt:133) [io.airbyte.airbyte-integrations.connectors-destination-snowflake.jar:?]
	at io.airbyte.cdk.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.kt:166) [airbyte-cdk-core-0.44.19.jar:?]
	at io.airbyte.cdk.integrations.base.IntegrationRunner.run(IntegrationRunner.kt:119) [airbyte-cdk-core-0.44.19.jar:?]
	at io.airbyte.cdk.integrations.base.IntegrationRunner.run$default(IntegrationRunner.kt:113) [airbyte-cdk-core-0.44.19.jar:?]
	at io.airbyte.cdk.integrations.base.adaptive.AdaptiveDestinationRunner$Runner.run(AdaptiveDestinationRunner.kt:68) [airbyte-cdk-core-0.44.19.jar:?]
	at io.airbyte.integrations.destination.snowflake.SnowflakeDestinationKt.main(SnowflakeDestination.kt:350) [io.airbyte.airbyte-integrations.connectors-destination-snowflake.jar:?]

Stack Trace: net.snowflake.client.jdbc.SnowflakeSQLLoggedException: Private key provided is invalid or not supported: rsa_key.p8: overrun, bytes = 1195
	at net.snowflake.client.jdbc.DefaultSFConnectionHandler.initialize(DefaultSFConnectionHandler.java:117)
	at net.snowflake.client.jdbc.DefaultSFConnectionHandler.initializeConnection(DefaultSFConnectionHandler.java:85)
	at net.snowflake.client.jdbc.SnowflakeConnectionV1.initConnectionWithImpl(SnowflakeConnectionV1.java:116)
	at net.snowflake.client.jdbc.SnowflakeConnectionV1.<init>(SnowflakeConnectionV1.java:96)
	at net.snowflake.client.jdbc.SnowflakeDriver.connect(SnowflakeDriver.java:187)
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:137)
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:360)
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:202)
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:461)
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:550)
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:98)
	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:111)
	at io.airbyte.cdk.db.jdbc.DefaultJdbcDatabase.unsafeQuery(DefaultJdbcDatabase.kt:118)
	at io.airbyte.cdk.db.jdbc.JdbcDatabase.unsafeQuery(JdbcDatabase.kt:198)
	at io.airbyte.integrations.destination.snowflake.typing_deduping.SnowflakeDestinationHandler.isSchemaExists(SnowflakeDestinationHandler.kt:504)
	at io.airbyte.integrations.destination.snowflake.typing_deduping.SnowflakeDestinationHandler.createNamespaces(SnowflakeDestinationHandler.kt:492)
	at io.airbyte.integrations.destination.snowflake.SnowflakeDestination.check(SnowflakeDestination.kt:133)
	at io.airbyte.cdk.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.kt:166)
	at io.airbyte.cdk.integrations.base.IntegrationRunner.run(IntegrationRunner.kt:119)
	at io.airbyte.cdk.integrations.base.IntegrationRunner.run$default(IntegrationRunner.kt:113)
	at io.airbyte.cdk.integrations.base.adaptive.AdaptiveDestinationRunner$Runner.run(AdaptiveDestinationRunner.kt:68)
	at io.airbyte.integrations.destination.snowflake.SnowflakeDestinationKt.main(SnowflakeDestination.kt:350)

2025-07-17 18:04:24 info INFO main i.a.c.i.b.IntegrationRunner(runInternal):224 Completed integration: io.airbyte.integrations.destination.snowflake.SnowflakeDestination
2025-07-17 18:04:24 info INFO main i.a.c.i.b.a.AdaptiveDestinationRunner$Runner(run):69 Completed destination: io.airbyte.integrations.destination.snowflake.SnowflakeDestination
2025-07-17 18:04:24 info Checking for optional control message...
2025-07-17 18:04:24 info Optional control message not found. Skipping...
2025-07-17 18:04:24 info Writing output of 424892c4-daac-4491-b35d-c6688ba547ba_1e27b924-dd2e-4a3b-968b-e198fef7c533_0_check to the doc store
2025-07-17 18:04:24 info Marking workload 424892c4-daac-4491-b35d-c6688ba547ba_1e27b924-dd2e-4a3b-968b-e198fef7c533_0_check as successful
2025-07-17 18:04:24 info Deliberately exiting process with code 0.
2025-07-17 18:04:24 info 
2025-07-17 18:04:24 info ----- END CHECK -----
2025-07-17 18:04:24 info
@kapa.ai log lỗi đây
k
A message from kapa.ai
Lỗi bạn gặp phải:
Copy code
Exception while checking connection: net.snowflake.client.jdbc.SnowflakeSQLLoggedException: Private key provided is invalid or not supported: rsa_key.p8: overrun, bytes = 1195
Nguyên nhân: Theo tài liệu chính thức của Airbyte, lỗi này xuất hiện khi private key bạn cung cấp cho kết nối Snowflake không đúng định dạng mà Snowflake JDBC driver yêu cầu. Cụ thể, lỗi
"overrun, bytes = ..."
thường xảy ra khi: - Private key không phải định dạng PKCS8 PEM (có thể là PKCS1 hoặc bị mã hóa). - File private key bị lỗi, thiếu dòng, hoặc copy-paste không đủ dòng (mất line breaks). - Sử dụng private key đã mã hóa (có passphrase), trong khi Airbyte/Snowflake yêu cầu unencrypted key. Cách khắc phục theo tài liệu Airbyte: 1. Tạo lại private key đúng định dạng PKCS8 PEM, không mã hóa:
Copy code
bash    openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
2. Kiểm tra nội dung file: Đảm bảo file bắt đầu bằng
-----BEGIN PRIVATE KEY-----
và kết thúc bằng
-----END PRIVATE KEY-----
, giữ nguyên các dòng xuống dòng khi nhập vào Airbyte. Nếu copy-paste vào UI, phải giữ nguyên line breaks, không được dồn thành một dòng [[Key pair authentication](https://docs.airbyte.com/integrations/sources/snowflake#key-pair-authentication)]. 3. Không dùng private key đã mã hóa: Nếu bạn dùng lệnh tạo private key có mật khẩu (encrypted), Snowflake/Airbyte sẽ không đọc được trừ khi bạn cung cấp mật khẩu giải mã, mà hiện tại chưa hỗ trợ trực tiếp. 4. Kiểm tra lại quá trình copy-paste: Nếu nhập key vào UI Airbyte, hãy đảm bảo trường nhập liệu hỗ trợ multi-line (nhiều dòng). Nếu bạn là developer, hãy dùng thuộc tính
"multiline": true
trong spec connector để hỗ trợ nhập nhiều dòng [[Multi-line String inputs](https://docs.airbyte.com/platform/connector-development/connector-specification-reference#multi-line-string-inputs)]. Tóm lại: Bạn cần tạo lại private key đúng định dạng PKCS8 PEM, không mã hóa, và đảm bảo nhập đầy đủ, đúng format vào Airbyte. Lỗi này hoàn toàn liên quan đến định dạng và nội dung private key, không phải do cấu hình Snowflake hay Airbyte khác. Nếu đã làm đúng các bước trên mà vẫn gặp lỗi, hãy kiểm tra lại nội dung file và thử tạo lại từ đầu theo hướng dẫn của Airbyte [[Key pair authentication](https://docs.airbyte.com/integrations/sources/snowflake#key-pair-authentication)].
q
t đã làm đúng rồi, vẫn bị lỗi @kapa.ai
k
A message from kapa.ai
Nếu bạn đã tạo private key đúng theo hướng dẫn của Airbyte (dùng lệnh
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
), đã giữ nguyên format và line breaks khi nhập vào Airbyte, nhưng vẫn gặp lỗi
"Private key provided is invalid or not supported: ... overrun, bytes = ..."
, thì đây là một vấn đề đã từng được cộng đồng Airbyte phản ánh. Theo tài liệu và các issue liên quan, nguyên nhân phổ biến nhất vẫn là định dạng hoặc nội dung private key không đúng chuẩn PKCS8 PEM, hoặc quá trình copy-paste vào UI bị mất dòng hoặc ký tự đặc biệt. Ngoài ra, một số trường hợp có thể do connector hoặc driver của Snowflake không nhận đúng định dạng key, hoặc có bug liên quan đến việc xử lý key trong Airbyte [[Key pair authentication](https://docs.airbyte.com/integrations/sources/snowflake#key-pair-authentication)]. Tuy nhiên, trong các nguồn tài liệu bạn cung cấp, không có hướng dẫn xử lý nào khác ngoài việc tạo lại key đúng chuẩn và đảm bảo nhập đúng format. Nếu bạn đã làm đúng tất cả các bước mà vẫn gặp lỗi này, thì rất tiếc, các knowledge sources hiện tại không cung cấp thêm giải pháp nào khác cho trường hợp này. Bạn có thể cân nhắc: - Thử tạo lại key trên một máy khác hoặc với phiên bản openssl khác. - Đảm bảo không có ký tự lạ, khoảng trắng thừa, hoặc lỗi encoding khi copy-paste. - Nếu có thể, thử nhập key trực tiếp từ file thay vì copy-paste vào UI. Nếu vẫn không được, bạn nên mở issue mới trên Github của Airbyte hoặc tham khảo các issue tương tự để nhận được hỗ trợ từ cộng đồng hoặc đội ngũ phát triển, vì các tài liệu hiện tại không có thêm thông tin để xử lý trường hợp này.
q
@kapa.ai
Copy code
Internal Server Error: That secret was not found in the store! Coordinate: airbyte_workspace_d8bd2125-a963-40b9-961d-42244259635f_secret_90564192-8abc-4f31-8f0b-121ac8ecf305_v1
Khi t cập nhật private key của destination, t bị lỗi trên, fix như nào?
k
A message from kapa.ai
Lỗi
"Internal Server Error: That secret was not found in the store! Coordinate: ..."
khi bạn cập nhật private key cho destination trong Airbyte thường xảy ra khi hệ thống không tìm thấy secret tương ứng trong secret store (như AWS Secrets Manager, GCP Secret Manager, v.v.). Nguyên nhân và cách khắc phục theo tài liệu: 1. Nguyên nhân: - Khi bạn thay đổi cấu hình lưu trữ secret (ví dụ chuyển từ local sang AWS/GCP Secret Manager), tất cả các connector hiện tại sẽ bị lỗi vì không tìm thấy secret cũ trong secret store mới. Bạn cần xóa và tạo lại các connector để chúng sử dụng secret store mới [[Secret Management - Values](https://docs.airbyte.com/platform/deploying-airbyte/integrations/secrets#values)]. - Nếu secret đã bị xóa hoặc không được tạo thành công trong secret store, Airbyte sẽ không thể truy xuất và sẽ báo lỗi này [[Github Issue #36754](https://github.com/airbytehq/airbyte/issues/36754)]. 2. Cách khắc phục: - Xóa và tạo lại destination/source: Đây là cách được khuyến nghị khi bạn thay đổi cấu hình secret store hoặc gặp lỗi secret không tồn tại. Việc này sẽ giúp Airbyte tạo lại secret mới đúng với cấu hình hiện tại. - Kiểm tra và đồng bộ secret store: Đảm bảo secret store (AWS/GCP/Azure) đang hoạt động bình thường và Airbyte có đủ quyền truy cập để đọc/ghi secrets. - Không chỉnh sửa/xóa secret trực tiếp trên secret manager: Việc này có thể làm mất đồng bộ giữa Airbyte và secret store, dẫn đến lỗi trên. Lưu ý: Nếu bạn đã thử xóa và tạo lại destination mà vẫn gặp lỗi, hãy kiểm tra lại cấu hình secret manager và đảm bảo các bước tạo secret được thực hiện đúng như tài liệu hướng dẫn [[Secret Management - Values](https://docs.airbyte.com/platform/deploying-airbyte/integrations/secrets#values)]. --- Tóm lại: Bạn nên xóa destination bị lỗi và tạo lại mới để Airbyte tạo secret mới tương ứng với cấu hình hiện tại của secret store. Đây là cách xử lý được khuyến nghị trong tài liệu chính thức của Airbyte khi gặp lỗi không tìm thấy secret trong store.
q
@kapa.ai t đâu co dùng các dịch vụ store đâu, t đang đổi private key ngay trên giao diện airbyte mà
k
A message from kapa.ai
Cảm ơn bạn đã làm rõ. Nếu bạn không dùng external secret manager (AWS, GCP, Azure...) mà chỉ đổi private key trực tiếp trên giao diện Airbyte, nhưng vẫn gặp lỗi:
Copy code
Internal Server Error: That secret was not found in the store! Coordinate: airbyte_workspace_xxx_secret_xxx_v1
thì theo tài liệu chính thức, Airbyte vẫn lưu trữ secrets (như private key) trong database cấu hình mặc định của nó, nhưng vẫn sử dụng cơ chế "secret coordinate" để quản lý các trường nhạy cảm [[Understanding Secrets](https://docs.airbyte.com/platform/next/understanding-airbyte/secrets)]. Nguyên nhân có thể: - Secret coordinate cũ đã bị xóa hoặc database cấu hình bị lỗi đồng bộ. - Khi cập nhật cấu hình (ví dụ đổi private key), Airbyte sẽ tạo version mới cho secret coordinate. Nếu quá trình này gặp lỗi hoặc database bị lỗi, secret mới không được lưu, dẫn đến lỗi trên khi truy xuất. Cách khắc phục theo tài liệu: - Xóa và tạo lại destination/source: Nếu gặp lỗi này, cách xử lý được khuyến nghị là xóa destination/source bị lỗi và tạo lại mới để Airbyte tạo secret mới và đồng bộ lại với database cấu hình [[Secret Management - Values](https://docs.airbyte.com/platform/deploying-airbyte/integrations/secrets#values)]. - Kiểm tra database cấu hình: Đảm bảo database cấu hình của Airbyte không bị lỗi hoặc mất dữ liệu. Tóm lại: Dù bạn không dùng external secret manager, lỗi này vẫn có thể xảy ra do cơ chế quản lý secret nội bộ của Airbyte. Bạn nên xóa destination bị lỗi và tạo lại mới để khắc phục. Nếu vẫn gặp lỗi, có thể database cấu hình của Airbyte đang gặp vấn đề và cần kiểm tra sâu hơn. Nếu bạn cần giữ lại cấu hình cũ, hãy backup thông tin trước khi xóa.
q
Nếu xóa destination đi thì các connector đã tạo phải làm sao? @kapa.ai
k
A message from kapa.ai
Nếu bạn xóa một destination trong Airbyte, tất cả các connection đang sử dụng destination đó sẽ bị ảnh hưởng. Cụ thể, các connection này sẽ không thể tiếp tục sync dữ liệu cho đến khi bạn cấu hình lại destination mới cho chúng. Theo tài liệu, khi bạn xóa một destination, bạn cần tạo lại destination mới và sau đó cập nhật lại các connection để trỏ tới destination mới này. Nếu không, các connection sẽ không hoạt động bình thường vì không còn destination để ghi dữ liệu đến [[Upgrading to Destinations V2 - Quick Start to Upgrading](https://docs.airbyte.com/release_notes/upgrading_to_destinations_v2#quick-start-to-upgrading)]. Tóm lại: - Xóa destination sẽ làm các connection liên quan bị gián đoạn. - Bạn cần tạo destination mới và cập nhật lại các connection để tiếp tục sử dụng. Nếu bạn cần giữ lại lịch sử hoặc cấu hình, hãy backup thông tin trước khi xóa.
q
@kapa.ai nếu vậy thì api update destination k hoạt động à?
k
A message from kapa.ai
API update destination (ví dụ:
PATCH /destinations/{destinationId}
hoặc
PUT /destinations/{destinationId}
) vẫn hoạt động trong Airbyte, cho phép bạn cập nhật thông tin của một destination, bao gồm cả cấu hình và các trường nhạy cảm như private key. Tuy nhiên, nếu có sự cố với secret (ví dụ: secret coordinate không còn tồn tại trong store hoặc database cấu hình bị lỗi), việc cập nhật có thể gặp lỗi như bạn đã thấy: “That secret was not found in the store!”. Cụ thể, API update destination sẽ ghi đè toàn bộ cấu hình destination, và nếu secret cũ không còn hoặc không đồng bộ, thao tác này sẽ thất bại với lỗi Internal Server Error [[Airbyte Public API - Destinations > Methods](https://raw.githubusercontent.com/airbytehq/airbyte-platform/f284238f0099c4c0a3542d4c42a88773c45c363d/airbyte-api/src/main/openapi/api.yaml)]. Tóm lại: - API update destination về mặt chức năng vẫn hoạt động. - Nếu gặp lỗi secret không tồn tại, thao tác update sẽ thất bại và bạn cần xóa rồi tạo lại destination để khắc phục lỗi này [[Github Issue #36754](https://github.com/airbytehq/airbyte/issues/36754)].