Failing to start up HazelCast on AWS ECS - amazon-ecs

I'm trying to start up Hazelcast on AWS ECS. I have gone through the tutorial and have enabled all the permissions on the task role i.e decribeTasks, lisTasks etc. I have have a very simple configuration file
hazelcast:
cluster-name: hs-dcom-hazelcast
network:
join:
multicast:
enabled: false
aws:
enabled: true
interfaces:
enabled: true
interfaces:
- 10.106.*.*
However when the container tries to start it throws the following error
2023-01-23T14:47:16.975Z INFO 835 --- [ main] com.hazelcast.instance.impl.Node : [10.106.139.69]:5701 [hs-dcom-hazelcast] [5.0-BETA-1] Shutting down node engine...
7467 2023-01-23T14:47:17.004Z INFO 835 --- [ main] c.hazelcast.instance.impl.NodeExtension : [10.106.139.69]:5701 [hs-dcom-hazelcast] [5.0-BETA-1] Destroying node NodeExtension.
7468 2023-01-23T14:47:17.004Z INFO 835 --- [ main] com.hazelcast.instance.impl.Node : [10.106.139.69]:5701 [hs-dcom-hazelcast] [5.0-BETA-1] Hazelcast Shutdown is completed in 35 ms.
! 7469 2023-01-23T14:47:17.006Z WARN 835 --- [ main] o.s.w.c.s.GenericWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastInstance' defined in class path resource [org/springframework/boot/autoconfigure/hazelcast/HazelcastServerConfiguration$HazelcastServerConfigFileConfiguration.class]: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception with message: Failure executing: POST at: https://ecs.eu-west-1.amazonaws.com. Message: {"__type":"InvalidParameterException","message":"Identifier is for 570169269855. Your accountId is 531465454359"}. HTTP Error Code: 400
7470 2023-01-23T14:47:17.021Z INFO 835 --- [ main] .s.b.a.l.ConditionEvaluationReportLogger :
7471
7472 Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
7473 2023-01-23T14:47:17.052Z ERROR 835 --- [ main] o.s.boot.SpringApplication : Application run failed
7474
7475 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastInstance' defined in class path resource [org/springframework/boot/autoconfigure/hazelcast/HazelcastServerConfiguration$HazelcastServerConfigFileConfiguration.class]: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception with message: Failure executing: POST at: https://ecs.eu-west-1.amazonaws.com. Message: {"__type":"InvalidParameterException","message":"Identifier is for 570169269855. Your accountId is 531465454359"}. HTTP Error Code: 400
7476 at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657) ~[spring-beans-6.0.3.jar:6.0.3]
7477 at
I have tried looking on the forum, however can't seem to find anyone that has had this issue before.

Related

Getting exception when running Okta Spring Security & Okta-Hosted Login Page example

I followed the steps in this sample code: https://github.com/okta/samples-java-spring/tree/master/okta-hosted-login
When I run the example using the command:
mvn -Dokta.oauth2.issuer=https://{yourOktaDomain}/oauth2/default \ -Dokta.oauth2.clientId={clientId} \ -Dokta.oauth2.clientSecret={clientSecret}
I get the following exception:
`2023-02-06 11:08:41.717 INFO 17288 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2023-02-06 11:08:41.725 INFO 17288 --- [ main] c.o.s.e.CodeFlowExampleApplication : Started CodeFlowExampleApplication in 2.881 seconds (JVM running for 5.358)
2023-02-06 11:08:53.299 INFO 17288 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-02-06 11:08:53.299 INFO 17288 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2023-02-06 11:08:53.301 INFO 17288 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 0 ms
2023-02-06 11:08:53.558 ERROR 17288 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.thymeleaf.context.IWebContext.getExchange()Lorg/thymeleaf/web/IWebExchange;] with root cause
java.lang.NoSuchMethodError: org.thymeleaf.context.IWebContext.getExchange()Lorg/thymeleaf/web/IWebExchange;
at org.thymeleaf.extras.springsecurity5.util.Spring5VersionSpecificUtility.isWebMvcContext(Spring5VersionSpecificUtility.java:80) ~[thymeleaf-extras-springsecurity5-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.thymeleaf.extras.springsecurity5.util.SpringVersionSpecificUtils.isWebMvcContext(SpringVersionSpecificUtils.java:118) ~[thymeleaf-extras-springsecurity5-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.thymeleaf.extras.springsecurity5.util.SpringSecurityContextUtils.getAuthenticationObject(SpringSecurityContextUtils.java:127) ~[thymeleaf-extras-springsecurity5-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.thymeleaf.extras.springsecurity5.auth.AuthUtils.getAuthenticationObject(AuthUtils.java:102) ~[thymeleaf-extras-springsecurity5-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.thymeleaf.extras.springsecurity5.dialect.expression.SpringSecurityExpressionObjectFactory.buildObject(SpringSecurityExpressionObjectFactory.java:91) ~[thymeleaf-extras-springsecurity5-3.1.1.RELEASE.jar:3.1.1.RELEASE]
...`
I also tried running this sample from my Intellij IDEA IDE and when I open it I get the following error:
'parent.relativePath' of POM com.example.okta:okta-spring-boot-oauth-code-flow-example:0.0.1-SNAPSHOT (C:\Users\fteran\repos\demos\okta-github\samples-java-spring\okta-hosted-login\pom.xml) points at com.okta.examples:aggregator instead of org.springframework.boot:spring-boot-starter-parent, please verify your project structure
I was kind of expecting the sample code to work if I was very careful to follow the instructions, which I think I did, at this point I am not sure if this is an issue on my local or if there is an issue with the sample code itself.
Try this example: https://github.com/okta-samples/okta-spring-boot-sample/
It's more up-to-date.

Spring Cloud Data Flow Kinises Example Consumer Failing

I have cloned the SCDF Kinesis Example: https://github.com/spring-cloud/spring-cloud-dataflow-samples/tree/master/dataflow-website/recipes/kinesisdemo and running the same. The kinesis Producer is running and publishing the events to kinesis. However, the Kinesis Consumer Spring Boot is failed to start due to the below ERRORS. Please let me know if anybody faced this issue and how to solve this?
2020-06-25 17:55:07.374 WARN 2448 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'inputBindingLifecycle'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kinesisCheckpointStore' defined in org.springframework.cloud.stream.binder.kinesis.config.KinesisBinderConfiguration: Invocation of init method failed; nested exception is com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException: User: arn:aws:sts::123456789:assumed-role/xyz-dev-yyyzz-support-role/user#company.com is not authorized to perform: dynamodb:DescribeTable on resource: arn:aws:dynamodb:us-east-2:123456789:table/SpringIntegrationMetadataStore (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: AccessDeniedException; Request ID: P0FF48TJVDUO29L9ULKQN89CKBVV4KQNSO5AEMVJF66Q9ASUAAJG)
2020-06-25 17:55:07.378 INFO 2448 --- [ main] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'taskScheduler'
2020-06-25 17:55:07.379 INFO 2448 --- [ main] o.s.i.monitor.IntegrationMBeanExporter : Summary on shutdown: nullChannel
2020-06-25 17:55:07.379 INFO 2448 --- [ main] o.s.i.monitor.IntegrationMBeanExporter : Summary on shutdown: input
2020-06-25 17:55:07.379 INFO 2448 --- [ main] o.s.i.monitor.IntegrationMBeanExporter : Summary on shutdown: errorChannel
2020-06-25 17:55:07.379 INFO 2448 --- [ main] o.s.i.monitor.IntegrationMBeanExporter : Summary on shutdown: _org.springframework.integration.errorLogger.handler
2020-06-25 17:55:07.379 INFO 2448 --- [ main] o.s.i.monitor.IntegrationMBeanExporter : Summary on shutdown: org.springframework.cloud.stream.binding.StreamListenerMessageHandler#3e03046d
2020-06-25 17:55:07.390 INFO 2448 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-06-25 17:55:07.391 ERROR 2448 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean 'inputBindingLifecycle'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kinesisCheckpointStore' defined in org.springframework.cloud.stream.binder.kinesis.config.KinesisBinderConfiguration: Invocation of init method failed; nested exception is com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException: User: arn:aws:sts::123456789:assumed-role/xyz-dev-yyyzz-support-role/user#company.com is not authorized to perform: dynamodb:DescribeTable on resource: arn:aws:dynamodb:us-east-2:123456789:table/SpringIntegrationMetadataStore (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: AccessDeniedException; Request ID: P0FF48TJVDUO29L9ULKQN89CKBVV4KQNSO5AEMVJF66Q9ASUAAJG)
Check your configuration on credentials provided for the app as the error clearly says it failed due to "Status Code: 400; Error Code: AccessDeniedException"

Connect Timeout Exception on Url - http://localhost:8888 & Could not locate PropertySource: I/O error on GET request

When the Spring Cloud Dataflow Http-Source app Pod starts on kubernetes notice following two messages in console.
Connect Timeout Exception on Url - http://localhost:8888.
Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/http-source/default": Connection refused (Connection refused); nested exception is java.net.ConnectException
How to get this resolved?
subscriber to the 'errorChannel' channel
2019-09-15 05:17:26.773 INFO 1 --- [ main] o.s.i.channel.PublishSubscribeChannel : Channel 'application-1.errorChannel' has 1 subscriber(s).
2019-09-15 05:17:26.774 INFO 1 --- [ main] o.s.i.endpoint.EventDrivenConsumer : started _org.springframework.integration.errorLogger
2019-09-15 05:17:27.065 INFO 1 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://localhost:8888
2019-09-15 05:17:27.137 INFO 1 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available
2019-09-15 05:17:27.141 WARN 1 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/http-source/default": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
If you look carefully, the following message will be logged as a WARN in the logs.
Connect Timeout Exception on Url - http://localhost:8888.
Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/http-source/default": Connection refused (Connection refused); nested exception is java.net.ConnectException
You'd see this WARN message for all the apps that we ship, SCDF, and Skipper servers that runs on K8s. This means that the apps, SCDF or Skipper don't have a config-server configured, so it defaults to the default http://localhost:8888.
Background: we provide the config-server dependency in all the apps that we ship to help you get started with it quickly.
If you don't use the config-server, that's fine; it will not cause any harm - nothing to worry, however.

Socket and postgreSQL connection problem while connecting spring boot application to postgreSQL in eclipse

I am running a maven spring boot application which fetches data from postgreSQL. But I am getting such type of error when I run the project using the command
mvn spring-boot:run
->
2019-05-29 14:37:03.750 WARN 18368 --- [ main] unknown.jul.logger : IOException occurred while connecting to mc:19745
java.net.SocketTimeoutException: connect timed out
2019-05-29 14:36:52.241 ERROR 18368 --- [ main] org.postgresql.Driver : Connection error:
org.postgresql.util.PSQLException: The connection attempt failed.
Caused by: java.net.SocketTimeoutException: connect timed out
2019-05-29 14:36:53.245 ERROR 18368 --- [ main]
com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
org.postgresql.util.PSQLException: The connection attempt failed.
I have mentioned only the main errors.
The application.properties file is:
spring.main.banner.mode=/offlinekyc
# Oracle settings
spring.datasource.url=jdbc:postgresql://mc:19745/post
spring.datasource.username=postgre
spring.datasource.password=123
spring.jpa.properties.hibernate.default_schema=oms_owner
spring.thymeleaf.cache=false
spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.PostgreSQLDialect
http.mappers.json-pretty-print=true
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
hibernate.discriminator.ignore_explicit_for_joined=false
# create and drop tables and sequences, loads import.sql
spring.jpa.hibernate.ddl-auto= update
spring.datasource.driverClassName=org.postgresql.Driver
# HikariCP settings
# spring.datasource.hikari.*
spring.datasource.hikari.connection-timeout=60000
spring.datasource.hikari.maximum-pool-size=5
#hibernate.dialect=org.hibernate.dialect.PostgreSQL9Dialect
#hibernate.default_schema=oms_owner
#hibernate.show_sql=true
#hibernate.format_sql=true
#hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
# Because detection is disabled you have to set correct dialect by hand.
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
Hibernate.properties file also have the same matter.
Here my post database is in mc:19745 server. I am little confused regarding localhost and server address.
Can anyone help in this matter?

Kaa Project : ERROR o.s.web.context.ContextLoader and other error

I follow the steps from
https://kaaproject.github.io/kaa/docs/v0.10.0/Administration-guide/System-installation/Single-node-installation/
The last command is
$ cat /var/log/kaa/* | grep ERROR
and the error occur
2560-07-13 16:20:00,333 [main] ERROR o.s.web.context.ContextLoader - Context initialization failed
2560-07-13 16:25:59,019 [main] ERROR o.s.web.context.ContextLoader - Context initialization failed
2560-07-13 16:37:41,610 [main] ERROR o.s.web.context.ContextLoader - Context initialization failed
2560-07-13 17:01:49,474 [main] ERROR o.s.web.context.ContextLoader - Context initialization failed
2560-07-13 18:26:42,078 [main] ERROR o.s.web.context.ContextLoader - Context initialization failed
2560-07-13 18:27:31,562 [main] ERROR o.s.web.context.ContextLoader - Context initialization failed
2560-07-13 19:04:39,818 [qtp1591550320-71] ERROR org.spring4gwt.server.RpcHelper - Unexpected exception occured while invoking service method - createKaaAdmin
2560-07-14 10:26:03,480 [main] ERROR o.k.k.s.n.s.i.KaaNodeInitializationService - Failed to connect to Zookeeper within 5 minutes. Kaa Node Server will be stopped.
I reinstalled all again but it doesn't work. The last error, I already started Zookeeper but the error still occurs.