Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings on Lambda due to failure to select default profile #398

Closed
nmoutschen opened this issue Jan 12, 2022 · 2 comments
Closed

Warnings on Lambda due to failure to select default profile #398

nmoutschen opened this issue Jan 12, 2022 · 2 comments
Labels
bug This issue is a bug.

Comments

@nmoutschen
Copy link
Contributor

What is the problem?

When using the AWS SDK for Rust in a Lambda function, it generates 14 tracing events with INFO and WARN log levels during initialization, due to a lack of ~/.aws folder and default profile in a Lambda environment.

Version

├── aws-config v0.4.1 │ ├── aws-http v0.4.1 │ │ ├── aws-smithy-http v0.34.1 │ │ │ ├── aws-smithy-types v0.34.1 │ │ ├── aws-smithy-types v0.34.1 () │ │ ├── aws-types v0.4.1 │ │ │ ├── aws-smithy-async v0.34.1 │ │ │ ├── aws-smithy-types v0.34.1 () │ ├── aws-sdk-sts v0.4.1 │ │ ├── aws-endpoint v0.4.1 │ │ │ ├── aws-smithy-http v0.34.1 () │ │ │ ├── aws-types v0.4.1 () │ │ ├── aws-http v0.4.1 () │ │ ├── aws-sig-auth v0.4.1 │ │ │ ├── aws-sigv4 v0.4.1 │ │ │ │ ├── aws-smithy-http v0.34.1 () │ │ │ ├── aws-smithy-http v0.34.1 () │ │ │ ├── aws-types v0.4.1 () │ │ ├── aws-smithy-async v0.34.1 () │ │ ├── aws-smithy-client v0.34.1 │ │ │ ├── aws-smithy-async v0.34.1 () │ │ │ ├── aws-smithy-http v0.34.1 () │ │ │ ├── aws-smithy-http-tower v0.34.1 │ │ │ │ ├── aws-smithy-http v0.34.1 () │ │ │ ├── aws-smithy-protocol-test v0.34.1 │ │ │ ├── aws-smithy-types v0.34.1 () │ │ ├── aws-smithy-http v0.34.1 () │ │ ├── aws-smithy-http-tower v0.34.1 () │ │ ├── aws-smithy-query v0.34.1 │ │ │ ├── aws-smithy-types v0.34.1 () │ │ ├── aws-smithy-types v0.34.1 () │ │ ├── aws-smithy-xml v0.34.1 │ │ ├── aws-types v0.4.1 () │ ├── aws-smithy-async v0.34.1 () │ ├── aws-smithy-client v0.34.1 () │ ├── aws-smithy-http v0.34.1 () │ ├── aws-smithy-http-tower v0.34.1 () │ ├── aws-smithy-json v0.34.1 │ │ └── aws-smithy-types v0.34.1 () │ ├── aws-smithy-types v0.34.1 () │ ├── aws-types v0.4.1 () ├── aws-sdk-dynamodb v0.4.1 │ ├── aws-endpoint v0.4.1 () │ ├── aws-http v0.4.1 () │ ├── aws-sig-auth v0.4.1 () │ ├── aws-smithy-async v0.34.1 () │ ├── aws-smithy-client v0.34.1 () │ ├── aws-smithy-http v0.34.1 () │ ├── aws-smithy-http-tower v0.34.1 () │ ├── aws-smithy-json v0.34.1 () │ ├── aws-smithy-types v0.34.1 () │ ├── aws-types v0.4.1 () ├── aws-sdk-eventbridge v0.4.1 │ ├── aws-endpoint v0.4.1 () │ ├── aws-http v0.4.1 () │ ├── aws-sig-auth v0.4.1 () │ ├── aws-smithy-async v0.34.1 () │ ├── aws-smithy-client v0.34.1 () │ ├── aws-smithy-http v0.34.1 () │ ├── aws-smithy-http-tower v0.34.1 () │ ├── aws-smithy-json v0.34.1 () │ ├── aws-smithy-types v0.34.1 () │ ├── aws-types v0.4.1 () ├── aws-smithy-client v0.34.1 () ├── aws-smithy-http v0.34.1 () ├── aws-types v0.4.1 () ├── aws-types v0.4.1 (*)

Platform

Darwin 19.6.0 Darwin Kernel Version 19.6.0: Sun Nov 14 19:58:51 PST 2021; root:xnu-6153.141.50~1/RELEASE_X86_64 x86_64

AWS Services

DynamoDB
EventBridge

Description

When using the AWS SDK for Rust in an AWS Lambda, it produces 14 INFO and WARN tracing events for CloudWatch Logs entries related to loading files in the ~/.aws folder (non-existent on Lambda) or failure to get the default profile (also non-existent on Lambda).

I expect to not see any INFO/WARN message related to the initialization of the SDK, or at least not that many, as this is a different behavior than the other AWS SDK.

Here's the part of the code that initialize the AWS Config:

let config = aws_config::load_from_env().await;

The complete code can be found in this repository.

This is similar in nature to #307, but the warning messages are different.

Logs

Log entries from CloudWatch Logs using INFO level:

{"timestamp":"Jan 12 11:56:18.763","level":"INFO","fields":{"message":"config file not found","path":"~/.aws/config"},"target":"aws_config::profile::parser::source","span":{"name":"load_config_file"},"spans":[{"name":"get_store"},{"name":"load_config_file"}]}
{"timestamp":"Jan 12 11:56:18.763","level":"INFO","fields":{"message":"config file loaded","path":"~/.aws/config","size":"0"},"target":"aws_config::profile::parser::source","span":{"name":"load_config_file"},"spans":[{"name":"get_store"},{"name":"load_config_file"}]} 
{"timestamp":"Jan 12 11:56:18.764","level":"INFO","fields":{"message":"config file not found","path":"~/.aws/credentials"},"target":"aws_config::profile::parser::source","span":{"name":"load_credentials_file"},"spans":[{"name":"get_store"},{"name":"load_credentials_file"}]} 
{"timestamp":"Jan 12 11:56:18.764","level":"INFO","fields":{"message":"config file loaded","path":"~/.aws/credentials","size":"0"},"target":"aws_config::profile::parser::source","span":{"name":"load_credentials_file"},"spans":[{"name":"get_store"},{"name":"load_credentials_file"}]}
{"timestamp":"Jan 12 11:56:18.764","level":"WARN","fields":{"message":"failed to get selected 'default' profile"},"target":"aws_config::profile::retry_config","span":{"name":"get_store"},"spans":[{"name":"get_store"}]} 
{"timestamp":"Jan 12 11:56:18.764","level":"INFO","fields":{"message":"config file not found","path":"~/.aws/config"},"target":"aws_config::profile::parser::source","span":{"name":"load_config_file"},"spans":[{"name":"get_store"},{"name":"load_config_file"}]} 
{"timestamp":"Jan 12 11:56:18.764","level":"INFO","fields":{"message":"config file loaded","path":"~/.aws/config","size":"0"},"target":"aws_config::profile::parser::source","span":{"name":"load_config_file"},"spans":[{"name":"get_store"},{"name":"load_config_file"}]} 
{"timestamp":"Jan 12 11:56:18.764","level":"INFO","fields":{"message":"config file not found","path":"~/.aws/credentials"},"target":"aws_config::profile::parser::source","span":{"name":"load_credentials_file"},"spans":[{"name":"get_store"},{"name":"load_credentials_file"}]} 
{"timestamp":"Jan 12 11:56:18.764","level":"INFO","fields":{"message":"config file loaded","path":"~/.aws/credentials","size":"0"},"target":"aws_config::profile::parser::source","span":{"name":"load_credentials_file"},"spans":[{"name":"get_store"},{"name":"load_credentials_file"}]} 
{"timestamp":"Jan 12 11:56:18.764","level":"INFO","fields":{"message":"config file not found","path":"~/.aws/config"},"target":"aws_config::profile::parser::source","span":{"name":"load_config_file"},"spans":[{"name":"get_store"},{"name":"load_config_file"}]} 
{"timestamp":"Jan 12 11:56:18.764","level":"INFO","fields":{"message":"config file loaded","path":"~/.aws/config","size":"0"},"target":"aws_config::profile::parser::source","span":{"name":"load_config_file"},"spans":[{"name":"get_store"},{"name":"load_config_file"}]} 
{"timestamp":"Jan 12 11:56:18.764","level":"INFO","fields":{"message":"config file not found","path":"~/.aws/credentials"},"target":"aws_config::profile::parser::source","span":{"name":"load_credentials_file"},"spans":[{"name":"get_store"},{"name":"load_credentials_file"}]} 
{"timestamp":"Jan 12 11:56:18.764","level":"INFO","fields":{"message":"config file loaded","path":"~/.aws/credentials","size":"0"},"target":"aws_config::profile::parser::source","span":{"name":"load_credentials_file"},"spans":[{"name":"get_store"},{"name":"load_credentials_file"}]} 
{"timestamp":"Jan 12 11:56:18.764","level":"WARN","fields":{"message":"failed to get selected 'default' profile, skipping it"},"target":"aws_config::profile::timeout_config","span":{"name":"get_store"},"spans":[{"name":"get_store"}]} 
@nmoutschen nmoutschen added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 12, 2022
@jdisanti jdisanti removed the needs-triage This issue or PR still needs to be triaged. label Jan 12, 2022
@Velfi Velfi added pending-release This issue will be fixed by an approved PR that hasn't been released yet. and removed pending-release This issue will be fixed by an approved PR that hasn't been released yet. labels Jan 18, 2022
@Velfi
Copy link
Contributor

Velfi commented Jan 21, 2022

This was fixed in v0.5.2

@Velfi Velfi closed this as completed Jan 21, 2022
@github-actions
Copy link

⚠️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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants