Spring Cloud Dataflow ticktock example fails in CloudFoundry - spring-cloud-dataflow

I'm trying to get most basic example for Spring Cloud Dataflow running on CloudFoundry.
I've followed the steps here: http://docs.spring.io/spring-cloud-dataflow-admin-cloudfoundry/docs/current-SNAPSHOT/reference/htmlsingle/#getting-started to make the admin app available in my org/space.
Then I tried to create the most basic example from http://cloud.spring.io/spring-cloud-dataflow/, namely to create the "ticktock" stream:
dataflow:>stream create ticktock --definition "time | log" --deploy
I can see that both apps ticktock-time and ticktock-log are created in the space, the needed service "redis" is bound to these apps and they try to start. Unfortunately they don't start completely, because they have problem to access "redis" service. In the log we find:
Exception encountered during context initialization - cancelling
refresh attempt:
org.springframework.context.ApplicationContextException: Failed to
start bean 'outputBindingLifecycle'; nested exception is
org.springframework.context.ApplicationContextException: Failed to
start bean 'inputBindingLifecycle'; nested exception is
org.springframework.data.redis.RedisConnectionFailureException: Cannot
get Jedis connection; nested exception is
redis.clients.jedis.exceptions.JedisConnectionException: Could not get
a resource from the pool
which eventually is caused by
Caused by: redis.clients.jedis.exceptions.JedisConnectionException:
java.net.ConnectException: Connection refused
Am I missing some configuration step in between?
Alexander

There seems to be an issue with our deployer using the master branch of the Java buildpack. Try these settings for the Dataflow Server:
cf set-env s-c-dataflow-server CLOUDFOUNDRY_BUILDPACK https://github.com/cloudfoundry/java-buildpack.git#v3.6
cf restage s-c-dataflow-server
Also, be aware that we currently launch apps using "streamname-module" as part of the URL so unless you use unique stream names you might collide with other users and get a "400 Bad Request" error.

Related

Problem making a Grails 4.0.4 project connect to Neo4j Desktop

I have probably a very stupid error here, but I cannot get a simple Grails 4.0.4 project to connect to a Neo4j Desktop instance (1.3.8).
The neo4j service is running and I have been able to verify that I have connectivity to it from other tools, like DBeaver and Python.
The neo4j database settings in application.yml looks like this:
grails:
neo4j:
url: bolt://localhost:7687
username: "neo4j"
password: "neo4j"
The project I generated from start.grails.org running this:
curl -O start.grails.org/myapp.zip -d version=4.0.4 -d features=events,geb2,neo4j
The problem is when I try to launch a Grails project, the app fails to start with the message:
Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neo4jDatastore': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.datastore.gorm.neo4j.Neo4jDatastore]: Constructor threw exception; nested exception is org.neo4j.driver.v1.exceptions.ServiceUnavailableException: Connection to the database terminated. This can happen due to network instabilities, or due to restarts of the database
Would be grateful for some hints that could help me get started.
Thanks!
As per http://gorm.grails.org/snapshot/neo4j/manual/#releaseNotes, there doesn't seem to be a version that yet supports Neo4j 4.x.
The latest supported version is Neo4j 3.x with GORM 7.0.x

Error when trying to get token using Managed Service Identity in a multi-container azure web app service

We have the following scenario:
Current working setup
Web API project using a single DockerFile
A release pipe line with an 'Azure App Service deploy' task.
Proposed new setup
Web API project using multi container Docker Compose file
A release pipe line with an 'Azure Web App for Containers' task.
Upon deploying the new setup we receive the below error message:
ERROR - multi-container unit was not started successfully
Unhandled exception. System.AggregateException: One or more errors occurred.
(Parameters: Connection String: XXX, Resource: https://vault.azure.net, Authority:
https://login.windows.net/xxxxx. Exception Message:
Tried to get token using Managed Service Identity.
Access token could not be acquired. Connection refused)
The exception thrown is because it can't connect to Azure MSI (Managed Service Identity). It does this to obtain a token before connecting to key vault.
I have tried the following based upon some research and solutions others have found:
Connecting with "RunAs=App" (this seems to be the default parameter-less constructor anyway)
Building up the connection string myself manually by pulling the "MSI_SECRET" environment variable from the machine. This is always blank.
Restarting MSI.
Upgrading and downgrading AppAuthentication package
MSI appears to be configured correctly as it works perfectly with our current working setup so we can rule that out.
It's worth noting that this is System assigned identity not a user assigned one.
The documentation that states which services support managed identites only mentions 'Azure Container Instances' not 'Azure Managed Container Instances' and that is for Linux/Preview too so that it could be not supported.
Services that support managed identities for Azure resources
We've spent a considerable amount of time getting to this point with the configuration and deployment and it would be great if we could resolve this last issue.
Any help appreciated.
Unfortunately, there currently is no multi-container support for managed identities. The multi-container feature is in preview and so does not have all its functionality working yet.
However, the documentation you linked to is also not as clear about the supported scenarios, so I am working on getting this documentation updated to better clarify this. I can update this answer once that's done.

WSO2 MI Infinite loop on invalid request line

I run a very simple micro integrator service that only has 1 proxy service and a single sequence. In this sequence the incoming XML message is transferred to amazon SQS service.
If I run this in the Integration Studio on the instance that comes built in I have no problems. However, when I package the file into a CAR and feed it to the docker instance it will boot up and instantly gets bombarded with requests? That is to say, the following logs take over and the container can no longer be manually stopped:
[2020-04-15 12:45:44,585] INFO
{org.apache.synapse.transport.passthru.SourceHandler} - Writer null
when calling informWriterError ^[[?62;c^[[?62;c[2020-04-15
12:45:46,589] ERROR
{org.apache.synapse.transport.passthru.SourceHandler} - HttpException
occurred org.apache.http.ProtocolException: Invalid request line:
ÇÃ^ú§ß¡ðO©%åË*29xÙVÀ$À(=À&À*kjÀ at
org.apache.http.impl.nio.codecs.AbstractMessageParser.parse(AbstractMessageParser.java:208)
at
org.apache.synapse.transport.http.conn.LoggingNHttpServerConnection$LoggingNHttpMessageParser.parse(LoggingNHttpServerConnection.java:407)
at
org.apache.synapse.transport.http.conn.LoggingNHttpServerConnection$LoggingNHttpMessageParser.parse(LoggingNHttpServerConnection.java:381)
at
org.apache.http.impl.nio.DefaultNHttpServerConnection.consumeInput(DefaultNHttpServerConnection.java:265)
at
org.apache.synapse.transport.http.conn.LoggingNHttpServerConnection.consumeInput(LoggingNHttpServerConnection.java:114)
at
org.apache.synapse.transport.passthru.ServerIODispatch.onInputReady(ServerIODispatch.java:82)
at
org.apache.synapse.transport.passthru.ServerIODispatch.onInputReady(ServerIODispatch.java:39)
at
org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:113)
at
org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:159)
at
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:338)
at
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:316)
at
org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:277)
at
org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)
at
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:586)
at java.lang.Thread.run(Thread.java:748) Caused by:
org.apache.http.ParseException: Invalid request line:
ÇÃ^þvHÅFmÉ
(#ë¸'º¯æ¦V
I made sure there were no outside connections possible and I also found the older threads of someone describing this problem, but their solution (changing something in the keystore) did not work.
Also, I made sure to include the SQS certificate in the container as well.
I have no connections setup to connect to the container so that will be out of the equation as well.
What am I missing here?
I have no idea why, but I have identified the culprit to be none other than Portainer. When I shutdown Portainer the stream of requests stops.
According to Wireshark, the requests are all made towards
GET
http://172.17.0.1:9000/api/endpoints/< containerID >/docker/< someId >/logs
It seems that because the WSO2 container I'm trying to run is an ESB that uses endpoints and returns 400 status codes on non-existing endpoints portainer will retry until it succeeds. This is just my observation, so I could be wrong.
I have confirmed my findings by uploading my container to AWS where the problem did not exist.

SOAPFaultException when deployed on Liberty server but works fine in Websphere application server full profile

I am migrating my java enterprise application from WAS8.5 full profile
to liberty server. My application code has soap client and required
stubs generated from WSDL. I am able to receive response when using
WAS8.5 but getting below exceptions while running liberty server.
I have already added jaxws-2.2 .
Recreated the stubs again pointing to liberty server, IBM-WS from eclipse. I
couldn't find relevant answers online.
Console logs
[WARNING ] Could not unwrap Operation {http://services.abc.com/gb/getsomepoint/v1}getSomeInfoByParam to match method "public abstract void com.abc.services.gb.getsomepoint.v1.GBGetSomePointV1.getSomeInfoByParam(javax.xml.ws.Holder,java.lang.String,java.lang.String,javax.xml.ws.Holder,javax.xml.ws.Holder)"
javax.xml.ws.soap.SOAPFaultException: BIP3113E: Exception detected in message flow GB_GetSomePoint_V1.SOAP Input (integration node NMD4BRK)
[err] at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156)
[err] at [internal classes]
[err] ... 51 more
[err] Caused by:
[err] org.apache.cxf.binding.soap.SoapFault: BIP3113E: Exception detected in message flow GB_GetSomePoint_V1.SOAP Input (integration node NMD9BRK)
[err] at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:84)
[err] at [internal classes]
[err] ... 53 more
There isn't much information to go on from the console but one thing to check is if the request/response messages to and from the client look the same on Liberty as they do on WAS 8.5. That'd be a simple way to verify if the expected behavior is the same. Another thing to consider is if your WSDL contract matches the request generated by the client (i.e. all the bindings are there).
The Web Services configuration (WS-Policy/WS-Security) can be substantially different on Liberty vs WAS 8.5 and this Knowledge Center document has some good info on how to properly configure your app if you need it.
Deploying JAX-WS applications to Liberty:
https://www.ibm.com/support/knowledgecenter/SSD28V_9.0.0/com.ibm.websphere.wlp.core.doc/ae/twlp_dep_jaxws.html
The last thing I’d suggest is turning on Liberty’s Web Services trace. There isn’t a lot of info about root cause from the console messages, but by turning on the trace the specific problem might make itself known. You can turn trace on by following these directions.
Enabling trace on WebSphere Liberty:
https://www.ibm.com/support/knowledgecenter/SSD28V_9.0.0/com.ibm.websphere.wlp.core.doc/ae/rwlp_logging.html
The specific trace specification you’ll want to enable for Web Services is as follows:
traceSpecification="*=audit:com.ibm.ws.jaxws.*=finest:org.apache.cxf.*=finest”
If it works after commenting out jaxws-2.2 feature, you must be using a different jax-ws implementation packaged with your application. You can try adding back the jaxws-2.2 feature and set this JVM property for liberty server: -Dcom.ibm.xml.xlxp.jaxb.opti.level=0

Caused by: org.springframework.web.servlet.NoHandlerFoundException: No handler found for GET /null/swagger-resources/configuration/ui

Getting the below exception while starting the spring boot application.
Exception:
Caused by: org.springframework.web.servlet.NoHandlerFoundException: No handler found for GET /null/swagger-resources/configuration/ui
Swagger gradle dependencies versions are as below
compile('io.springfox:springfox-swagger2:2.7.0')
compile('io.springfox:springfox-swagger-ui:2.7.0')
you need close like this browser tab.
my spring boot application port is 8888, when i close this tab and restart my spring boot application, the error is gone.
Hopefully it is the issue with IntelliJ editor. I'm running multiple microservices on different ports and shutting them down once the work is done, but IJ editor might have cached the port(which it already shut down) and causing this confusion and error. I have restarted the service with a different port, and the error is gone.
Note: In general, we will get BIND ERROR : Address already in use, if any other service is running on the same port.

Resources