Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploying-to-heroku is out of date #44857

Open
starksm64 opened this issue Dec 1, 2024 · 2 comments · May be fixed by #44978
Open

deploying-to-heroku is out of date #44857

starksm64 opened this issue Dec 1, 2024 · 2 comments · May be fixed by #44978
Labels
area/housekeeping Issue type for generalized tasks not related to bugs or enhancements

Comments

@starksm64
Copy link
Contributor

starksm64 commented Dec 1, 2024

Description

I'm going through the https://quarkus.io/guides/deploying-to-heroku guide with a new heroku account and have run into the following 6 issues to deploy the quarkus app:

heroku create
git push heroku master
heroku open
  1. The guide says a free account is allowed, but I needed to verify a credit card to be able to attempt to push a repo. After I completed getting an app pushed, I see I'm running a basic dyno at a cost of 0.010/hour. I can go in and turn this off, but then the app is no longer accessible.

  2. The first is that master is an invalid branch name for the current getting-started repo. It should be main.

  3. The second is that there is no remote heroku repository. Running the heroku create command appears to create a tmp remote repository that would need to be added before the push:

starksm@Scotts-Mac-Studio getting-started % heroku create
git push heroku main  
heroku open
Creating app... done, ⬢ fast-eyrie-75995
https://fast-eyrie-75995-af4ca00a28cc.herokuapp.com/ | https://git.heroku.com/fast-eyrie-75995.git
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.
  1. Third, if I add the heroku remote using the previously created https://git.heroku.com/nameless-reef-15092.git repo, pushing to it fails with:
starksm@Scotts-Mac-Studio getting-started % git remote add heroku https://git.heroku.com/nameless-reef-15092.git
starksm@Scotts-Mac-Studio getting-started % git push heroku main
Enumerating objects: 3411, done.
Counting objects: 100% (3411/3411), done.
Delta compression using up to 10 threads
Compressing objects: 100% (1360/1360), done.
fatal: protocol error: bad line length character: fata
Writing objects: 100% (3411/3411), 2.59 MiB | 2.17 MiB/s, done.
Total 3411 (delta 985), reused 3394 (delta 979), pack-reused 0
fatal: the remote end hung up unexpectedly
error: failed to push some refs to 'https://git.heroku.com/nameless-reef-15092.git'

This is apparently an out of date git problem on macOS:
https://help.heroku.com/GJ1XRFT5/fatal-error-pushing-to-heroku-on-macos-with-git-2-39-3-apple-git-146

Updating git using homebrew

starksm@Scotts-Mac-Studio getting-started % PATH=/opt/homebrew/bin/:$PATH
starksm@Scotts-Mac-Studio getting-started % type git                     
git is /opt/homebrew/bin//git
starksm@Scotts-Mac-Studio getting-started % git --version                
git version 2.47.1
starksm@Scotts-Mac-Studio getting-started % git push heroku main
Enumerating objects: 3411, done.
Counting objects: 100% (3411/3411), done.
Delta compression using up to 10 threads
Compressing objects: 100% (1360/1360), done.
Writing objects: 100% (3411/3411), 2.59 MiB | 609.00 KiB/s, done.
Total 3411 (delta 985), reused 3394 (delta 979), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (985/985), done.
remote: 
remote: !	Push rejected, source repository is a shallow clone. Unshallow it with `git fetch --all --unshallow` and try pushing again.
remote: 
To https://git.heroku.com/nameless-reef-15092.git
 ! [remote rejected] main -> main (shallow update not allowed)
error: failed to push some refs to 'https://git.heroku.com/nameless-reef-15092.git'

Failed because I made a shallow clone of the https://github.com/quarkusio/quarkus-quickstarts.git repo. I had to unshallow the repo using git fetch origin --unshallow. The suggested git fetch --all --unshallow did not work.

  1. pushing the repo to heroku ends up building the etire quickstart repo, not just the
starksm@Scotts-Mac-Studio getting-started % git push heroku main        
Enumerating objects: 31140, done.
Counting objects: 100% (31140/31140), done.
Delta compression using up to 10 threads
Compressing objects: 100% (10030/10030), done.
Writing objects: 100% (31140/31140), 6.49 MiB | 655.00 KiB/s, done.
Total 31140 (delta 15326), reused 30834 (delta 15031), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (15326/15326), done.
remote: Updated 2248 paths from ab471b96
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-24 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Java app detected
remote: 
remote:  !     WARNING: No OpenJDK version specified
remote:        Your application does not explicitly specify an OpenJDK
remote:        version. The latest long-term support (LTS) version will be
remote:        installed. This currently is OpenJDK 21.
remote:        
remote:        This default version will change when a new LTS version is
remote:        released. Your application might fail to build with the new
remote:        version. We recommend explicitly setting the required OpenJDK
remote:        version for your application.
remote:        
remote:        To set the OpenJDK version, add or edit the system.properties
remote:        file in the root directory of your application to contain:
remote:        
remote:        java.runtime.version = 21
remote:        
remote: 
remote: -----> Installing OpenJDK 21... done
remote: -----> Executing Maven
remote:        $ ./mvnw -DskipTests clean dependency:list install
remote:        [INFO] Scanning for projects...

...
remote:        [INFO] ------------------------------------------------------------------------
remote: -----> Discovering process types
remote:        Procfile declares types     -> (none)
remote:        Default types for buildpack -> web
remote: 
remote: -----> Compressing...
remote:  !     Compiled slug size: 2.9G is too large (max is 500M).
remote:  !     See: http://devcenter.heroku.com/articles/slug-size
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !	Push rejected to nameless-reef-15092.
remote: 
To https://git.heroku.com/nameless-reef-15092.git
 ! [remote rejected]   main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/nameless-reef-15092.git'
  1. After copying the getting-started directory to a separate directory and initializing a new git repo and readding the heroku remote repo, the app deploys, but the heroku open command fails because that attempts to / context, which has no handler. One needs to use heroku open hello:
starksm@Scotts-Mac-Studio getting-started % git push heroku main       
Enumerating objects: 34, done.
Counting objects: 100% (34/34), done.
Delta compression using up to 10 threads
Compressing objects: 100% (24/24), done.
Writing objects: 100% (34/34), 14.04 KiB | 4.68 MiB/s, done.
Total 34 (delta 2), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Updated 17 paths from 1d2525c
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-24 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Java app detected
remote: -----> Installing OpenJDK 17... done
remote: -----> Installing Maven 3.9.4... done
remote: -----> Executing Maven
remote:        $ mvn -DskipTests clean dependency:list install
remote:        [INFO] Scanning for projects...
...
remote:        [INFO] ------------------------------------------------------------------------
remote:        [INFO] BUILD SUCCESS
remote:        [INFO] ------------------------------------------------------------------------
remote:        [INFO] Total time:  13.291 s
remote:        [INFO] Finished at: 2024-12-01T18:35:51Z
remote:        [INFO] ------------------------------------------------------------------------
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote: 
remote: -----> Compressing...
remote:        Done: 79.8M
remote: -----> Launching...
remote:        Released v3
remote:        https://nameless-reef-15092-932f904bd6bc.herokuapp.com/ deployed to Heroku
remote: 
remote: Verifying deploy... done.
To https://git.heroku.com/nameless-reef-15092.git
 * [new branch]      main -> main
starksm@Scotts-Mac-Studio getting-started % heroku open
starksm@Scotts-Mac-Studio getting-started % heroku open /hello
@starksm64 starksm64 added the area/housekeeping Issue type for generalized tasks not related to bugs or enhancements label Dec 1, 2024
@starksm64 starksm64 changed the title deploying-to-heroku is either out of date or incomplete deploying-to-heroku is out of date Dec 1, 2024
@maxandersen
Copy link
Member

well thats an impressive amount of papercuts - did you manage to get it all the way?

Wanna make a PR for the docs?

@starksm64
Copy link
Contributor Author

starksm64 commented Dec 5, 2024

Yes, I did eventually git it to deploy, but I have not looked into whether heroku has a way to only build a submodule of a repo when doing a push. Probably the guide just needs to document cloning the quickstart repo and then making a new getting-started repo as I did unless I do find a magic setting.

starksm64 added a commit to starksm64/quarkus that referenced this issue Dec 7, 2024
@starksm64 starksm64 linked a pull request Dec 7, 2024 that will close this issue
gsmet pushed a commit to starksm64/quarkus that referenced this issue Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/housekeeping Issue type for generalized tasks not related to bugs or enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants