Slackbot
10/12/2022, 1:25 AMKai Sun
10/12/2022, 1:28 AMError: Cannot construct instance of `org.apache.druid.data.input.s3.S3InputSourceConfig`, problem: accessKeyId cannot be null if secretAccessKey is given at [Source: (org.eclipse.jetty.server.HttpInputOverHTTP); line: 1, column: 128]Kai Sun
10/12/2022, 1:32 AMKai Sun
10/12/2022, 1:34 AM[default]
aws_access_key_id =xxxxxxx
aws_secret_access_key = xxxxxx
aws_session_token = xxxxx
If I only add aws_access_key_id and aws_secret_access_key value (not place to add session token, I have following errorKai Sun
10/12/2022, 1:36 AMenvironment does not seem to apply here, as I don't use environment variable here.Laksh Singla
10/12/2022, 3:30 AMIf I only add aws_access_key_id and aws_secret_access_key value (not place to add session token, I have following errorI have seen the error if the access key id and value or the bucket are incorrect. Can you access the file via the aws cli using the access keys that you have provided in the console?
Laksh Singla
10/12/2022, 3:33 AMDefaultAWSCredentialsProviderChain class to fetch the credentials. The locations higher in the list takes a higher priority over the others. Can you please check if there is a config that is provided in your environment that has more priority over the default credential profiles file (number 4).Kai Sun
10/12/2022, 5:22 AM> If I only add aws_access_key_id and aws_secret_access_key value (not place to add session token, I have following error
I have seen the error if the access key id and value or the bucket are incorrect. Can you access the file via the aws cli using the access keys that you have provided in the console?@Laksh Singla, I just tried, the credential files from AWS_CREDENTIAL_PROFILES_FILE env can be used to list the bucket
Kai Sun
10/12/2022, 5:35 AMDruid uses https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.htmlHere are the checkings:class to fetch the credentials. The locations higher in the list takes a higher priority over the others. Can you please check if there is a config that is provided in your environment that has more priority over the default credential profiles file (number 4).DefaultAWSCredentialsProviderChain
bash-4.2$ echo $AWS_ACCESS_KEY_ID
bash-4.2$ grep aws.accessKeyId /tmp/conf/druid/cluster/_common/common.runtime.properties
bash-4.2$ env | grep AWS
AWS_CREDENTIAL_PROFILES_FILE=/secrets/serviceaccount/credentials
bash-4.2$
bash-4.2$ ls ~/.aws
ls: cannot access /opt/druid/.aws: No such file or directory
bash-4.2$
1/ Now env of AWS_ACCESS_KEY_ID set
2/ now aws.accessKeyId set in runtime properties
3/ web token. I don't think there will be any, not sure what to check
4./ no ~/.aws directory. However, I do have AWS_CREDENTIAL_PROFILES_FILE set. Since this pod has no aws command line tool installed. I copied the credential file to another pod with aws tools and it worked over there.Kai Sun
10/12/2022, 5:36 AMnone , default or environment here?Laksh Singla
10/12/2022, 5:49 AMdruid.s3.fileSessionCredentials in the config.Laksh Singla
10/12/2022, 5:51 AMLaksh Singla
10/12/2022, 5:51 AMKai Sun
10/12/2022, 6:15 AMAlso, does supplying the correct keys in the data loader UI doesn’t work? That’s weirdHere, in my case I have session_keys in the credential files. Also, can you be specific as which options should I use in UI?
default or none?Laksh Singla
10/12/2022, 6:16 AMKai Sun
10/12/2022, 6:24 AMdefault since you are providing the keys via the UIIn my case, we have to have session keys, which is not doable from UI. Let me repeat the steps in the working pod one more time.
Laksh Singla
10/12/2022, 6:24 AMLaksh Singla
10/12/2022, 6:24 AMAlternatively, you can create a properties file and supply it as a cluster property to Druid using druid.s3.fileSessionCredentials in the config this suggestion works?Kai Sun
10/12/2022, 6:28 AM[datagen@datagen query_data_gen]$ mkdir ~/.aws
[datagen@datagen query_data_gen]$ cat > ~/.aws/config <<EOF
> [default]
> region = us-west-2
> EOF
[datagen@datagen query_data_gen]$
[datagen@datagen query_data_gen]$ export AWS_CREDENTIAL_PROFILES_FILE=/secrets/serviceaccount/credentials
[datagen@datagen query_data_gen]$ aws s3 ls <s3://monc-ra-common-lab1-monitoring-dev1-uswest2-s3/perf_data>
An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access DeniedKai Sun
10/12/2022, 6:29 AMKai Sun
10/12/2022, 6:30 AM[datagen@datagen query_data_gen]$ cp /secrets/serviceaccount/credentials ~/.aws
[datagen@datagen query_data_gen]$ aws s3 ls <s3://monc-ra-common-lab1-monitoring-dev1-uswest2-s3/perf_data>
PRE perf_data/
2022-10-07 00:33:05 37926 perf_dataKai Sun
10/12/2022, 6:32 AMAWS_CREDENTIAL_PROFILES_FILE=/secrets/serviceaccount/credentials along in my config, the deep storage s3 storing the segment files would work. But it does work.Laksh Singla
10/12/2022, 6:34 AMKai Sun
10/12/2022, 6:35 AMAlternatively, you can create a properties file and supply it as a cluster property to Druid using druid.s3.fileSessionCredentials in the config
So if I understand correctly, I will need to add this line to common properties, and redeploy the cluster, right?
druid.s3.fileSessionCredentials=/secrets/serviceaccount/credentialsLaksh Singla
10/12/2022, 6:35 AMLaksh Singla
10/12/2022, 6:36 AMprop1=val1
prop2=val2Kai Sun
10/12/2022, 6:36 AMHmm, so changing the file path to default ~/.aws/credentials is working as opposed to setting it custom using the env variable?Right! Here, I copied the one to default ~/.aws/credentials
Kai Sun
10/12/2022, 6:38 AMI think the properties file has a different format as well. Something like:Do you mean the common property files for druid, or the credential file for aws?
Kai Sun
10/12/2022, 6:38 AMKai Sun
10/12/2022, 6:40 AM[default]
aws_access_key_id = xxxxxxxxxxxx
aws_secret_access_key = yyyyyyyy
aws_session_token = zzzzzz
aws_expiration = 2022-10-12T16:43:52ZKai Sun
10/12/2022, 6:40 AM= , does it matter?Kai Sun
10/12/2022, 6:43 AMdruid.storage.type=s3
druid.storage.bucket=monc-ra-common-lab1-monitoring-dev1-uswest2-s3
druid.storage.baseKey=druid_moncloud_events/segments
#to add
druid.s3.fileSessionCredentials=/secrets/serviceaccount/credentialsKai Sun
10/12/2022, 6:44 AMKai Sun
10/12/2022, 6:52 AMKai Sun
10/12/2022, 7:39 AMdruid.s3.fileSessionCredentials=/secrets/serviceaccount/credentials in all common config files and it is still not working.Kai Sun
10/12/2022, 7:43 AMError: Cannot construct instance of `org.apache.druid.data.input.s3.S3InputSourceConfig`, problem: accessKeyId cannot be null if secretAccessKey is given at [Source: (org.eclipse.jetty.server.HttpInputOverHTTP); line: 1, column: 128] (through reference chain: org.apache.druid.indexing.overlord.sampler.IndexTaskSamplerSpec["spec"]->org.apache.druid.indexing.common.task.IndexTask$IndexIngestionSpec["ioConfig"]->org.apache.druid.indexing.common.task.IndexTask$IndexIOConfig["inputSource"]->org.apache.druid.data.input.s3.S3InputSource["properties"])Kai Sun
10/12/2022, 7:47 AMKai Sun
10/12/2022, 11:13 PM"inputSource": {
"type": "s3",
"prefixes": [ "<s3://monc-ra-common-lab1-monitoring-dev1-uswest2-s3/perf_data/>"]
},Gian Merlino
10/14/2022, 10:31 PM