airbytehq / airbytehq/airbyte

When deleting Source, corresponding AWS Secret Manager Secrets Not Deleted

未关闭
#68,176 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area/platform autoteam community needs-triage team/compose team/platform-move type/bug
主要语言
Python
星标
22.1k
派生
5.3k
PR 合并指标
PR 指标待抓取

描述

### Helm Chart Version

2.0.12

### What step the error happened?

Other

### Relevant information

Deployed using Airbyte OSS / Community Edition and Airbyte version 1.8.2.

1. I create a GSC source with Google client ID, client secret, and refresh token, with AWS secrets manager integration enabled.
2. Airbyte creates 3 new AWS Secret Manager secrets as expected, corresponding to the above.
3. I delete the Airbyte source by calling `DELETE api/public/v1/sources/`
4. I expect the three secrets to be scheduled for deletion, but they are not.

The below log comes from the `airbyte-server` pod, I can look for logs in different pods if necessary (but I think they would show up here). The relevant Airbyte source code is here:

```kt

/**
* Pure function to delete secrets from persistence.
*
* @param config secret config to be deleted
* @param secretPersistence where secrets are stored
*/
@Throws(JsonValidationException::class)
fun deleteFromConfig(
config: ConfigWithSecretReferences,
secretPersistence: SecretPersistence,
) {
config.referencedSecrets.forEach { (_, secretReferenceConfig) ->
val secretCoordinate = secretReferenceConfig.secretCoordinate
// Only delete secrets that are managed by Airbyte, for organizations that aren't yet using secret references
if (secretCoordinate is AirbyteManagedSecretCoordinate && secretReferenceConfig.secretStorageId == null) {
deleteAirbyteManagedSecretCoordinate(secretCoordinate, secretPersistence)
}
}
logger.info { "Deleting secrets done!" }
}

private fun deleteAirbyteManagedSecretCoordinate(
secretCoordinate: AirbyteManagedSecretCoordinate,
secretPersistence: SecretPersistence,
) {
logger.info { "Deleting: ${secretCoordinate.fullCoordinate}" }
try {
secretPersistence.delete(secretCoordinate)
metricClient.count(
metric = OssMetricsRegistry.DELETE_SECRET_DEFAULT_STORE,
attributes = arrayOf(MetricAttribute(MetricTags.SUCCESS, "true")),
)
} catch (e: Exception) {
metricClient.count(
metric = OssMetricsRegistry.DELETE_SECRET_DEFAULT_STORE,
attributes = arrayOf(MetricAttribute(MetricTags.SUCCESS, "false")),
)
logger.error(e) { "Error deleting secret: ${secretCoordinate.fullCoordinate}" }
}
}
```

In my logs, `logger.info { "Deleting: ${secretCoordinate.fullCoordinate}" }` is never even called, so deletion is never attempted for any of the secrets, and I can't tell why. Some additional logging here would be helpful.

### Relevant log output

```shell
INFO[0;39m
i.a.c.s.SecretsRepositoryWriter(deleteFromConfig):135 - Deleting secrets done!
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。