jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.55k stars 4.02k forks source link

Upgrading jhipster project to 8.0.0 fails #24296

Closed naris closed 10 months ago

naris commented 11 months ago
Overview of the issue

When I attempt to upgrade my project form jhipster 7.9.4 (which was originally started with jhipster 7.0.2 and upgraded many times) to jhipster 8.0.0, the upgrade fails with this message:

βœ” Cleaned up project directory INFO! Regenerating application with JHipster 8.0.0 and generator-jhipster-primeng-blueprint8.0.0 ... INFO! npm exec --no jhipster -- --with-entities --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks ERROR! ERROR! Command failed with exit code 1: npm exec --no jhipster -- --with-entities --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks Error: Command failed with exit code 1: npm exec --no jhipster -- --with-entities --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks at makeError (file:///C:/Users/murwilso/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/execa/lib/error.js:60:11) at execaSync (file:///C:/Users/murwilso/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/execa/index.js:201:17) at execaCommandSync (file:///C:/Users/murwilso/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/execa/index.js:276:9) at UpgradeGenerator.spawnCommandSync (file:///C:/Users/murwilso/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/yeoman-generator/dist/actions/spawn-command.js:24:16) at UpgradeGenerator._generate (file:///C:/Users/murwilso/AppData/Roaming/npm/node_modules/generator-jhipster/dist/generators/upgrade/generator.mjs:124:29) at UpgradeGenerator._regenerate (file:///C:/Users/murwilso/AppData/Roaming/npm/node_modules/generator-jhipster/dist/generators/upgrade/generator.mjs:142:14) at UpgradeGenerator.generateWithTargetVersion (file:///C:/Users/murwilso/AppData/Roaming/npm/node_modules/generator-jhipster/dist/generators/upgrade/generator.mjs:372:22) at UpgradeGenerator.executeTask (file:///C:/Users/murwilso/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:244:26) at env.queueTask.once (file:///C:/Users/murwilso/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:218:56) at runLoop.add.once (file:///C:/Users/murwilso/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/yeoman-environment/dist/environment-base.js:381:23) { shortMessage: 'Command failed with exit code 1: npm exec --no jhipster -- --with-entities --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks', command: 'npm exec --no jhipster -- --with-entities --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks', escapedCommand: 'npm exec --no jhipster -- --with-entities --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks', exitCode: 1, signal: undefined, signalDescription: undefined, stdout: undefined, stderr: undefined, cwd: 'C:\src\totalfact', failed: true, timedOut: false, isCanceled: false, killed: false }

Motivation for or Use Case

to upgrade jhipster to latest supported version

Reproduce the error

upgrade a jhipster project to 8.0.0

Related issues
Suggest a Fix
JHipster Version(s)

7.9.4 to 8.0.0 upgrade

JHipster configuration

.yo-rc.json TotalFact.jdl.txt totalfact.zip

JDL entity definitions
entity UPC {
  upcKey String maxlength(15)
  name String maxlength(250) required
  description String maxlength(1024)
  dataSource TextBlob
  keywords TextBlob
  userNotes TextBlob
  restrictedResellerFlag Boolean
  hidden Boolean
  createUser String required
  createDate Instant required
  modifyUser String
  modifyDate Instant
}
entity UPCRule {
  ruleText TextBlob required
  ruleDate Instant required
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
entity PlatformType {
  name String maxlength(10) required
  description String
}
entity Platform {
  primarySymbol String maxlength(128) required
  fieldName String maxlength(250) required
  fieldDescription String maxlength(1024)
  fieldLength Integer
  fieldValue String maxlength(100)
  shortHeaderName String maxlength(10)
  longHeaderName String maxlength(200)
  inUse Boolean
  premiumField Boolean
  approvalRequired Boolean
  royalty Boolean
  token String maxlength(50)
  sasKey String maxlength(10)
  rateId String maxlength(10)
  countType String maxlength(1)
  kvp String maxlength(50)
  caseable Boolean
  sanRequired Boolean
  waiverRequired Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
entity PlatformDE {
  ecapsKey Integer
  defaultValue String maxlength(10)
  usedInBilling Boolean
  displayZeroCounts Boolean
  areaFillinRequired Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
entity PlatformInst {
  pricingFlag Boolean
  selectFlag Boolean
  outputFlag Boolean
  crosstabFlag Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
entity PlatformList {
  pricingFlag Boolean
  selectFlag Boolean
  outputFlag Boolean
  crosstabFlag Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
entity Product {
  name String
  description String
  productKey Integer min(0) max(999)
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
entity Release {
  version String
  releaseDate Instant
}
entity Dimension {
  name String maxlength(128) required
  description String
  createUser String required
  createDate Instant required
  modifyUser String
  modifyDate Instant
}
entity Category {
  name String maxlength(128) required
  createUser String required
  createDate Instant required
  modifyUser String
  modifyDate Instant
}
entity Attribute {
  fieldLevel String maxlength(128)
  createUser String required
  createDate Instant required
  modifyUser String
  modifyDate Instant
}
entity Section {
  sectionKey String maxlength(10) required
  name String maxlength(128) required
  selfReported Boolean
  modeled Boolean
  thirdParty Boolean
  areaLevel Boolean
  compiled Boolean
  updatedDaily Boolean
  updatedWeekly Boolean
  updatedBiWeeekly Boolean
  updatedMonthly Boolean
  updatedSixWeeeks Boolean
  updatedQuatrerly Boolean
  updatedSemiAnnually Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
entity FieldValue {
  fieldValue String maxlength(25) required
  valueDefinition String
  averageMatchRate Float min(0) max(100)
  displayOrder Integer
  activeFlag Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
entity Task {
  name String required
  taskUser String maxlength(25) required
  taskOrder Integer
  showOnMainPage Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
entity Step {
  completed Boolean
  notes TextBlob
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
entity PrivateNotes {
  noteText TextBlob
  noteDate Instant required
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
entity ProtectedClass {
  code Integer min(0) max(9) required
  name String maxlength(128)
  description String maxlength(1024)
}
entity Derivation {
  code String maxlength(10) required
  name String maxlength(128)
  description String maxlength(1024)
}
entity SourceType {
  code String maxlength(10) required
  name String maxlength(128)
  description String maxlength(1024)
}
entity Universe {
  code String maxlength(10) required
  name String maxlength(128) required
}
entity EpsilonDataSource {
  name String maxlength(128)
}
entity Usage (jhi_usage) {
  action String required
  parm String
  user String maxlength(25) required
  dateTime Instant required
}
relationship OneToOne {
  Platform{de} to PlatformDE{platform}
  Platform{install} to PlatformInst{platform}
  Platform{list} to PlatformList{platform}
  PlatformDE{platform} to Platform{de}
  PlatformInst{platform} to Platform{install}
  PlatformList{platform} to Platform{list}
}
relationship OneToMany {
  UPC{rules} to UPCRule{upc required}
  UPC{privateNotes} to PrivateNotes{upc required}
  UPC{platforms required} to Platform{upc required}
  UPC{steps} to Step{uPC}
  Platform{values required} to FieldValue{platform}
  Dimension{categories required} to Category{dimension}
  Category{platform} to Platform{category}
}
relationship ManyToOne {
  UPC{attribute required} to Attribute
  UPC{category required} to Category
  UPC{protectedClass} to ProtectedClass
  UPC{epsilonDataSource} to EpsilonDataSource
  UPCRule{upc required} to UPC{rules}
  Platform{release} to Release
  Platform{category} to Category{platform}
  Platform{platformType} to PlatformType
  Platform{upc required} to UPC{platforms required}
  PlatformDE{section} to Section
  Product{platformType} to PlatformType
  Dimension{universe} to Universe
  Category{dimension} to Dimension{categories required}
  FieldValue{platform} to Platform{values required}
  Step{task} to Task
  Step{uPC} to UPC{steps}
  PrivateNotes{upc required} to UPC{privateNotes}
}
relationship ManyToMany {
  UPC{sourceType} to SourceType{upc}
  UPC{derivation} to Derivation{upc}
  Platform{product} to Product{platform}
  Product{platform} to Platform{product}
  Derivation{upc} to UPC{derivation}
  SourceType{upc} to UPC{sourceType}
}

paginate UPC, UPCRule, PlatformType, Platform, PlatformDE, PlatformInst, PlatformList, Product, Release, Dimension, Category, Attribute, Section, FieldValue, Task, Step, PrivateNotes, ProtectedClass, Derivation, SourceType, Universe, EpsilonDataSource, Usage with pagination
service UPC, UPCRule, PlatformType, Platform, PlatformDE, PlatformInst, PlatformList, Product, Release, Dimension, Category, Attribute, Section, FieldValue, Task, Step, PrivateNotes, ProtectedClass, Derivation, SourceType, Universe, EpsilonDataSource, Usage with serviceClass
filter UPC, UPCRule, PlatformType, Platform, PlatformDE, PlatformInst, PlatformList, Product, Release, Dimension, Category, Attribute, Section, FieldValue, Task, Step, PrivateNotes, ProtectedClass, Derivation, SourceType, Universe, EpsilonDataSource, Usage

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
sonal-prosperos commented 11 months ago

We are also facing the same issue while upgrading jhipster version from 7.9.4 -> 8.0.0 ERROR! ERROR! Command failed with exit code 1: npm exec --no jhipster -- --with-entities --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks Error: Command failed with exit code 1: npm exec --no jhipster -- --with-entities --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks { shortMessage: 'Command failed with exit code 1: npm exec --no jhipster -- --with-entities --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks', command: 'npm exec --no jhipster -- --with-entities --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks', escapedCommand: 'npm exec --no jhipster -- --with-entities --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks', exitCode: 1, signal: undefined, signalDescription: undefined, stdout: undefined, stderr: undefined, cwd: '/Users/sonalchandani/prosperos/catarina', failed: true, timedOut: false, isCanceled: false, killed: false }

We tried multiple things to work it around 1) followed steps mentioned in https://github.com/jhipster/generator-jhipster/issues/22495#issuecomment-1587806831 but it didn't work. 2) also tried to use node 16 as well but it still didnt work.

Please let us know what would be the fix for this issue.

mraible commented 11 months ago

@sonal-prosperos Can you try the migrate blueprint? You'll have to clone the repo and run npm ci && npm link before running it. I was able to use it on my v7 project and it worked. See comments on this issue for more information.

sonal-prosperos commented 11 months ago

I'll try this out and with update you πŸ‘

OmarHawk commented 11 months ago

@sonal-prosperos Can you try the migrate blueprint? You'll have to clone the repo and run npm ci && npm link before running it. I was able to use it on my v7 project and it worked. See comments on this issue for more information.

We had the very same issue and using that blueprint worked (we just installed the npm package, not cloning the repo) -> not throwing the mentioned errors. Still not yet done with the manual part of the upgrade process, as there were kind of a lot of conflicts in our customizations, but from the upgrade process point of view looking so far quite alright.

mraible commented 10 months ago

@sonal-prosperos Did you have any luck using the migrate blueprint? I'm going to close this assuming it worked. If it did not, please re-open.

naris commented 7 months ago

@mraible, I have finally gotten a chance to attempt to migrate my project using the migrate blueprint, which I installed with npm install jhipster-primeng-blueprint, and it did not go well :( It failed with a weird error complaining about an \@ in the generated code for the welcome page that is no longer present in my project: `βœ” successfully regenerated source application using JHipster 7.9.4 βœ” applying prettier to source application ERROR! An error occured while running jhipster-migrate:migrate#prepareMigrateBranch ERROR! ERROR! Failed to load plugin '@typescript-eslint' declared in 'CLIOptions': Cannot find module 'typescript' Require stack:

naris commented 7 months ago

I have created a bug for generator-jhipster-migrate with this issue

naris commented 7 months ago

@mraible, the jhipster-migrate tool does not work :( I created a bug in the generator-jhipster-migrate project. I have since found that if I generate a new project using jhipster 7.9.4, without any plugins, and then tried to migrate it with generator-jhipster-migrate and it fails due to an @ in the default welcome page of the generated code (for the twitter link)

ERROR! An error occured while running jhipster-migrate:migrate#prepareMigrateBranch ERROR! ERROR! Failed to load plugin '@typescript-eslint' declared in 'CLIOptions': Cannot find module 'typescript' Require stack:

mraible commented 7 months ago

Are you using Node 16?

naris commented 7 months ago

@mraible The problem is when attempting to migrate jhipster angular applications that angular doesn't like @ in the source files, especially html, and will fail if it encounters them. This happens when the migration process run prettier on the source code since the default welcome page includes @ jhipster as a link to twitter :(

I am using node v18.13.0