jhipster/jhipster-online

start create jhispter service issue

wp-jackliu opened this issue ยท 12 comments

Describe the bug
A clear and concise description of what the bug is.
website: https://start.jhipster.tech/generate-application
action : type any message on the form

click Download as Zip file
the zip file only contain a .yo-rc.json file.

Thanks for reporting this, @wp-jackliu

I think there is a problem with Yarn version.
How can we fix this, @SudharakaP ?

I've had a look at the logs and that seems indeed linked with Yarn doing a Git a command:

log `d1ffb2b1-5d5a-4ddd-b9fc-a4c144fa7c29` :     at PluginStore.exec (/usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/plugins/plugin-store.js:21:33)
log `d1ffb2b1-5d5a-4ddd-b9fc-a4c144fa7c29` :     at /usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/runners/git-executor-chain.js:95:45

I didn't know we were still using Yarn somewhere here! Calling also @PierreBesson for help here

@jdubois : it can be a problem with Node version. Can you check if we use a LTS version, specially 14.17.6 ?

Here what I have inside the container (in production):

root@9a614ec10d58:/# java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)
root@9a614ec10d58:/# node --version
v14.17.6
root@9a614ec10d58:/# yarn -version
1.22.5
root@9a614ec10d58:/# 

Oh I can reproduce the error inside the container, by running "jhipster" on the console:

? Please choose additional languages to install 
ERROR! Error: spawn git ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:467:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
GitError: Error: spawn git ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:467:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
    at Object.action (/usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/plugins/error-detection.plugin.js:30:33)
    at PluginStore.exec (/usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/plugins/plugin-store.js:21:33)
    at /usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/runners/git-executor-chain.js:95:45
    at new Promise (<anonymous>)
    at GitExecutorChain.handleTaskData (/usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/runners/git-executor-chain.js:93:16)
    at GitExecutorChain.<anonymous> (/usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/runners/git-executor-chain.js:77:46)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/runners/git-executor-chain.js:5:58) {
  task: {
    commands: [ 'rev-parse', '--is-inside-work-tree' ],
    format: 'utf-8',
    onError: [Function: onError],
    parser: [Function: parser]
  }
}

Argh "git" isn't install in the container!!!! WTF?

I guess all we need to do is install git in https://github.com/jhipster/jhipster-online/blob/main/Dockerfile as someone removed it from the main image

  • I fixed the production container manually -> it's currently running OK but that's obviously not a good solution at all
  • The issue was that Git wasn't installed: it looks to me that an apt-get update failed when creating the container, so I would first just try to build a new one
  • Otherwise, the solution is to do an apt-get install git

Unfortunately I'm not the best person to update this - I'm ready to help if needed, of course.

Ok thanks @jdubois : I'll have a look after lunch to try to fix this properly

jhipster-online should extend generator-jhipster image instead of creating its own from the ground.

Thanks for looking into this everyone. Sorry I was a bit busy over the past couple of weeks. But I just deployed the fix by @mshima to this so now it should all be good and working. Therefore I am closing this one. ๐Ÿ‘๐Ÿฝ