Deployment to heroku of Heaven fail - ruby-on-rails

I'm now trying to optimize my team's work flow using slack with Heaven and hubot.
But something strange happened while I deploy heaven to heroku by heroku deploy button.(https://github.com/atmos/heaven)
I've filled in:
GITHUB_TOKEN(permission: gist, repo, user)
GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRET
GITHUB_TEAM_ID
HEROKU_API_KEY
I know the HEROKU_API_KEY is optional,
but whether I fill it or not,
the error messages is still the same.
Here's the error message I met.
http://i.stack.imgur.com/kwtx3.png
Run scripts & scale dynos
There was an issue while running the post deploy script.
Can't find any issue related,
so I thought I might make a stupid mistake.

Related

Rails server works in dev mode but not in production mode

I have been building an app for a few months now, I had it hosted on heroku, and I started making changes to it for a while without pushing to heroku, just working on localhost. I went to push it to heroku and ran into an issue with the asset pipeline not liking a variable in an erb tag. I took it out to get the code pushed, and ran into a bigger issue. Still, a 500 error but the logs now said:
ActionView::Template::Error (FATAL: Peer authentication failed for user "fullstack".
Now, in my research on this issue, I attempted several things, and here are some of my findings.
I did not change the storage.yml or database.yml files at all. The production server is AWS s3 buckets, and they are connected to config.active_storage.service for both the production and development in the config/environments files.
The production user in the database.yml is named fullstack. The development user does not have a username or password. I was able to reset the server with the original username and password, but when I change the production username and reset the server it says
PG::ConnectionBad: fe_sendauth: no password supplied
So I go into the terminal and check the owner of the fullstack database, a few things with that. First I check psql -l to see all databases, and I have a fullstack_test and a fullstack_development, but no fullstack_production, and I think that is normal since rails only generate the dev and test on creation. Those two are owned by my Ubuntu user, sethb. I tried to create a fullstack_production database to see what would happen, and I get this error
PG::ConnectionBad: FATAL: Peer authentication failed for user "fullstack"
When I was researching this, people were saying to change a setting in my pg_hba. I looked into mine and it already had set to: host all all all trust. I have been at this for about 20 hours at this point and I would love to hear if someone has an idea on how to fix this, I don't even know how to proceed with this honestly. Any help would be very much appreciated. I can also provide more info on any logs that I have had if it would help
So an update to the story, a half way solution. I was cloning the full project and aws, and when I went to push to heroku, someone helped me notice that I didn't have a node.js buildpack installed. As soon as I did that and pushed the new version, it worked. I tried rails s -e production, but that still throws a 500 error. This time it's saying application.css isn't present. But that is an issue I think someone has a solution for later. Either way, check your Heroku settings! Thank you
Seth B.

heroku: run this app correctly?

I am recently using the rubymine(ruby on rails 4) to create web pages and once I have finished some functions and run correctly,I push my code to heroku, so I can directly run the app on the heroku.
The problem is that every function could run correctly on the heroku just like running it at local except one: There is a link in one page called "calendar" to a calendar function,I can run it correctly at local, but on heroku, it goes wrong saying "we are sorry but something went wrong"
enter image description here
someone can explain to me how could it happen? Is it a bug of the heroku system, like a compatibility issue? I have push my code to heroku and run correctly many times and it won't be wrong in the push process.
here is my heroku link: https://dashboard.heroku.com/apps/clients-to-horse
Sugession
I will recommend you, please run your application on local in production mode(environment) after assets precompile, if everything will work properly then I am sure on Heroku will run also.
After deploy on Heroku make sure for migration and assets precompile for Heroku.
You are saying error as "we are sorry but something went wrong", this always comes when we miss something from our side or code bug in the application.

Not able to push my code into AWS EB

I have been facing issue with pushing my ruby on rails code into AWS ElasticBeansTalk server. I first time was able to initialize the EB, commit and push the code and tried to run the EB server. Everything was fine, but after a few commits, suddenly it is raising the exception as following.
remote: error: Unable to create application version: You cannot have more than 500 Application Versions. Either remove some Application Versions or request a limit increase.
I am not able to find what to do with that. Can anybody help me out to achieve the solution clearly please?
Thanks in advance.
The error code suggests you've pushed a very large number of builds onto the Elastic Beanstalk environment. Try going in to your AWS Console, and go to Elastic Beanstalk, and from the Actions button for your application, select View Application Versions.
Most probably, you'll find 500 different versions of your application here. Select as many old ones as you wish, and do Delete to remove these. Then you should be able to continue.
(Of course, if my hunch is correct, a more interesting question is how on earth you've managed to upload 500 different versions of your application. I'm not running Ruby on Rails, so I'm not too familiar with that environment...)
Good luck!
Use eb labs cleanup-versions --num-to-leave=some_value to leave "some_value" number of last application versions and eb labs cleanup-versions --help to get a full list of available commands. Notice, that eb labs is experimental branch and its syntax may differ based on eb cli version.
After deleting the older application versions, git aws.push started to work again. It would be nice if the version limit error was returned by git aws.push as it would have saved a lot of time.
So follow below steps to resolve this isue.
logged in to console
Go to Elastic Beanstalk and select you application and environment
Find button "Upload and deploy" below text 'running version' and click it
To deploy a previous version, go to the "Application Versions page".
Select your last commit and delete this version label.
6 Again try to deploy with the new version.

Many problems with deploying a rails application to Elastic Beanstalk

I'm at a breaking point with trying to get a rails application deployed to EB. I cannot user heroku for dependency reasons so I'm trying out AWS. The ruby/rails tutorials online all are very clear in setting up an environment, but I am met with many challenges, and at this point I'm starting to think it's because of Amazon's service and not my configuration.
Lets say I start with something very simple, I run
rails new
I start of with a barebones rails app, and I add the necessary routes and index.html.erb file to say hello word. I run
git init && git add . && git commit -m "hello world"
eb init
I run through the necessary steps, I've tried creating a 32 and 64 bit ubuntu instances with ruby 1.9.3 (Which is what my local environment is set up as), I dont set up RDS, and then run
eb start
which prompts me to deploy my latest git commit, I say yes, and it deploys!
Good news? Not so much, Yes my url given by EB does say Hello World, but if at ANY point I try to deploy new code, lets say a change to the gemfile, and there is an error in building my gemfile.. the environment completely blocks me out to the point where.
I cannot access any logs, and If I try, the env goes into a grey state, and reboots
I cannot redeploy any previous git commit, the env just spends 10 minutes and times out
I'm getting frustrated having to rebuild an ENTIRE environment every time there is a slight error in the code.
In general, I'm looking for an alternative to heroku, from which I can deploy changes from the command line. I don't think my question is phrased well enough for anyone to spot out exactly what I'm doing wrong - If I am even doing something wrong. If there are any best-practices with deploying to EB.. please let me know. Thanks!
What size instance are you using? I've found that trying to use a micro instance doesn't work as it runs out of memory when building any native extensions.
Try using a t2.small instance at a minimum.

My new password page says 404 in production mode only

http://site.com/users/password/new is returning a 404 in production mode but not in development. I am deploying via capistrano and it looks like it's copying the entire site over properly. I tried running the console in production mode on the server and couldn't find anything. Has anyone seen this before?
Since this path works in development and fails in production I would focus on the differences between your environments.
A common issue is that people commit their changes locally, but do not push them to (e.g.) GitHub before deploying with capistrano. Can you ssh into your server and go to the current path and run rake routes there? Try and check if there are differences.
Once you've confirmed that at least the routes on the server are up to date, try checking the production log while accessing /user/password/new. It should be in /shared/log/production.log. You could ssh there and use tail -f production.log to follow the log while you try to access the path.
On a side note, it seems that you are using Devise. There have been similar issues for the user root path. See for example this question. Perhaps this will shed some light on your problem.

Resources