Problems with microservices in prod mode

700 views
Skip to first unread message

Matt Raible

unread,
Jun 19, 2017, 8:14:26 PM6/19/17
to JHipster dev team
Hey all,

I’m creating a microservices tutorial with JHipster for an upcoming blog post. You can see it at the following URL:


Warning: this URL will 404 once the blog post is published.

Everything works great when I run it using Maven. However, when I try to use Docker Compose, Kubernetes, or Maven in “prod” mode, it fails. Here’s the two issues:

1. I’m able to add an “entry”, but after doing so, the “getAllEntries” fails. Console error is:

2017-06-19 18:08:06.930 ERROR 17597 --- [ XNIO-2 task-62] o.j.b.w.rest.errors.ExceptionTranslator  : An unexpected error occured: Unable to access lob stream; nested exception is org.hibernate.HibernateException: Unable to access lob stream

2. I’m not add any “product” entities. I’m able to view the UI (because it’s on the gateway), but when I try to post one, I get:

2017-06-19 18:12:15.592  WARN 17597 --- [ XNIO-2 task-67] o.s.c.n.zuul.web.ZuulHandlerMapping      : No routes found from RouteLocator

Any ideas?

To reproduce:

cd jhipster-microservices-example/docker
docker-compose up

Log in to http://localhost:8080, add an entry. Then try adding a product.

Thanks,

Matt

Matt Raible

unread,
Jun 19, 2017, 10:56:39 PM6/19/17
to JHipster dev team
Correction - issue #2 only happens when running in Minikube. It doesn’t happen when running with docker-compose. Running with docker-compose does surface a new issue: missing translations.

Matt Raible

unread,
Jun 20, 2017, 10:08:38 AM6/20/17
to JHipster dev team
On Jun 19, 2017, at 6:14 PM, Matt Raible <ma...@raibledesigns.com> wrote:

Hey all,

I’m creating a microservices tutorial with JHipster for an upcoming blog post. You can see it at the following URL:


Warning: this URL will 404 once the blog post is published.

Everything works great when I run it using Maven. However, when I try to use Docker Compose, Kubernetes, or Maven in “prod” mode, it fails. Here’s the two issues:

1. I’m able to add an “entry”, but after doing so, the “getAllEntries” fails. Console error is:

2017-06-19 18:08:06.930 ERROR 17597 --- [ XNIO-2 task-62] o.j.b.w.rest.errors.ExceptionTranslator  : An unexpected error occured: Unable to access lob stream; nested exception is org.hibernate.HibernateException: Unable to access lob stream

This seems to be a known issue with Postgres and was reported last year.


Adding @Transactional to my getAllEntries() method solves the problem.

Still working on the issue below…

Matt Raible

unread,
Jun 20, 2017, 10:25:48 AM6/20/17
to JHipster dev team
This issue (translation-not-found) happens in dev mode too. It seems there’s a bug in “jhipster entity” when generating the UI from a microservice. The resulting product.json in my gateway looks as follows:

{
    "blogApp": {
        "product" : {
            "home": {
                "title": "Products",
                "createLabel": "Create a new Product",
                "createOrEditLabel": "Create or edit a Product",
                "search": "Search for Product"
            },
            "delete": {
                "question": "Are you sure you want to delete Product {{ id }}?"
            },
            "detail": {
                "title": "Product"
            },
            "name": "Name",
            "price": "Price"
        }
    },
    "storeApp": {
        "product" : {
            "created": "A new Product is created with identifier {{ param }}",
            "updated": "A Product is updated with identifier {{ param }}",
            "deleted": "A Product is deleted with identifier {{ param }}"
        }
    }
}

It seems like the created/updated/deleted keys should be under the “blogApp” instead of “storeApp”. Is that correct?

Thanks,

Matt

Matt Raible

unread,
Jun 20, 2017, 2:12:36 PM6/20/17
to JHipster dev team
On Jun 19, 2017, at 6:14 PM, Matt Raible <ma...@raibledesigns.com> wrote:

Hey all,

I’m creating a microservices tutorial with JHipster for an upcoming blog post. You can see it at the following URL:


Warning: this URL will 404 once the blog post is published.

Everything works great when I run it using Maven. However, when I try to use Docker Compose, Kubernetes, or Maven in “prod” mode, it fails. Here’s the two issues:

1. I’m able to add an “entry”, but after doing so, the “getAllEntries” fails. Console error is:

2017-06-19 18:08:06.930 ERROR 17597 --- [ XNIO-2 task-62] o.j.b.w.rest.errors.ExceptionTranslator  : An unexpected error occured: Unable to access lob stream; nested exception is org.hibernate.HibernateException: Unable to access lob stream

2. I’m not add any “product” entities. I’m able to view the UI (because it’s on the gateway), but when I try to post one, I get:

2017-06-19 18:12:15.592  WARN 17597 --- [ XNIO-2 task-67] o.s.c.n.zuul.web.ZuulHandlerMapping      : No routes found from RouteLocator

I was able to fix this by upgrading to JHipster Registry 3.0.2 in my Docker and Kubernetes files. However, when I deploy to Google Cloud, my “store” app is not registered and I’m unable to add products. 

Running `kubectl logs jhipster-registry-0` gives me the following info:

2017-06-20 18:10:31.909  WARN 7 --- [nfoReplicator-0] c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failed with message: Illegal character in authority at index 7: http://admin:${jhipster.registry.password}@jhipster-registry-1.jhipster-registry.default.svc.cluster.local:8761/eureka/
2017-06-20 18:10:31.909 ERROR 7 --- [nfoReplicator-0] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error

at java.net.URI.create(URI.java:852)
at com.sun.jersey.api.client.Client.resource(Client.java:434)
at com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient.register(AbstractJerseyEurekaHttpClient.java:50)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
at com.netflix.discovery.shared.transport.decorator.MetricsCollectingEurekaHttpClient.execute(MetricsCollectingEurekaHttpClient.java:73)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.executeOnNewServer(RedirectingEurekaHttpClient.java:118)
at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.execute(RedirectingEurekaHttpClient.java:79)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:119)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:798)
at com.netflix.discovery.InstanceInfoReplicator.run(InstanceInfoReplicator.java:104)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: http://admin:${jhipster.registry.password}@jhipster-registry-0.jhipster-registry.default.svc.cluster.local:8761/eureka/
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.parseAuthority(URI.java:3186)
at java.net.URI$Parser.parseHierarchical(URI.java:3097)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at java.net.URI.create(URI.java:850)
... 24 common frames omitted

Matt Raible

unread,
Jun 20, 2017, 2:29:33 PM6/20/17
to JHipster dev team
On Jun 20, 2017, at 12:13 PM, Matt Raible <ma...@raibledesigns.com> wrote:


On Jun 19, 2017, at 6:14 PM, Matt Raible <ma...@raibledesigns.com> wrote:

Hey all,

I’m creating a microservices tutorial with JHipster for an upcoming blog post. You can see it at the following URL:


Warning: this URL will 404 once the blog post is published.

Everything works great when I run it using Maven. However, when I try to use Docker Compose, Kubernetes, or Maven in “prod” mode, it fails. Here’s the two issues:

1. I’m able to add an “entry”, but after doing so, the “getAllEntries” fails. Console error is:

2017-06-19 18:08:06.930 ERROR 17597 --- [ XNIO-2 task-62] o.j.b.w.rest.errors.ExceptionTranslator  : An unexpected error occured: Unable to access lob stream; nested exception is org.hibernate.HibernateException: Unable to access lob stream

2. I’m not add any “product” entities. I’m able to view the UI (because it’s on the gateway), but when I try to post one, I get:

2017-06-19 18:12:15.592  WARN 17597 --- [ XNIO-2 task-67] o.s.c.n.zuul.web.ZuulHandlerMapping      : No routes found from RouteLocator

I was able to fix this by upgrading to JHipster Registry 3.0.2 in my Docker and Kubernetes files. However, when I deploy to Google Cloud, my “store” app is not registered and I’m unable to add products. 

Running `kubectl logs jhipster-registry-0` gives me the following info:

Nevermind about the error below, the store eventually came up and I was able to add products.

Cheers,

Matt
Reply all
Reply to author
Forward
0 new messages