Generator-jhipster: Heroku sub-generator is broken in v5 on Linux

Created on 25 Jun 2018  Β·  5Comments  Β·  Source: jhipster/generator-jhipster

Overview of the issue

I created a brand new app with 5.0.1 this evening and it won't deploy to Heroku from my Linux laptop. I believe it could be a Linux issue since I've rarely experienced this on Mac, so I figured I'd enter an issue.

Here's the log I get after running jhipster heroku:

$ jhipster heroku
Using JHipster version installed globally
Executing jhipster:heroku
Options: 
Heroku configuration is starting
? Name to deploy as: gallery-pwa3
? On which region do you want to deploy ? us
? Which type of deployment do you want ? Git (compile on Heroku)
βœ– You don't have the Heroku CLI installed. Download it from https://cli.heroku.com/
 conflict pom.xml
? Overwrite pom.xml? overwrite this and all others
    force pom.xml
Congratulations, JHipster execution is complete!
Execution time: 50 s. sec                 
Since it prompted me to install the Heroku CLI again, I tried running the suggest command:
$ sudo snap install heroku --classic
[sudo] password for mraible: 
snap "heroku" is already installed, see 'snap help refresh'
Execution time: 3 s. sec    
Seems like I've found myself an infinite loop. ;) ##### **Motivation for or Use Case** Heroku deployment fails. ##### **Reproduce the error** Create a new app that uses React on Linux, install the [Heroku CLI](https://cli.heroku.com), then run `jhipster heroku` to deploy to Heroku. ##### **Suggest a Fix** Not sure what's causing this issue, but I experienced something similar while rehearsing my JHipsterConf talk last week. ##### **JHipster Version(s)**
[email protected] /home/mraible/gallery
└── (empty)

##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.okta.developer",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "5.0.1",
    "applicationType": "monolith",
    "baseName": "gallery",
    "packageName": "com.okta.developer",
    "packageFolder": "com/okta/developer",
    "serverPort": "8080",
    "authenticationType": "oauth2",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "clientFramework": "react",
    "useSass": false,
    "clientPackageManager": "yarn",
    "testFrameworks": [
      "protractor"
    ],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en",
      "fr"
    ],
    "herokuDeployType": "git"
  }
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory


JDL entity definitions

entity Album (album) {
  title String required,
  description TextBlob,
  created Instant
}
entity Photo (photo) {
  title String required,
  description TextBlob,
  image ImageBlob required,
  height Integer,
  width Integer,
  taken Instant,
  uploaded Instant
}
entity Tag (tag) {
  name String required minlength(2)
}
relationship ManyToOne {
  Album{user(login)} to User,
  Photo{album(title)} to Album
}
relationship ManyToMany {
  Photo{tag(name)} to Tag{photo}
}

paginate Album with pagination
paginate Photo, Tag with infinite-scroll

Environment and Tools

java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

git version 2.17.1

node: v8.10.0

npm: 6.1.0

yarn: 1.6.0

Docker version 18.05.0-ce, build f150324

docker-compose version 1.13.0, build 1719ceb

Most helpful comment

@mraible are you sure you weren't drunk :wink:

All 5 comments

Is the CLI available on path? I don't have this issue on my machine the
last time I tried (few months ago)

On Mon, 25 Jun 2018, 7:02 am Matt Raible, notifications@github.com wrote:

Overview of the issue

I created a brand new app with 5.0.1 this evening and it won't deploy to
Heroku from my Linux laptop. I believe it could be a Linux issue since I've
rarely experienced this on Mac, so I figured I'd enter an issue.

Here's the log I get after running jhipster heroku:

jhipster heroku
Using JHipster version installed globally
Executing jhipster:heroku
Options:
Heroku configuration is starting
? Name to deploy as: gallery-pwa3
? On which region do you want to deploy ? us
? Which type of deployment do you want ? Git (compile on Heroku)
βœ– You don't have the Heroku CLI installed. Download it from https://cli.heroku.com/
conflict pom.xml
? Overwrite pom.xml? overwrite this and all others
force pom.xml
Congratulations, JHipster execution is complete!
Execution time: 50 s. sec

Since it prompted me to install the Heroku CLI again, I tried running the
suggest command:

➜ gallery git:(master) βœ— sudo snap install heroku --classic
[sudo] password for mraible:
snap "heroku" is already installed, see 'snap help refresh'
Execution time: 3 s. sec

Seems like I've found myself an infinite loop. ;)
Motivation for or Use Case

Heroku deployment fails.
Reproduce the error

Create a new app that uses React on Linux, install the Heroku CLI
https://cli.heroku.com, then run jhipster heroku to deploy to Heroku.
Suggest a Fix

Not sure what's causing this issue, but I experienced something similar
while rehearsing my JHipsterConf talk last week.
JHipster Version(s)

[email protected] /home/mraible/gallery
└── (empty)

JHipster configuration, a .yo-rc.json file generated in the root folder .yo-rc.json
file

{
"generator-jhipster": {
"promptValues": {
"packageName": "com.okta.developer",
"nativeLanguage": "en"
},
"jhipsterVersion": "5.0.1",
"applicationType": "monolith",
"baseName": "gallery",
"packageName": "com.okta.developer",
"packageFolder": "com/okta/developer",
"serverPort": "8080",
"authenticationType": "oauth2",
"cacheProvider": "ehcache",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "maven",
"enableSwaggerCodegen": false,
"clientFramework": "react",
"useSass": false,
"clientPackageManager": "yarn",
"testFrameworks": [
"protractor"
],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "en",
"languages": [
"en",
"fr"
],
"herokuDeployType": "git"
}
}

JDL for the Entity configuration(s) entityName.json files generated in
the .jhipster directory
JDL entity definitions

entity Album (album) {
title String required,
description TextBlob,
created Instant
}
entity Photo (photo) {
title String required,
description TextBlob,
image ImageBlob required,
height Integer,
width Integer,
taken Instant,
uploaded Instant
}
entity Tag (tag) {
name String required minlength(2)
}
relationship ManyToOne {
Album{user(login)} to User,
Photo{album(title)} to Album
}
relationship ManyToMany {
Photo{tag(name)} to Tag{photo}
}

paginate Album with pagination
paginate Photo, Tag with infinite-scroll

Environment and Tools

java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

git version 2.17.1

node: v8.10.0

npm: 6.1.0

yarn: 1.6.0

Docker version 18.05.0-ce, build f150324

docker-compose version 1.13.0, build 1719ceb

β€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/7853, or mute the
thread
https://github.com/notifications/unsubscribe-auth/ABDlF9mSeCgIdyRQlPh3mpVfl2OayLNWks5uAG7ZgaJpZM4U1g-Q
.

Hi,

It had problems trying to deploy to heroku in Windows too. I gave a error message saying:

οƒ˜ Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0

(Latest Gradle version is 4.8). Weird, isn’t it?

If I can reproduce it, I will post more information. Sorry, but I deleted it.

It looks like the Heroku generator checks if Heroku CLI is installed with heroku --version. If I run that, it works:

$ heroku --version
heroku/7.4.7 linux-x64 node-v10.4.1

If I run heroku plugins, the heroku-cli-deploy plugin is installed too:

$ heroku plugins
heroku-cli-deploy 0.4.2

I just tried running jhipster heroku in my project again this morning, and this time it works. Β―_(ツ)_/Β―

This happened to me last week as well, so maybe it's just a bug that happens when I'm working late. ;)

@mraible are you sure you weren't drunk :wink:

Installing using curl seems to fix the problem:

curl https://cli-assets.heroku.com/install.sh | sh
Was this page helpful?
0 / 5 - 0 ratings

Related issues

loydjayme25 picture loydjayme25  Β·  71Comments

yelhouti picture yelhouti  Β·  123Comments

deepu105 picture deepu105  Β·  81Comments

abhinav910 picture abhinav910  Β·  50Comments

JulioJu picture JulioJu  Β·  64Comments