New day, new beginner questions.
We’re trying to follow the official guide on how to set up the RDB Loader to Redshift locally after successfully running the RDB Shredder.
After specifying the hocon and iglu-resolver jsons and converting them with the build in base64. In the hocon we specified the AWS region, but when running docker run we get the following error:
[ioapp-compute-4] ERROR com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - Loader shutting down
software.amazon.awssdk.core.exception.SdkClientException: Unable to load region from any of the providers in the chain software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain@3ea46041: [software.amazon.awssdk.regions.providers.SystemSettingsRegionProvider@5583d702: Unable to load region from system settings. Region must be specified either via environment variable (AWS_REGION) or system property (aws.region)., software.amazon.awssdk.regions.providers.AwsProfileRegionProvider@36dd883d: No region provided in profile: default, software.amazon.awssdk.regions.providers.InstanceProfileRegionProvider@52a85b4b: Unable to contact EC2 metadata service.]
Where is it looking for the AWS region? Is it not the hocon file? How are we supposed to get region into the docker container?
Hello @medicinal-matt, could you share the full error stack trace to see where error originated, please ?
Sorry, I thought I was doing a favour by only including that part. Here is the full log
[ioapp-compute-0] INFO com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - RDB Loader 1.2.1-rc1 [Acme Redshift] has started. Listening messages
[ioapp-compute-3] INFO com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - Configuration for monitoring.folders hasn't been providing - monitoring is disabled
[ioapp-compute-4] ERROR com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - Loader shutting down
software.amazon.awssdk.core.exception.SdkClientException: Unable to load region from any of the providers in the chain software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain@3ea46041: [software.amazon.awssdk.regions.providers.SystemSettingsRegionProvider@5583d702: Unable to load region from system settings. Region must be specified either via environment variable (AWS_REGION) or system property (aws.region)., software.amazon.awssdk.regions.providers.AwsProfileRegionProvider@36dd883d: No region provided in profile: default, software.amazon.awssdk.regions.providers.InstanceProfileRegionProvider@52a85b4b: Unable to contact EC2 metadata service.]
at software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:98)
at software.amazon.awssdk.regions.providers.AwsRegionProviderChain.getRegion(AwsRegionProviderChain.java:70)
at software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder.regionFromDefaultProvider(AwsDefaultClientBuilder.java:202)
at software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder.resolveRegion(AwsDefaultClientBuilder.java:184)
at software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder.finalizeChildConfiguration(AwsDefaultClientBuilder.java:135)
at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.syncClientConfiguration(SdkDefaultClientBuilder.java:157)
at software.amazon.awssdk.services.sqs.DefaultSqsClientBuilder.buildClient(DefaultSqsClientBuilder.java:27)
at software.amazon.awssdk.services.sqs.DefaultSqsClientBuilder.buildClient(DefaultSqsClientBuilder.java:22)
at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build(SdkDefaultClientBuilder.java:129)
at com.snowplowanalytics.aws.sqs.SQS$.$anonfun$mkClientBuilder$1(SQS.scala:31)
at apply @ com.snowplowanalytics.snowplow.rdbloader.dsl.Environment$.initialize(Environment.scala:89)
at apply @ com.snowplowanalytics.snowplow.rdbloader.dsl.Environment$.initialize(Environment.scala:89)
at flatMap @ fs2.internal.CompileScope.acquireResource(CompileScope.scala:180)
at flatMap @ fs2.internal.FreeC$.$anonfun$compile$12(Algebra.scala:511)
at flatMap @ fs2.internal.FreeC$.interruptGuard$1(Algebra.scala:436)
at flatMap @ fs2.internal.FreeC$.$anonfun$compile$7(Algebra.scala:463)
at flatMap @ fs2.internal.FreeC$.go$1(Algebra.scala:460)
at flatMap @ fs2.internal.CompileScope.$anonfun$open$2(CompileScope.scala:146)
at map @ fs2.internal.CompileScope.open(CompileScope.scala:137)
at flatMap @ fs2.internal.CompileScope.open(CompileScope.scala:141)
at flatMap @ fs2.internal.FreeC$.$anonfun$compile$15(Algebra.scala:533)
at flatMap @ fs2.internal.FreeC$.$anonfun$compile$14(Algebra.scala:531)
at flatMap @ fs2.internal.FreeC$.interruptGuard$1(Algebra.scala:436)
at flatMap @ fs2.internal.FreeC$.$anonfun$compile$7(Algebra.scala:463)
at flatMap @ fs2.internal.FreeC$.go$1(Algebra.scala:460)
at flatMap @ fs2.internal.FreeC$.$anonfun$compile$7(Algebra.scala:463)
[ioapp-compute-4] INFO com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - Releasing connection
[ioapp-compute-4] INFO com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - RDB Pool has been destroyed
[ioapp-compute-4] INFO org.http4s.client.PoolManager - Shutting down connection pool: curAllocated=0 idleQueues.size=0 waitQueue.size=0 maxWaitQueueLimit=256 closed=false
No problem at all. So, there is a small bug in the RDB Loader currently. We are not setting SQS client’s region with the one given in the config. Therefore, SQS client is using DefaultAwsRegionProviderChain to set it. You need to set region in one of the places which DefaultAwsRegionProviderChain is looking.
Excerpt from DefaultAwsRegionProviderChain Javadoc:
AWS Region provider that looks for the region in this order:
1. Check the 'aws.region' system property for the region.
2. Check the 'AWS_REGION' environment variable for the region.
3. Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the region.
4. If running in EC2, check the EC2 metadata service for the region.
Please let us know if you have further questions.
Regards.
1 Like
That resolved that issue by including them as environment variables in the docker run command (-e)
Now we get another error. Maybe for another thread, but it says
The specified queue does not exist for this wsdl version. (Service: Sqs, Status Code: 400, Request ID: <ID>
We’re guessing that it is the message queue specified in the hocon file.
# SQS topic name used by Shredder and Loader to communicate
"messageQueue": "messages",
It never mentioned it explicitly in the docs, but we’re supposed to set this up as well?
Full trace
[ioapp-compute-0] INFO com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - RDB Loader 1.2.1-rc1 [Acme Redshift] has started. Listening messages
[ioapp-compute-0] INFO com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - Fragment("BEGIN")
[ioapp-compute-8] INFO com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - Fragment("SET search_path TO k_m_snowstuff")
[ioapp-compute-4] INFO com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - Fragment("COMMIT")
[ioapp-compute-9] INFO com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - Configuration for monitoring.folders hasn't been providing - monitoring is disabled
[ioapp-compute-2] ERROR com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - Loader shutting down
software.amazon.awssdk.services.sqs.model.QueueDoesNotExistException: The specified queue does not exist for this wsdl version. (Service: Sqs, Status Code: 400, Request ID: e9d808cf-a6d6-5518-921b-51181b8fe107, Extended Request ID: null)
at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleErrorResponse(CombinedResponseHandler.java:123)
at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleResponse(CombinedResponseHandler.java:79)
at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:59)
at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:40)
at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:40)
at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:30)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:73)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:42)
at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:78)
at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:40)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:50)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:36)
at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:64)
at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:34)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:56)
at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:36)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:80)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:60)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:42)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:48)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:31)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:37)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26)
at software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:193)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:133)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:159)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$1(BaseSyncClientHandler.java:112)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:167)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:94)
at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:55)
at software.amazon.awssdk.services.sqs.DefaultSqsClient.getQueueUrl(DefaultSqsClient.java:859)
at com.snowplowanalytics.aws.sqs.SQS$.$anonfun$getUrl$1(SQS.scala:95)
at map @ com.snowplowanalytics.aws.sqs.SQS$.getUrl(SQS.scala:96)
at eval @ org.http4s.client.blaze.BlazeClientBuilder.$anonfun$resource$1(BlazeClientBuilder.scala:257)
at main$ @ com.snowplowanalytics.snowplow.rdbloader.Main$.main(Main.scala:31)
[ioapp-compute-2] INFO com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - Releasing connection
[ioapp-compute-2] INFO com.snowplowanalytics.snowplow.rdbloader.dsl.Logging.$anon - RDB Pool has been destroyed
[ioapp-compute-2] INFO org.http4s.client.PoolManager - Shutting down connection pool: curAllocated=0 idleQueues.size=0 waitQueue.size=0 maxWaitQueueLimit=256 closed=false
Exactly, you need to set messageQueue
as well. That field is specified as required in the configuration reference. You can find it here.
I see! It is actually mentioned in this guide, but we were only following this guide.
Can you ensure that the documentation gets updated for the environment variables?