Quarkus test LauncherUtil fails searching for "Listening on:" in logs - quarkus

I am building a Lambda handler and tests are failing and Quarkus Test is looking for a message to appear in the logs in order to execute Pattern.compile("Listening on:\\s+(https?)://\\S*:(\\d+)") in CaptureListeningDataReader.
The failure happens because all the logs I see are:
2021-06-29 16:53:06,663 WARN [io.qua.config] (main) Unrecognized configuration key "quarkus.http.ssl-port" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2021-06-29 16:53:06,663 WARN [io.qua.config] (main) Unrecognized configuration key "quarkus.http.port" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
...
2021-06-29 16:53:07,515 INFO [io.quarkus] (main) foo-authorizer-lambda 1.0.0-SNAPSHOT on JVM (powered by Quarkus 1.13.7.Final) started in 1.249s.
Perhaps I'm missing a plugin assumed to be present, thus the two WARN messages and a missing "Listening on:" in the logs?

Related

Spring boot applications sometimes fails to "bind properties" on high load

So every morning we're starting around ~30 spring-boot microservices.
Sometimes one of them is failing to start up.
Running Spring boot 2.1.5.
Today it was with the following error:
2021-11-15 02:18:32.269 INFO 12258023 --- [main] dk.yx.oiltanks.OilTanksApplication : The following profiles are active: prod
2021-11-15 02:19:49.406 ERROR 12258023 --- [main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'spring.mvc.servlet' to org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties$Servlet:
Reason: Failed to bind properties under 'spring.mvc.servlet' to org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties$Servlet
Action:
Update your application's configuration
Is there any configuration parameters to increase "bind properties" time ?
All we did to get this application running again was starting it with the normal command.
Configuration file:
endpoints.cors.allowed-methods=GET
endpoints.cors.allowed-origins=*
eureka.client.serviceUrl.defaultZone=**HOSTNAME**:13499/eureka/
eureka.instance.healthCheckUrl=https\://${eureka.hostname}\:${server.port}/actuator/health
eureka.instance.homePageUrl=https\://${eureka.hostname}\:${server.port}/
eureka.instance.hostname=**HOSTNAME**
eureka.instance.nonSecurePortEnabled=false
eureka.instance.securePort=${server.port}
eureka.instance.securePortEnabled=true
eureka.instance.statusPageUrl=https\://${eureka.hostname}\:${server.port}/actuator/info
feign.client.config.default.connectTimeout=1600000
feign.client.config.default.readTimeout=1600000
logging.file.max-history=50
logging.file.max-size=100MB
logging.file=application.log
logging.level.dk.yx.yxdb=INFO
logging.level.dk.yx=INFO
logging.level.org.hibernate.SQL=INFO
logging.level.org.hibernate.type.descriptor.sql=INFO
logging.level.org.springframework.web.filter.CommonsRequestLoggingFilter=INFO
logging.level.org.springframework.web=INFO
management.endpoints.web.cors.allowed-methods=GET
management.endpoints.web.cors.allowed-origins=*
multipart.maxFileSize=-1
multipart.maxRequestSize=-1
pring.mvc.async.request-timeout=300000
server.connection-timeout=999999
server.http.port=3517
server.port=13517
server.ssl.key-alias=yx_dk
server.ssl.key-store-password=**PASSWORD**
server.ssl.key-store-type=PKCS12
server.ssl.key-store=/QOpenSys/etc/ssl/wildcard_yx_dk.p12
spring.application.name=OIL_TANK_SERVICE
spring.datasource.driver-class-name=com.ibm.as400.access.AS400JDBCDriver
spring.datasource.hibernate.default_schema=NHODATA
spring.datasource.hikari.connectionTimeout=90000
spring.datasource.hikari.idleTimeout=120000
spring.datasource.hikari.minimumIdle=3
spring.datasource.password=unreadable
spring.datasource.url=jdbc\:as400\:bmw/;naming\=system;libraries\=NHODATA,QTEMP,YXDTA24,ICEBREAK,NHOPRG,SYSAFD,QGPL,QIDU,OTCONLINE,SMS,YXDB,YXAPP,SMSDB;date format\=eur;time format\=eur;
spring.datasource.username=sqlread
spring.http.multipart.enabled=true
spring.http.multipart.maxFileSize=-1
spring.http.multipart.maxRequestSize=-1
spring.jpa.database-platform=org.hibernate.dialect.DB2Dialect
spring.jpa.hibernate.ddl-auto=none
spring.jpa.show-sql=false
spring.mvc.async.request-timeout=999999
spring.output.ansi.enabled=DETECT
spring.profiles.active=prod
spring.servlet.multipart.max-file-size=-1
spring.servlet.multipart.max-request-size=-1
yx.nps.ip=**IP**
yx.nps.username=**password**
yx.project.description=Service for handling all oiltank related stuff.

While installing the Cassandra getting the error

Trying to installing the Cassandra in my local system getting the below error. Could you please solve or help on the error.
INFO [main] 2021-04-22 19:23:16,662 CassandraDaemon.java:507 - JVM Arguments: [-ea, -javaagent:C:\Cassandra\apache-cassandra-3.11.10\lib\jamm-0.3.0.jar, -Xms2G, -Xmx2G, -XX:+HeapDumpOnOutOfMemoryError, -XX:+UseParNewGC, -XX:+UseConcMarkSweepGC, -XX:+CMSParallelRemarkEnabled, -XX:SurvivorRatio=8, -XX:MaxTenuringThreshold=1, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Dlogback.configurationFile=logback.xml, -Djava.library.path=C:\Cassandra\apache-cassandra-3.11.10\lib\sigar-bin, -Dcassandra.jmx.local.port=7199, -Dcassandra, -Dcassandra-foreground=yes, -Dcassandra.logdir=C:\Cassandra\apache-cassandra-3.11.10\logs, -Dcassandra.storagedir=C:\Cassandra\apache-cassandra-3.11.10\data]
WARN [main] 2021-04-22 19:23:16,682 StartupChecks.java:169 - JMX is not enabled to receive remote connections. Please see cassandra-env.sh for more info.
WARN [main] 2021-04-22 19:23:16,688 StartupChecks.java:220 - The JVM is not configured to stop on OutOfMemoryError which can cause data corruption. Use one of the following JVM options to configure the behavior on OutOfMemoryError: -XX:+ExitOnOutOfMemoryError, -XX:+CrashOnOutOfMemoryError, or -XX:OnOutOfMemoryError="<cmd args>;<cmd args>"
These aren't errors - they are just warnings that some parameters aren't configured, and suggesting that you can configure some options. Specifically you can ignore the second line (about JMX), but last line is more important - open conf/jvm.options and add the line with -XX:+ExitOnOutOfMemoryError option.

Spring Application not getting terminate for timeout exception

I have created a spring boot application to publish the message to the Kafka queue. For that, I am using spring cloud stream and Kafka binder as dependencies. Problem is my application is continuously trying to connect to Kafka broker if it is down for 2 minutes because of the default configuration.
I have reduced that time using the below property and set it to 1000 ms and getting the timeout exception
spring.kafka.properties.request.timeout.ms:1000.
But still, my spring application is running after the exception. I want it to fail if Kafka broker is not available to connect to. I have tried one more property for that spring.kafka.admin.fail-fast=true but still, the application is running.
I have also tried to search for some properties of spring cloud stream and Kafka binder that I can set to fail my application if Kafka broker is not available but couldn't find anything related to that.
Please, help me with this.
Please see below for the log of exception.
Caused by: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.
at org.apache.kafka.common.internals.KafkaFutureImpl.wrapAndThrow(KafkaFutureImpl.java:45)
at org.apache.kafka.common.internals.KafkaFutureImpl.access$000(KafkaFutureImpl.java:32)
at org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(KafkaFutureImpl.java:104)
at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:274)
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner.createTopicAndPartitions(KafkaTopicProvisioner.java:351)
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner.createTopicIfNecessary(KafkaTopicProvisioner.java:325)
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner.createTopic(KafkaTopicProvisioner.java:302)
... 33 common frames omitted
Caused by: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.
2019-05-22 06:06:25 [main] DEBUG o.s.c.s.DefaultLifecycleProcessor - Successfully started bean 'outputBindingLifecycle'
2019-05-22 06:06:25 [main] DEBUG o.s.c.s.DefaultLifecycleProcessor - Starting beans in phase 2147482647
2019-05-22 06:06:25 [main] DEBUG o.s.c.s.binding.BindableProxyFactory - Binding inputs for :interface kafka.stream.RXXXStreams
2019-05-22 06:06:25 [main] DEBUG o.s.c.s.DefaultLifecycleProcessor - Successfully started bean 'inputBindingLifecycle'
2019-05-22 06:06:25 [main] DEBUG o.s.c.s.DefaultLifecycleProcessor - Starting beans in phase 2147483547
2019-05-22 06:06:25 [main] DEBUG o.s.c.s.DefaultLifecycleProcessor - Successfully started bean 'org.springframework.kafka.config.internalKafkaListenerEndpointRegistry'
2019-05-22 06:06:25 [main] DEBUG o.s.b.a.l.ConditionEvaluationReportLoggingListener -
Do you have spring-boot-web libraries as dependency? If that's the case, your application will not exit. A full log will be also very helpful.

spring-boot client unable to start with consul

I have setup and run consul using docker on my system using following command:
sudo docker run -p 8500:8500 consul:0.9.2
Consul is running fine as I can check from the consul UI (Image attached below):
Now, I am trying to run my spring-boot service to use this consul instance for service discovery and registration. But, whenever i start it gives me following exception:
2017-09-02 18:58:17.091 ERROR 5578 --- [ restartedMain] o.s.c.c.c.ConsulPropertySourceLocator : Fail fast is set and there was an error reading configuration from consul.
2017-09-02 18:58:18.183 ERROR 5578 --- [ restartedMain] o.s.c.c.c.ConsulPropertySourceLocator : Fail fast is set and there was an error reading configuration from consul.
2017-09-02 18:58:19.375 ERROR 5578 --- [ restartedMain] o.s.c.c.c.ConsulPropertySourceLocator : Fail fast is set and there was an error reading configuration from consul.
2017-09-02 18:58:20.691 ERROR 5578 --- [ restartedMain] o.s.c.c.c.ConsulPropertySourceLocator : Fail fast is set and there was an error reading configuration from consul.
2017-09-02 18:58:22.114 ERROR 5578 --- [ restartedMain] o.s.c.c.c.ConsulPropertySourceLocator : Fail fast is set and there was an error reading configuration from consul.
2017-09-02 18:58:23.671 ERROR 5578 --- [ restartedMain] o.s.c.c.c.ConsulPropertySourceLocator : Fail fast is set and there was an error reading configuration from consul.
2017-09-02 18:58:23.691 ERROR 5578 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed
com.ecwid.consul.v1.OperationException: OperationException(statusCode=500, statusMessage='Internal Server Error', statusContent='No cluster leader')
at com.ecwid.consul.v1.kv.KeyValueConsulClient.getKVValues(KeyValueConsulClient.java:159)
at com.ecwid.consul.v1.ConsulClient.getKVValues(ConsulClient.java:487)
at org.springframework.cloud.consul.config.ConsulPropertySource.init(ConsulPropertySource.java:66)
at org.springframework.cloud.consul.config.ConsulPropertySourceLocator.create(ConsulPropertySourceLocator.java:157)
at org.springframework.cloud.consul.config.ConsulPropertySourceLocator.locate(ConsulPropertySourceLocator.java:131)
at org.springframework.cloud.consul.config.ConsulPropertySourceLocator$$FastClassBySpringCGLIB$$b35ebf8.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:91)
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:286)
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:163)
at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:118)
at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:152)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at org.springframework.cloud.consul.config.ConsulPropertySourceLocator$$EnhancerBySpringCGLIB$$66375879.locate(<generated>)
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:93)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:567)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:338)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:301)
at com.pyg.auth.AuthServiceApp.main(AuthServiceApp.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
SpringBoot Main Class is annotated fine (I guess), because my spring-boot service was working fine with another consul instance earlier.
I was able to solve my issue by moving consul server and port configuration from application.yml to bootstrap.yml.
I don't know much about how it was solved and why it was unable to read from application.yml. If anyone has some details about it, pl. let me know.
Use sudo docker run -p 8500:8500 consul:0.9.2 -bootstrap to resolve the problem. I have
added -bootstrap one argument to bootstrap the server/servers and get elected as a leader. Manual bootstrapping with -bootstrap is not recommended in newer versions of Consul (0.5 and newer) as it is more error-prone.
Explanation:-
As said in docs Before a Consul cluster can begin to service requests, a server node must be elected leader. And this is reason of your exception on start of spring-boot service the leader has not been elected yet!!
Why the leader has not been elected? The list of servers involved in the cluster should be bootstrapped. And the servers can be bootstrapped using the
-bootstrap-expect configuration option. Recommended
Note:- Just for testing/learning purpose you can go ahead and create a single server because A single server deployment is highly discouraged as data loss is inevitable in a failure scenario.
Check your pom.xml.
Don't use spring-cloud-starter-consul-all. Use spring-cloud-starter-consul-discovery instead.
That worked for me.
Please check pom.xml to avoid using spring-cloud-starter-consul-all
If you use spring-cloud-starter-consul-all, please write the configuration to bootstrap.yml, the bootstrap.yml configuration file is the first to load.

SpringXD -> twitterstream --follow: ending with Http error

I'm trying to crate a stream that should follow #BBCBreaking (what should have 5402612 twitter ID), but I keep getting following Http error:
2016-03-28T02:13:12+0200 1.3.1.RELEASE INFO DeploymentSupervisor-0 zk.ZKStreamDeploymentHandler - Deployment status for stream 'mystream': DeploymentStatus{state=deployed}
2016-03-28T02:13:13+0200 1.3.1.RELEASE WARN twitterSource-1-1 twitter.TwitterStreamChannelAdapter - Http error, waiting for 5 seconds before restarting
2016-03-28T02:13:19+0200 1.3.1.RELEASE WARN twitterSource-1-1 twitter.TwitterStreamChannelAdapter - Http error, waiting for 10 seconds before restarting
2016-03-28T02:13:30+0200 1.3.1.RELEASE WARN twitterSource-1-1 twitter.TwitterStreamChannelAdapter - Http error, waiting for 20 seconds before restarting
my stream command is:
stream create --name mystream --definition "twitterstream --follow='5402612' | log" --deploy
running on SpringXD: 1.3.1.RELEASE
please, any idea that why the error?
You can debug such situations by enabling DEBUG logging - log config is in the xd/config folder in .groovy files; e.g. xd-singlenode-logback.groovy.
Set the loggers for org.springframework.integration and org.springframework.xd, org.springframework.xd.dirt.server to DEBUG and add a logger for org.springframework.social.twitter also at DEBUG.
Or you can set all of org.springframework and comment out the more specific ones.

Resources