generator-jhipster: [Microservices] Timeout error when calling services

Overview of the issue

On our main application, we been had noticing an issue where we see TIMEOUT errors (those red alerts) when running the entire stack through Docker - running just the registry, gateway, and service via a ./gradlew command doesn’t seem to trigger the timeout so far. The error seems to occur only intermittently when the gateway attempts to make a call to a separate service; we do not see the error when attempting to sign in, for instance.

Prior to submitting this issue, I’ve created a new application (still using the microservices configuration) consisting of a new gateway (called gateway) and microservice (called service1) app, and their respective configurations are provided below.

Docker logs for the gateway and service are here (note that this was started using the prod profile): http://pastebin.com/LPGfg78U

On the client side, the browser should spit out an error on the console, e.g. from Chrome:

http://localhost:8080/service1/api/stuffs?cacheBuster=1469041883439&page=0&size=20&sort=id,asc 500 (Internal Server Error)
Motivation for or Use Case

While searching through the past issues here and on SO, there seem to be a couple of other reports of a similar issue. I’m hoping to be able to confirm whether this is truly a bug or if it’s due to something I’m overlooking or misconfiguring.

JHipster Version(s)

3.4.2

JHipster configuration, a .yo-rc.json file generated in the root folder

Gateway:

{
  "generator-jhipster": {
    "jhipsterVersion": "3.4.2",
    "baseName": "gateway",
    "packageName": "some.sample",
    "packageFolder": "some/sample",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "hibernateCache": "hazelcast",
    "clusteredHttpSession": "hazelcast",
    "websocket": "no",
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "prodDatabaseType": "postgresql",
    "searchEngine": "no",
    "buildTool": "gradle",
    "jwtSecretKey": "d4d86ce6490f6214302b2c628db4aa01dd86dbdd",
    "useSass": true,
    "applicationType": "gateway",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": false
  }
}

Service:

{
  "generator-jhipster": {
    "jhipsterVersion": "3.4.2",
    "baseName": "service1",
    "packageName": "some.sample",
    "packageFolder": "some/sample",
    "serverPort": "8081",
    "authenticationType": "jwt",
    "hibernateCache": "hazelcast",
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "prodDatabaseType": "postgresql",
    "searchEngine": "elasticsearch",
    "buildTool": "gradle",
    "jwtSecretKey": "2515e9c0c90ac006134365126452884edf76cfe9",
    "enableTranslation": true,
    "applicationType": "microservice",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "skipClient": true,
    "skipUserManagement": true,
    "clusteredHttpSession": "no",
    "websocket": "no",
    "enableSocialSignIn": false,
    "nativeLanguage": "en",
    "languages": [
      "en",
      "fr"
    ]
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory

The JDL was not used; the entity was created using yo jhipster:entity, and the appropriate skip flag for the service and gateway.

Gateway:

{
    "relationships": [],
    "fields": [
        {
            "fieldName": "field1",
            "fieldType": "String"
        }
    ],
    "changelogDate": "20160720190010",
    "dto": "no",
    "service": "no",
    "entityTableName": "stuff",
    "pagination": "pagination",
    "microserviceName": "service1",
    "searchEngine": "no"
}

Service:

{
    "relationships": [],
    "fields": [
        {
            "fieldName": "field1",
            "fieldType": "String"
        }
    ],
    "changelogDate": "20160720190010",
    "dto": "no",
    "service": "no",
    "entityTableName": "stuff",
    "pagination": "pagination",
    "microserviceName": "service1",
    "searchEngine": "elasticsearch"
}

Browsers and Operating System

OS: OSX 10.11.5 Browsers: Firefox (45.2.0) and Chrome (51.0.2704.106)

Reproduce the error

Startup using the usual docker-compose up -d command. While logged in, attempt to access an entity’s page. For example, trigger the default GET request to list the entity, or POST when saving a new item. The request will still go through - creating a new item will actually be persisted to the DB and should display on the site on refresh.

Related issues

The most similar issue previously reported is: #3771, but it sounds like it only occurs on the first call for him. Like him, waiting a few minutes doesn’t seem to prevent the issue; I was also able to trigger it again when I attempted to create a new item (for the Stuff entity). I wasn’t able to find any issues which also utilizes Docker.

Suggest a Fix

Haven’t been able to pinpoint the exact problem. As mentioned in the linked issue, increasing the timeout may be a band-aid solution, but doesn’t solve the issue of answering why the requests can occasionally time out.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 17 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Some settings I use on gateway:

zuul:
    host:
        connect-timeout-millis: 5000
        socket-timeout-millis: 10000

hystrix:
    command:
        default:
            execution:
                isolation:
                    thread:
                        timeoutInMilliseconds: 10000