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

load AWS credentials from any provider in the chain #306

Open
adapasuresh opened this issue Jul 14, 2023 · 3 comments
Open

load AWS credentials from any provider in the chain #306

adapasuresh opened this issue Jul 14, 2023 · 3 comments

Comments

@adapasuresh
Copy link

Hi,

I am trying to run inside the container with below.

bash-4.4# uname -a
Linux 26dac1b8ad91 5.15.49-linuxkit-pr #1 SMP PREEMPT Thu May 25 07:27:39 UTC 2023 aarch64 Linux

bash-4.4# java -version
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (IcedTea 3.8.0) (Alpine 8.171.11-r0)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)

bash-4.4# grails -version
Grails version: 2.4.4

=====ERROR LOG ====
2023-07-14 18:23:41,907 [localhost-startStop-1] INFO BootStrap - Starting ice...
| Error com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain
| Error at com.amazonaws.auth.AWSCredentialsProviderChain.getCredentials(AWSCredentialsProviderChain.java:131)
| Error at com.amazonaws.http.AmazonHttpClient$RequestExecutor.getCredentialsFromContext(AmazonHttpClient.java:1119)
| Error at com.amazonaws.http.AmazonHttpClient$RequestExecutor.runBeforeRequestHandlers(AmazonHttpClient.java:759)
| Error at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:723)
| Error at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:716)
| Error at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699)
| Error at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667)
| Error at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649)
| Error at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513)
| Error at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4221)
| Error at com.amazonaws.services.s3.AmazonS3Client.getBucketRegionViaHeadRequest(AmazonS3Client.java:4982)
| Error at com.amazonaws.services.s3.AmazonS3Client.fetchRegionFromCache(AmazonS3Client.java:4956)
| Error at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4205)
| Error at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4168)
| Error at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1378)
| Error at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1255)
| Error at com.netflix.ice.common.AwsUtils.download(AwsUtils.java:338)
| Error at com.netflix.ice.common.AwsUtils.download(AwsUtils.java:333)
| Error at com.netflix.ice.common.AwsUtils.downloadFileIfNotExist(AwsUtils.java:321)
| Error at com.netflix.ice.basic.BasicReservationService.init(BasicReservationService.java:101)
| Error at com.netflix.ice.processor.ProcessorConfig.(ProcessorConfig.java:97)
| Error at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| Error at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
| Error at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
| Error at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
| Error at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
| Error at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
| Error at BootStrap$_closure1.doCall(BootStrap.groovy:187)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:498)
| Error at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
| Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
| Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1081)
| Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
| Error at groovy.lang.Closure.call(Closure.java:423)
| Error at groovy.lang.Closure.call(Closure.java:417)
| Error at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:327)
| Error at grails.util.Environment.executeForEnvironment(Environment.java:320)
| Error at grails.util.Environment.executeForCurrentEnvironment(Environment.java:296)
| Error at org.codehaus.groovy.grails.commons.DefaultGrailsBootstrapClass.callInit(DefaultGrailsBootstrapClass.java:60)
| Error at org.codehaus.groovy.grails.web.context.GrailsConfigUtils.executeGrailsBootstraps(GrailsConfigUtils.java:78)
| Error at org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener.initWebApplicationContext(GrailsContextLoaderListener.java:110)
| Error at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
| Error at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4728)
| Error at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5162)
| Error at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
| Error at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
| Error at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
| Error at java.util.concurrent.FutureTask.run(FutureTask.java:266)
| Error at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
| Error at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
| Error at java.lang.Thread.run(Thread.java:748)
| Error 2023-07-14 18:23:44,234 [localhost-startStop-1] ERROR BootStrap - Startup failed
Message: Unable to load AWS credentials from any provider in the chain
Line | Method
->> 131 | getCredentials in com.amazonaws.auth.AWSCredentialsProviderChain


| 1119 | getCredentialsFromContext in com.amazonaws.http.AmazonHttpClient$RequestExecutor
| 759 | runBeforeRequestHandlers . . . . in ''
| 723 | doExecute in ''
| 716 | executeWithTimer . . . . . . . . in ''
| 699 | execute in ''
| 667 | access$500 . . . . . . . . . . . in ''
| 649 | execute in com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl
| 513 | execute . . . . . . . . . . . . in com.amazonaws.http.AmazonHttpClient
| 4221 | invoke in com.amazonaws.services.s3.AmazonS3Client
| 4982 | getBucketRegionViaHeadRequest . in ''
| 4956 | fetchRegionFromCache in ''
| 4205 | invoke . . . . . . . . . . . . . in ''
| 4168 | invoke in ''
| 1378 | getObject . . . . . . . . . . . in ''
| 1255 | getObject in ''
| 338 | download . . . . . . . . . . . . in com.netflix.ice.common.AwsUtils
| 333 | download in ''
| 321 | downloadFileIfNotExist . . . . . in ''
| 101 | init in com.netflix.ice.basic.BasicReservationService
| 97 | . . . . . . . . . . . . . in com.netflix.ice.processor.ProcessorConfig
| 187 | doCall in BootStrap$_closure1
| 327 | evaluateEnvironmentSpecificBlock in grails.util.Environment
| 320 | executeForEnvironment in ''
| 296 | executeForCurrentEnvironment . . in ''
| 266 | run in java.util.concurrent.FutureTask
| 1149 | runWorker . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
| 624 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 748 | run . . . . . . . . . . . . . . in java.lang.Thread

==== MY ice.properties ======
ice.processor=true
ice.reader=true
ice.reservationCapacityPoller=false
ice.reservationPeriod=oneyear
ice.reservationUtilization=HEAVY
ice.highstockUrl=https://code.highcharts.com/stock/4.2.1/highstock.js
ice.urlPrefix=
ice.fromEmail=
ice.ondemandCostAlertThreshold=250
ice.ondemandCostAlertEmails=
ice.billing_s3bucketname=plural-ice/detailed-billing-bucket
ice.billing_s3bucketregion=ap-south-1
ice.billing_s3bucketprefix=,
ice.startmillis=1364774400000
ice.companyName=Pinelabs
ice.work_s3bucketname=plural-ice/work-bucket
ice.work_s3bucketprefix=ice/
ice.processor.localDir=/mnt/ice_processor
ice.reader.localDir=/mnt/ice_reader
ice.monthlycachesize=12
ice.owneraccount.account1.role=ice
ice.owneraccount.account1.externalId=

@NitriKx
Copy link
Member

NitriKx commented Jul 14, 2023

My guess is that you need to pass your AWS credentials via the env variables of the container (AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY)

You can also mount your local ~/.aws folder as a volume.

@nfonrose
Copy link
Member

nfonrose commented Jul 18, 2023 via email

@adapasuresh
Copy link
Author

adapasuresh commented Aug 16, 2023 via email

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

No branches or pull requests

3 participants