Generator-jhipster: Error: Unrecognised application option name: herokuAppName.

Created on 31 Mar 2020  Â·  10Comments  Â·  Source: jhipster/generator-jhipster

Overview of the issue

After deploy the app to heroku, I can't export the JDL anymore

Reproduce the error
  1. crete simple app using Jhipster 6.8.0
  2. export JDL: works
  3. deply it to heroku
  4. export JDL: Fail!

jhipsterIssueJDLExport.txt

JHipster Version(s)

I'm using Jhipster 6.8.0
Yt seems to be aregression, It used to work in version 6.4.0

JHipster configuration

jhipster info.txt

Browsers and Operating System

Using: macOS Catalina

  • [x] Checking this box is mandatory (this is just to show you read everything)
area Heroku

All 10 comments

Thanks for reporting the issue. I don't see in your jhipster-info any JDL definitions. Can you give us your JDL please? :smile:

I have a feeling that the JDL file has a problem since in your stacktrace it says;

ERROR! Error: An error occurred while exporting to JDL: Unrecognised application option name: herokuAppName.

Attaching requested file:
jhipsterIssueJDLExport.jdl.txt

@PabloGancharov : That's not your jdl file; rather it's you .yo-rc.json file. Do you have a file ending with extension .jdl in the root of your project? :smile:

I dont have one besides the one I sent you, please check the jhipsterIssueJDLExport.txt
file I attached. It has all the commands I used to reproduce the bug.

This is reproducible by adding the below .yo-rc.json to a folder, then running jhipster export-jdl. The Heroku keys are added when you run jhipster heroku


.yo-rc.json file

{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.mycompany.myapp",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "6.8.0",
    "applicationType": "monolith",
    "baseName": "jhipsterIssueJDLExport",
    "packageName": "com.mycompany.myapp",
    "packageFolder": "com/mycompany/myapp",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mysql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "gradle",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "embeddableLaunchScript": false,
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "react",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "creationTimestamp": 1585680507827,
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": ["en"],
    "blueprints": [],
    "herokuAppName": "jhipster-issue-jdl-export",
    "herokuDeployType": "jar"
  }
}

@ruddell : Thanks for the clarification; I was mixing up import-jdl and export-jdl. :smile:

@MathieuAA : This error seems to come from;

https://github.com/jhipster/jhipster-core/blob/2aad2a54c8fc2b15853be292b9ae01db08d7815f/lib/core/jhipster/application_options.js#L286-L288

And it seems that in optionTypes we support only base options; not options generated by other sub-generators.

https://github.com/jhipster/jhipster-core/blob/2aad2a54c8fc2b15853be292b9ae01db08d7815f/lib/core/jhipster/application_options.js#L214-L265

I suggest we change the above error to a warning instead and skip the option if it's not in optionsTypes? Is there a reason we have a hard stop if an option isn't found? :smile:

A warning is better I agree. Do you want to create a PR for that ?

Thanks for the confirmation. Yes I'll create one today. :smile:

On Wed, Apr 1, 2020, 1:23 AM Mathieu ABOU-AICHI notifications@github.com
wrote:

A warning is better I agree. Do you want to create a PR for that ?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/11532#issuecomment-607106772,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AC64D7KVAO4O4NQK22BHEA3RKL2XDANCNFSM4LX4HDSA
.

Thanks @SudharakaP!

@MathieuAA : I've done the change. Note that I thought it was better to log it as a debug message instead since otherwise for all the non existent optiontypes it would show the message in the log; which might be not the best say when we have another sub-generator with lots of optiontypes (say GAE subgenerator will have like at least more than 5 optiontypes and for each of these we probably don't want a line printed in the log).

Let me know your thoughts and if there's any other changes needs to be done. :smile:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RizziCR picture RizziCR  Â·  3Comments

DanielFran picture DanielFran  Â·  3Comments

frantzynicolas picture frantzynicolas  Â·  3Comments

edvjacek picture edvjacek  Â·  3Comments

pascalgrimaud picture pascalgrimaud  Â·  4Comments