Kralizek / AWSSecretsManagerConfigurationExtensions

This repository contains a provider for Microsoft.Extensions.Configuration that retrieves secrets stored in AWS Secrets Manager.
MIT License
231 stars 44 forks source link

Continuous JsonReaderExceptions thrown every couple seconds #52

Closed udlose closed 3 years ago

udlose commented 3 years ago

I just upgraded to v1.6.0 today and noticed that I'm getting these exceptions every couple of seconds while the app is idle: Exception thrown: 'Newtonsoft.Json.JsonReaderException' in Newtonsoft.Json.dll ("Unexpected character encountered while parsing number: G. Path '', line 1, position 7.")

Here is the call stack: image

image

udlose commented 3 years ago

I also see a HUGE number of exceptions from SecretsManager:

Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.Runtime.Internal.HttpErrorResponseException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in AWSSDK.Core.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Exception thrown: 'Amazon.SecretsManager.AmazonSecretsManagerException' in System.Private.CoreLib.dll
Kralizek commented 3 years ago

Is your secret value a non valid json string? I would assume this could be caused by #50

Kralizek commented 3 years ago

This commit should limit the amount of exceptions in the first case.

@udlose could you check if the artifact of this build fixes the issue?

udlose commented 3 years ago

I'm pretty sure none of our secrets are explicitly in JSON - meaning that SecretsManager would be the one responsible for returning/formatting the JSON returned to your component. There aren't any special characters used that would cause invalid JSON.

udlose commented 3 years ago

This fixed the issue for me - thanks!