Permanently added the RSA host key for IP address - heroku

Everybody,
I get an error when I run this command: "git push heroku master". The error log shows the following:
$ git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.156' to the list of known hosts.
Counting objects: 3, done.
Writing objects: 100% (3/3), 209 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
-----> Heroku receiving push
! Heroku push rejected, no Rails or Rack app detected
To git#heroku.com:simple-earth-536.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#app_name.git'
Any idea what could cause this? I welcome any suggestions, thanks all.

This means that you are not in a rails application, such as if you are not in the correct directory.
Make sure you are actually in your apps directory.
rails myapp
cd myapp
This is the flow you should go through"
rails new_app
git init
git add .
git commit -m 'master'
heroku create
git push heroku

Related

Not able to redeploy the app after upgrading the heroku stack

We are in process of upgrading the heroku stack from 18 to 22. After clicking on upgrade while we are trying to redeploy the app we are getting the below error while doing git push:
error: src refspec master does not match any
error: failed to push some refs to 'https://git.heroku.com/test.git'
We are following the below steps to redeploy:
$ heroku git:clone -a test
$ cd test
$ git add .
$ git commit -am "make it better"
$ git push heroku master
Also we have followed the below steps from CLI as well
To upgrade via the Heroku CLI, use the stack:set command on your production app:
heroku stack:set heroku-22 -a test
Setting stack to heroku-22... done
You will need to redeploy ⬢ for the change to take effect.
Run git push heroku main to trigger a new build on ⬢ .
git commit --allow-empty -m "Upgrading to heroku-22"
[master (root-commit) 89fea09] Upgrading to heroku-22
git push heroku master
Enumerating objects: 2, done.
Counting objects: 100% (2/2), done.
Writing objects: 100% (2/2), 185 bytes | 185.00 KiB/s, done.
Total 2 (delta 0), reused 0 (delta 0), pack-reused 0
remote: error: pathspec '.' did not match any file(s) known to git.
remote:
remote: ! Heroku Git error, please try again shortly.
remote: ! See http://status.heroku.com for current Heroku platform status.
remote: ! If the problem persists, please open a ticket
remote: ! on https://help.heroku.com/tickets/new
remote:
To https://git.heroku.com/test.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/test.git'
bhattacharjee.c#bhattac-ltmynzq ei-mule-dashboard-ee1 % git push heroku main
error: src refspec main does not match any
error: failed to push some refs to 'https://git.heroku.com/test.git'.
We are getting the below error here:
remote: error: pathspec '.' did not match any file(s) known to git.
remote:
remote: ! Heroku Git error, please try again shortly.
remote: ! See http://status.heroku.com for current Heroku platform status.
remote: ! If the problem persists, please open a ticket
remote: ! on https://help.heroku.com/tickets/new
remote:
To https://git.heroku.com/test.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/test.git'
bhattacharjee.c#bhattac-ltmynzq ei-mule-dashboard-ee1 % git push heroku main
error: src refspec main does not match any
error: failed to push some refs to 'https://git.heroku.com/test.git'.
Could you please help us in resloving the issue.
We are following the below steps to redeploy:
$ heroku git:clone -a test
First of all, you shouldn't be doing this:
A Heroku app’s Git repository is intended for deployment purposes only. Cloning from this repository is not officially supported as a feature and should be attempted only as a last resort. Do not use this repository as your app’s canonical “origin” repository. Instead, use your own Git server or a version control service such as GitHub.
If this is part of your regular workflow, please adjust accordingly. Heroku is not a source code management platform.
Now, onto the problem:
src refspec master does not match any
You simply don't have a master branch.
Heroku builds from one of two branches: main (which is newer and slowly becoming the community standard default branch name) and master (legacy).
If you don't have a master branch, you almost certainly have a main branch that Heroku will happy build from:
git push heroku main
If you need to deploy from some other branch another-branch, you still need to push to main (or master) on Heroku:
git push heroku another-branch:main
Finally, please don't actually use "make it better" as a commit message. Spend some time making commit messages clear and meaningful. There is lots of good advice floating around about how you can do that.

How can I set a config variable in a one-off Heroku dyno?

I am writing a simple script that will run in a one-off heroku dyno (launched using the heroku run command). The script's objective is to get the hash of the latest commit on the master branch of my repo and set one of the heroku config variables to that.
I'm trying to execute the following commands to clone the repo into the heroku dyno, change directories to be in the directory created by the clone and then set the config variable to be the desired value.
heroku run "git clone https://`heroku config:get GITHUB_TOKEN`#github.com/<org>/<repo>.git && cd <repo> && `heroku config:set CURRENT_HASH=`git rev-parse HEAD``"
When I execute any and all of the commands that follow heroku run in my local terminal, it works fine. However, when I execute the command written above in a one-off dyno using heroku run, heroku config:set is invoked first and it sets the config variable CURRENT_HASH to an empty string. Then the git clone executes successfully (the config variable GITHUB_TOKEN is correctly read) and then git rev-parse HEAD is executed. So the output is like this:
Setting CURRENT_HASH and restarting <heroku app name>... done, v246
Running git clone https://<GITHUB_TOKEN>#github.com/<org>/<repo>.git; cd <repo>; git rev-parse HEAD on ⬢ <heroku app name>... up, run.1538 (Hobby)
Cloning into '<repo>'...
remote: Enumerating objects: 330, done.
remote: Counting objects: 100% (330/330), done.
remote: Compressing objects: 100% (222/222), done.
remote: Total 4635 (delta 123), reused 269 (delta 98), pack-reused 4305
Receiving objects: 100% (4635/4635), 8.95 MiB | 9.27 MiB/s, done.
Resolving deltas: 100% (2425/2425), done.
bbb748d543a511eed4986cddb68b292ce1be67ad //hash of the last commit
What I don't understand is why heroku config:set is executed first even though it's the last command. Also, when I try to execute heroku config:get or heroku config:set using heroku run without the backticks, the script fails with the error bash: heroku: command not found. That is why I use nested backticks for heroku config:set... and git rev-parse HEAD in order for the command not to fail with an error.
Any help would be very much appreciated.

How to deploy Sonarqube Server on Heroku Dyno

I have to deploy a SonarQube server on Heroku Web Dyno.
For this I have tried below items:
Downloaded the SonarQube Community Edition from
https://www.sonarqube.org/downloads/
Then I unzipped the folder and went into /sonarqube-7.8/ folder
Then I have created the Procfile with following content:
web: chmod u+x bin/linux-x86-64/sonar.sh &&
./bin/linux-x86-64/sonar.sh
Then I have created the system.properties file with below content:
java.runtime.version=1.8
Then I ran below commands to check in the SonarQube Server on Heroku Git and
ran the server:
git init
git add.
git commit -m "initial commit"
git push heroku master
The git bash console shows following after running the above mentioned commands:
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 391 bytes | 39.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> SonarQubeFramework app detected
remote: -----> Create setupSonar.sh
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 195.5M
remote: -----> Launching...
remote: Released v8
remote: https://<app_name>.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/<app_name>.git
cad2f14..55d4bcd master -> master
And I am getting below logs from on heroku
2019-06-28T10:54:19.321815+00:00 heroku[web.1]: Starting process with command `chmod u+x bin/linux-x86-64/sonar.sh && ./bin/linux-x86-64/sonar.sh`
2019-06-28T10:54:21.360549+00:00 heroku[web.1]: Process exited with status 1
2019-06-28T10:54:21.380868+00:00 heroku[web.1]: State changed from starting to crashed
2019-06-28T10:54:21.313195+00:00 app[web.1]: Usage: ./bin/linux-x86-64/sonar.sh { console | start | stop | force-stop | restart | status | dump }
Can anyone help me in deploying SonarQube Server on Heroku Cloud??
I am able to deploy the SonarQube server on Heroku Cloud:
Below are the commands to be executed in the same order:
heroku create <appName>
heroku addons:create heroku-postgresql:hobby-dev -a <appName>
heroku buildpacks:set https://github.com/NayaraCaetano/heroku-buildpack-sonarqube.git -a <appName>
mkdir <appName> && cd <appName>
touch README
git init
heroku git:remote -a <appName>
git add .
git commit -am "initial commit"
git push heroku master
heroku dyno:resize performance-m -a <appName>
Note: You have to use performance-m dyno (which is not free) on Heroku due to some memory constraints. Also free version of
Postgres will get exhausted within 1 or 2 scans, so you have to
upgrade it as per your need.

"Heroku push rejected, no Cedar-supported app detected" when trying to upload a Sinatra app with an existing git repo

I have an existing git repo for my personal website, which I am porting to Sinatra (mainly for templating, it's a static site). I do NOT want to lose/reset this git repository.
When I try to push to Heroku, I get the error below. I have a config.ru file, a Gemfile, and a Gemfile.lock, along with some other stuff for Sinatra. Running rackup works, running bundle exec rackup works, and I didn't get any warnings from Heroku about missing dependencies.
Am I missing something? I can post the directory structure of my site if it would help (though it's close sourced).
~/Repos/website ➜ gp heroku master
Counting objects: 2836, done.
Compressing objects: 100% (2669/2669), done.
Writing objects: 100% (2836/2836), 3.48 MiB | 252 KiB/s, done.
Total 2836 (delta 481), reused 2117 (delta 155)
-----> Heroku receiving push
! Heroku push rejected, no Cedar-supported app detected
To git#heroku.com:APP_NAME_HERE.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:APP_NAME_HERE.git'
A Cedar app should recognise the config.ru file and create a web process for you, so it's possible that some essential file is not tracked by git. Check that config.ru, Gemfile and Gemfile.lock are all committed (you can use git status, but note that it will not output anything for ignored files so you should also check your .gitignore file).
If all the files are committed, you could also try specifying the command you want the web process to use in a Procfile. See the Heroku docs for more information:
Getting started with Ruby: Declare process types with Procfile
Declaring and Scaling Process Types with Procfile
Problem solved. I was working on a git branch especially for Heroku/Sinatra support, and it turns out I was running git push heroku master, which pushed local master to remote master. The master branch did not have a valid Heroku app. I assumed it would push the current local branch to the remote master branch, which is not the case. git push sinatra:master solved the issue.
For those who find that the accepted answer doesn't solve their problem, this related question may provide the solution: "Heroku push rejected, no Cedar-supported app detected" when trying to upload a Sinatra app with an existing git repo

Cannot push to remote git repository

So I have been having troubles pushing my most recent commits to a remote repository that I have set up on Bitbucket.
I am originally using Xcode, and have asked this question and was recommended to use terminal to push instead of Xcode.
Now, I tried terminal but that did not solve the problem. But it did give me a more detailed error message when I try git push
Neils-iMac:ProjectName Neil$ git push
Password:
Counting objects: 49, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (38/38), done.
Writing objects: 100% (39/39), 975.78 KiB, done.
Total 39 (delta 31), reused 0 (delta 0)
error: RPC failed; result=55, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
fatal: expected ok/error, helper said '2004\??? ?&?ЇҶ-9?u?r?m?v?ǣ3Ƅ:??Eƒ?=?&?"d?+??
*^?eA??/3cv????ʞe??f???????
?(??`}D???5???^:T??PxP????%?338?]??F?}???Gf?g??[??*??}zƈ1X'
Neils-iMac:ProjectName Neil$
Neils-iMac:ProjectName Neil$
I am new to these remote repositories, and had everything working fine on Xcode, so if you recommend for me to do something in terminal it would help if you described how to do so.
See my previous question for a bit more detail.
EDIT: This is the result of;
git status:
# On branch master
# Your branch is ahead of 'origin/master' by 5 commits.
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# CrunchCalculator.xcodeproj/project.xcworkspace/
# CrunchCalculator.xcodeproj/xcuserdata/
nothing added to commit but untracked files present (use "git add" to track)
git remote show origin:
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (fast-forwardable)
Looks like you are trying to push a large delta and your push buffer is not big enough
Try this:
git config http.postBuffer 524288000
I had the same problem and git config http.postBuffer 524288000 worked for me.

Resources