I can't push to heroku after committing changes to my local git repo. Heroku authentication works, rails app is up and running, github push still works, and heroku push used to work up until now - when git push heroku master from local app root directory suddenly started failing without error message. Can only interrupt with Ctrl-C.
Haven't found hints anywhere online yet..
Here's a few tips to try debugging and see what's happening. First, check the Heroku dashboard and see if Heroku is up. It's been down a few times in the past. Next, set GIT_SSH=/pathto/yourscript, where yourscript invokes ssh with -vvv (for verbose debugging). See if it's a network connectivity issue. Third, see if your repository is heavily loaded with commits (like tons of Binary files in the Git index). Ours used to be slow, when we realized this, and split it nicely so that it worked great. We also raised a Heroku support ticket to perform git gc --prune --aggressive remotely on our repo, and the problem got resolved for us.
Related
I want to deploy my project in production, but I can find information how to do it, I follow this information to created my website: rails+webpack, and just say for heroku but I am not using heroku.
I will really appreciate if you can help me with this issue.
You might not be understanding what Heroku is, you can easily use Heroku to deploy your website by following the steps mentioned in the same guide you posted. Using the command git push heroku master will deploy your application to a unique Heroku address which you can open by using heroku open in the CLI.
So first you'll need to create a Heroku account and then download the Heroku CLI which is just an interface to use Heroku from the command line. And here's a great guide on how to deploy a Rails 5 application to Heroku, Heroku might seem a bit scary at first for beginners but it really is very simple.
I'm trying to deploy my application to production on my laptop but i keep getting a
No application found matching remotes:
git#github.com:this_is_the_old_github_remote/Application.git
so this used to be the old remote but it was recently changed
so this makes sense but how do I fix this issue and tell it to go to the new one
There are a couple of ways to work around this issue.
Update the repository's config to have the proper URL for your remote branch.
Tell the ey cli tool which application and environment you are trying to deploy to.
The first method is probably better so you do not have to worry about this in the future.
To update your repository configuration you simply need to run git remote set-url origin https://url.to/new/repo/Applicatoin.git
Once the repository in your git configuration and the Engine Yard dashboard match, you should be able to deploy normally.
To work around this issue via the Engine Yard CLI utility, you will need to run ey deploy --app=<Application Name> --environment=<Environment Name>.
Please keep in mind, regardless of which method above you use to work around this issue, Engine Yard's automation will pull the application from the repository you configured via the dashboard.
Updating the remote on your git configuration does not update Engine Yard's configuration.
If your local copy of the repository has changes that have not been pushed to the remote repository configured at Engine Yard, the changes will not propagate to your instances.
If you continue to run into any issues deploying, please feel free to contact us via http://support.cloud.engineyard.com or in IRC on irc.freenode.net in #EngineYard.
I have two questions about general usage with Heroku and RoR:
1) after I deploy my application onto Heroku, how can I apply new changes that I make?
2) After I deploy my application to Heroku, how do I "turn off" the server so that I can run my app locally again via localhost:3000? (for development & testing purposes)
Thanks!
Assuming you are using git to manage your project, you apply changes to Heroku by pushing them. This might look something like this:
git push heroku master
This pushes the master branch of your git project to Heroku.
To "turn off" your app on Heroku, you can do two things:
$ heroku ps:scale web=0
This completely turns off the application. You can also put it in maintenance mode, which simply prevents traffic to it:
$ heroku maintenance:on
That said, you don't need to turn off your app on Heroku while developing locally. The two environments are completely independent of each other.
Hope this link helps for part 1. Should be able to commit and push your changes using git push heroku master.
https://devcenter.heroku.com/articles/git#tracking-your-app-in-git
For part 2: will scaling your dynos back to 0 work for your case?
How to stop an app on Heroku?
When you make a change, just push the git repository to heroku again withgit push heroku master.
The server will automatically restart with the changed system.
You seem to have a misconception. You can always run your local development server regardless of what Heroku is doing (unless some other service your app connects to would become confused, of course; but if that happens, there is probably something wrong with your design). Nonetheless, if you want to stop the application on Heroku, just scale it to zero web dynos: heroku ps:scale web=0.
I've recently set up bare, shared repository on a personal server and would like to push to heroku directly from there -- that is, NOT use github.
I guess I'm not sure I understand every part of the line where we add a remote:
git remote add heroku myherokuusername?#heroku.com:myherokureponame?.git
git remote add heroku git#heroku.com:taraswebapp.git # normally this
git remote add heroku tara.byte#heroku.com:taraswebapp.git
Other information:
I'm working on mac os x, and have recently installed the relevant heroku toolbelt.
my origin is: tara#192.168.1.160:/rails_projects/taraswebapp.git, where that is the static ip of my server
If you are doing the changes locally, you were once able to git push heroku master from your repo. This second bare repo on your server would be another thing completely different.
Now if you are sharing your bare repo, that'll be a different story.
Update #1:
Store your app in git from heroku docs should get you started and show you how it's done with another repo too.
I've inherited a project and am comfortable with the development side of things, but have poor sysops, and the Capistrano deploy is failing. For a project that has been deployed before by the previous dev:
cap deploy:check
runs fine, resulting in
You appear to have all necessary dependencies installed
But when I try to deploy, I get
...
ERROR: Repository not found.
...
I have:
Triple checked the github repo address
Confirmed I can push and pull fine from the repo on my local machine
Confirmed I can connect fine from the server to github via SSH
Confirmed I can clone the repo fine on the server
Tried with agent forwarding both on and off
Confirmed the repo path matches in .git/config and config/deploy.rb
At the moment, when agent forwarding off, the SSH into github from the server is returning the info for the previous dev, who still has access to the github repo.
Hi xxxxxx! You've successfully authenticated, but GitHub does not provide shell access.
When agent forwarding is on, I show as being the authenticated user.
Any tips on resolving this? More than happy for a decent URL that goes through troubleshooting this.
OK, figured it out by a process of elimination. It was the following line in 'deploy.rb'
set :deploy_via, "remote_cache"
When this is commented out it deploys fine. If I uncomment it, it breaks again with the same error. So that certainly seems to be the problem.
I have no idea why this would be happening. But for now, I'll close this.
I know I am way late to the game but I just ran into this issue with a project that I moved from Github to Bitbucket. I was able to checkout, update, push/pull from the repo on Bitbucket without issue however my initial cap deploy broke after moving to Bitbucket.
The short answer is that the remote cache on your server needs to be deleted. SSH into your server, and remove the entire cached-copy dir found inside the shared directory created by capistrano. The location of your shared and releases directory may not be the same as mine but this is all I had to do:
rm -rf www/shared/cached-copy
After this I was able to deploy without issue.
Hope that helps someone else that may run into this issue.
For troubleshooting tips--especially because you are deploying from a GitHub repo--I suggest reviewing the GitHub guide to Deploying with Capistrano. That guide also links to another you should review on managing deploy keys.
default_run_options[:pty] may be missing or incorrect in config/deploy.rb. This could cause the "successful auth, but no shell access for you" error.
Regarding the script still using the previous developer's credentials, the system account the capistrano script logs in with on the server (e.g set :user, "deployer") may have the previous developer's private key in ~/.ssh which the script may expect to use. If this is the case, you should reconfigure the script to use SSH agent forwarding according to the guides which would have the script start using your keys.