Giter Site home page Giter Site logo

Comments (6)

ashishdhingra avatar ashishdhingra commented on August 17, 2024

Hi @BrettBock,

Good morning.

Thanks for reporting the issue. In your case, the error seems to be thrown at AppConfigProcessor.ParseConfig() where somehow, the content type from AppConfigClient is being returned as application/json; charset=utf-8, instead of expected application/json.

I tried to reproduce the issue by creating configuration profile of type Freeform configuration profile with JSON data type and was unable to reproduce the issue.

In order to reproduce the issue end-to-end, could you please share the following:

  • AppConfig settings for:
    • Application
    • Configuration profile
    • Environment
  • Sample code solution (sample web app)

Thanks,
Ashish

from aws-dotnet-extensions-configuration.

BrettBock avatar BrettBock commented on August 17, 2024

While creating some sample code, I believe I discovered an issue. The configuration we had in AWS used AppConfig's Freeform Configuration with Amazon S3 Object. By switching to AWS AppConfig hosted configuration with JSON content, the code is now working.

Are there known issues with using S3 and AppConfig? Should a separate issue be created for working with an Amazon S3 Object?

Thank you for your help, and working this project.

from aws-dotnet-extensions-configuration.

ashishdhingra avatar ashishdhingra commented on August 17, 2024

While creating some sample code, I believe I discovered an issue. The configuration we had in AWS used AppConfig's Freeform Configuration with Amazon S3 Object. By switching to AWS AppConfig hosted configuration with JSON content, the code is now working.

Are there known issues with using S3 and AppConfig? Should a separate issue be created for working with an Amazon S3 Object?

Thank you for your help, and working this project.

@BrettBock Somehow I'm unable to reproduce the issue. Below are the steps I followed:

  • Created a new bucket with versioning enabled (AppConfig with S3 object source requires S3 bucket with versioning enabled).
  • Created below test-app-config.json:
{
    "name": "test",
    "type": "document",
    "test": "value"
}
  • In AppConfig AWS console, created a new freeform configuration profile with S3 object as source.
  • Deployed the configuration
  • In the ASP.NET application, used code builder.Configuration.AddAppConfig("<<application-id>>", "<<environment-id>>", "<<config-profile-id>>", TimeSpan.FromSeconds(30));

RESULT: I was able to retrieve the app configuration. the content type as reported at AppConfigProcessor.ParseConfig() is application/json

  • Checked the system-defined Content-Type metadata for JSON file uploaded in S3 bucket. It is listed as application/json.

Could you please:

  • Check the content type of the file at your end?
  • How is that JSON file in your case uploaded? Is it by some automated process which sets the Content-Type metadata during upload?

While it would not be a good idea to manually change the Content-Type metadata for S3 object, the simple fix could be to compare only the 1st part before ; in the content type at at AppConfigProcessor.ParseConfig() since the content-type could have extra information.

Thanks,
Ashish

from aws-dotnet-extensions-configuration.

BrettBock avatar BrettBock commented on August 17, 2024

I would agree that using just the first part of the content-type would be a good fix, since as far as I know the parser is not dependent on the encoding.

On my end:

  • By changing the S3 Metadata for Content-Type to only application/json, we are able to use the S3 file.
  • We have been using Visual Studio Code with the AWS toolkit to create and edit the S3 files.
  • Using VSCode to save the file the first time adds the additional encoding.
  • Changing the S3 Metadata appears to stick, so that future edits can be done.

Again, thank you for your help, and working this project.

from aws-dotnet-extensions-configuration.

ashishdhingra avatar ashishdhingra commented on August 17, 2024

This has been fixed in Amazon.Extensions.Configuration.SystemsManager version 5.0.2.

from aws-dotnet-extensions-configuration.

github-actions avatar github-actions commented on August 17, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

from aws-dotnet-extensions-configuration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.