generator-jhipster: jhipster upgrade command failed for project with Indonesian language generated prior version v6.1.0
Overview of the issue
jhipster upgrade command failed for project with indonesian language generated before version v6.1.0
related to this: https://github.com/jhipster/generator-jhipster/issues/9494 https://github.com/jhipster/generator-jhipster/pull/9722/commits/c67d8aeeffdabc130e13a726fd5e14f6fbf5e0e5
stacktrace:
ERROR! Error: Unsupported language "id" passed as argument to language generator.
Supported languages:
al (Albanian)
ar-ly (Arabic (Libya))
hy (Armenian)
by (Belorussian)
bn (Bengali)
ca (Catalan)
zh-cn (Chinese (Simplified))
zh-tw (Chinese (Traditional))
cs (Czech)
da (Danish)
nl (Dutch)
en (English)
et (Estonian)
fa (Farsi)
fi (Finnish)
fr (French)
gl (Galician)
de (German)
el (Greek)
hi (Hindi)
hu (Hungarian)
in (Indonesian)
it (Italian)
ja (Japanese)
ko (Korean)
mr (Marathi)
my (Myanmar)
pl (Polish)
pt-br (Portuguese (Brazilian))
pt-pt (Portuguese)
ro (Romanian)
ru (Russian)
sk (Slovak)
sr (Serbian)
es (Spanish)
sv (Swedish)
tr (Turkish)
ta (Tamil)
te (Telugu)
th (Thai)
ua (Ukrainian)
uz-Cyrl-uz (Uzbek (Cyrillic))
uz-Latn-uz (Uzbek (Latin))
vi (Vietnamese)
at Environment.error (C:\Users\comp\AppData\Roaming\npm\node_modules\generator-jhipster\node_modules\yeoman-environment\lib\environment.js:176:40)
at module.exports.error (C:\Users\comp\AppData\Roaming\npm\node_modules\generator-jhipster\generators\generator-base.js:1427:18)
at shelljs.exec (C:\Users\comp\AppData\Roaming\npm\node_modules\generator-jhipster\generators\upgrade\index.js:134:23)
at C:\Users\comp\AppData\Roaming\npm\node_modules\generator-jhipster\node_modules\shelljs\src\exec.js:127:9
at ChildProcess.exithandler (child_process.js:301:5)
at ChildProcess.emit (events.js:189:13)
at maybeClose (internal/child_process.js:970:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
Emitted 'error' event at:
at Environment.error (C:\Users\comp\AppData\Roaming\npm\node_modules\generator-jhipster\node_modules\yeoman-environment\lib\environment.js:178:15)
at module.exports.error (C:\Users\comp\AppData\Roaming\npm\node_modules\generator-jhipster\generators\generator-base.js:1427:18)
[... lines matching original stack trace ...]
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
Motivation for or Use Case
cannot update project to v6.1.0
Reproduce the error
- create project with v6.0.1 and add Indonesian language translation and also as native language
- update generator-jhipster to v6.1.0
- run
jhipster upgrade
Suggest a Fix
I haven’t going through the code, but i assumed it’s caused by there’s no trace of “id” since all of it was replaced to “in” on v6.1.0 release. It should’ve still recognized the “id” while upgrading for backward compatibility, and replace it to “in” after everything is completed.
Replacing the existing language json config manually to “in” after the error and do another jhipster upgrade cause another local changes error because of previous partially updated files, so i must delete node_modules directory and use jhipster command to do the upgrade.
JHipster Version(s)
C:\Users\comp\Downloads\jh\test
`-- generator-jhipster@6.1.0
JHipster configuration
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
"generator-jhipster": {
"databaseType": "sql",
"devDatabaseType": "mariadb",
"enableHibernateCache": true,
"enableSwaggerCodegen": false,
"enableTranslation": true,
"jhiPrefix": "test",
"languages": [
"id",
"zh-cn",
"zh-tw",
"en"
],
"messageBroker": false,
"nativeLanguage": "id",
"packageName": "com.test.test",
"packageFolder": "com/test/test",
"prodDatabaseType": "mariadb",
"searchEngine": false,
"serviceDiscoveryType": "eureka",
"skipClient": true,
"testFrameworks": [
"gatling",
"cucumber"
],
"websocket": false,
"baseName": "test",
"applicationType": "microservice",
"buildTool": "gradle",
"jhipsterVersion": "6.0.1",
"skipUserManagement": true,
"clientPackageManager": "npm",
"authenticationType": "jwt",
"cacheProvider": "hazelcast",
"serverPort": "8081",
"entitySuffix": "",
"dtoSuffix": "DTO",
"otherModules": []
}
}
- [v] Checking this box is mandatory (this is just to show you read everything)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (18 by maintainers)
Somehow I totally missed this issue. The reason I changed the locale name was because of a bug in Java specifically related to parsing the correct indonesian locale (see: https://github.com/jhipster/generator-jhipster/issues/9494#issuecomment-480386162 and https://bugs.openjdk.java.net/browse/JDK-6457127). This is a super specific bug and IMO not worth fixing. Also it looks like the discussion moved away from the Original Poster’s bug. So IMO we should close this issue.
Thanks @pascalgrimaud. I have alredy done some work related to this in #10037(needs conflict resolution) and more specifically in commit https://github.com/jhipster/generator-jhipster/pull/10037/commits/69b5a027f1360cc5cd2a60ca88a6d1677300a9d2.
Although with the fix #10226 provided by @kaidohallik maybe we could move this pre-upgrade logic into the language sub-gen itself. Will need to check. The only problem I can think of right now is that a change is needed in the config file before actual generation and we need to check if the languages config array is used before the language sub-gen is invoked.
@kaidohallik are you interested in checking this since you also fixed #10226?
Yes, I know a lot of people want to keep it. That’s why we should find an official maintainer for this
May it would be much neater if its moved to the CLI instead of generator like the import jdl part. Since in CLI we don’t have any yeoman limitations and the code can be much simpler. Also once in CLI we can use advanced node features if needed
On Sat, 15 Jun 2019, 4:27 pm Aurélien Mino, notifications@github.com wrote:
Yes agree with you Matt about the value of this. That’s why I think it should go to a separate project, as the upgrade sub gen is simply a list of git commands. It can be replaced by a SH or Bash, and should not depend on a specific version of JHipster release.
Like this, we can’t do anything until the next release. And if we manage to find a fix, after a new release, we can’t know if it will work well.
The best should be to go to a specific project to not rely on JHipster releases
I love the idea behind it and I’ve used it with success myself. As a sponsor, I’d like to see more bug bounties geared towards it.