generator-jhipster: Internal server error response on production mode with MySQL server, but transaction was OK

My app always showed “error.internalServerError” message when I did any transactions (create/edit/delete) to a MySQL database server. Cancelled the dialog box and refreshed the table. The transaction was done perfectly. And this only happened in the production mode. Tested on dev mode, everything worked fine, no “internal server error” message. I don’t know how to trace this bug.

Note that I tested the production mode using previous jhipster version, it didn’t show this message, but I forgot which version it was.

Reproduce error

To test if this wasn’t my application, I generated a fresh jhipster app (see the info below). Used different database schema. The error message still showed up but the transaction was done.

Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
mysql-test@0.0.0 /mysql_test
└── generator-jhipster@4.1.1 

JHipster configuration, a .yo-rc.json file generated in the root folder
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "org.cardiacatlas.xpacs"
    },
    "jhipsterVersion": "4.1.1",
    "baseName": "mysql_test",
    "packageName": "org.cardiacatlas.xpacs",
    "packageFolder": "org/cardiacatlas/xpacs",
    "serverPort": "8080",
    "authenticationType": "session",
    "hibernateCache": "ehcache",
    "clusteredHttpSession": false,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mysql",
    "searchEngine": "elasticsearch",
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "rememberMeKey": "***",
    "clientFramework": "angular1",
    "useSass": false,
    "clientPackageManager": "yarn",
    "applicationType": "monolith",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": false
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory

PatientInfo.json

{
    "fluentMethods": true,
    "relationships": [],
    "fields": [
        {
            "fieldName": "patient_id",
            "fieldType": "String",
            "fieldValidateRules": [
                "required"
            ]
        },
        {
            "fieldName": "cohort",
            "fieldType": "String"
        },
        {
            "fieldName": "ethnicity",
            "fieldType": "String"
        },
        {
            "fieldName": "gender",
            "fieldType": "GenderType",
            "fieldValues": "female,male,unknown",
            "fieldValidateRules": [
                "required"
            ]
        },
        {
            "fieldName": "primary_diagnosis",
            "fieldType": "String"
        }
    ],
    "changelogDate": "***",
    "dto": "no",
    "service": "no",
    "entityTableName": "patient_info",
    "pagination": "pagination"
}

Browsers and Operating System

java version “1.8.0_60” Java™ SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot™ 64-Bit Server VM (build 25.60-b23, mixed mode)

git version 2.6.4 (Apple Git-63)

node: v6.9.5

npm: 3.10.10

bower: 1.8.0

gulp: [10:31:12] CLI version 1.2.2 [10:31:12] Local version 3.9.1

yeoman: 1.8.5

yarn: 0.21.3

Docker version 17.03.0-ce, build 60ccb22

docker-compose version 1.11.2, build dfed245

Output from creating a new row

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-XSRF-TOKEN: ***' -d '{ \ 
   "cohort": "string", \ 
   "ethnicity": "string", \ 
   "gender": "female", \ 
   "patient_id": "PAT002", \ 
   "primary_diagnosis": "string" \ 
 }' 'http://localhost:8080/api/patient-infos'

Response body:

{
  "message": "error.internalServerError",
  "description": "Internal server error",
  "fieldErrors": null
}

Response Code: 500

Response Header:

{
  "content-encoding": "gzip",
  "expires": "0",
  "cache-control": "no-cache, no-store, max-age=0, must-revalidate",
  "x-xss-protection": "1; mode=block",
  "pragma": "no-cache",
  "date": "Mon, 27 Mar 2017 21:25:38 GMT",
  "connection": "keep-alive",
  "x-content-type-options": "nosniff",
  "transfer-encoding": "chunked",
  "content-type": "application/json;charset=UTF-8",
  "x-application-context": "mysql_test:prod,swagger:8080"
}

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (12 by maintainers)

Most upvoted comments

Yes, I agree we should document this better