400 Bad Request - grails

I try to use cloudfoundry first time.
I created a simple application in grails and installed cloud-foundry plugin. Plugin is installed correctly. I was trying to run prod cf-push command but received this error. Any ideas about this error ?
org.cloudfoundry.client.lib.CloudFoundryException: 400 Bad Request (Invalid application description)

It may be worth trying with VMC (if you have it installed).
Package your Grails app
grails prod war
then deploy with vmc
vmc push [app name here] --path target/
follow the interactive prompts, but VMC should recognise the war file as a Grails app

Related

Instance deployment failed to install dependency gems that you defined in 'Gemfile'. For details, see 'eb-engine.log'. The deployment failed

I'm facing this issue while trying to deploy rails app via AWS Elastic-beanstalk cli.
Even I tried this solution Installing gems fails in deployment - AWS Elastic Beanstalk but NO LUCK.
I don't really know where you are in your deployment without specific error or log information. Please post more log info so we can better help you! If you don't have detailed logging, try setting it up using these steps
Assuming your error is in the eb-engine.log file, you can try the following steps to troubleshoot the issue:
Check the error message in the log file to see if it provides any clues about the cause of the error.
Check the Elastic Beanstalk environment settings to ensure that all required settings are properly configured.
Check the Ruby on Rails application code for any errors or issues that may be causing the error.
If necessary, try redeploying the application using the eb deploy command.

gcloud app deploy fails on ruby-build for both 2.4.2 and 2.5.1

I am moving over (I think) from heroku to gcloud for deploying my rails applications. I stepped through the full tutorial provided by google here google appengine instructions
Running gcloud app deploy produces a lot of output. However, it seems to show signs of trouble when it tries to download the ruby image from gcp-runtime/ruby/ubuntu16.
Each time at this spot, I receive the following error:
"ruby-build: definition not found: ruby-2.5.1" - this is when I
tried to deploy a 2.5.1 application. and
"ruby-build: definition not found: ruby-2.4.2" - when I try to deploy a 2.4.2 application.
For this app deploy test, I only created the skeleton rails site using rails new command. Executed bundle install and updated the app.yaml as instructed on the site using the secret key.
I am deploying in region north-america, if that info is useful
How did you set up your Ruby development environment? You may profit from taking a look at the "Setting Up a Ruby Development Environment" documentation page.
The lot of output from the deployment command may prove highly significant, in context. What is the output from gcloud app deploy --verbosity=debug?

Capistrano 3 SSHKit::Runner::ExecuteError: Exception while executing on host [hostname ]agent could not sign data with requested identity

I'm getting the following error while deploying my rails app to an ubuntu server, I have correctly setup ssh keys and I can ssh to the server but I'm getting the following when I try to do
cap production deploy
This is the error message
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host xxxxxx.xxxxxxx.xxx: agent could not sign data with requested identity
I can't figure out what I am doing wrong since I had previously deployed and I just need to update my app to changes I have made. I have not changed my deploy.rb, Capfile or deploy/production.rb files since I last deployed
I solved a similar issue by just issuing ssh-add. It seems that my current environment hasn't properly picked up the keys and readding them fixed the issue.
I had the same error.
ssh-copy-id user#ipaddress
Helped me to solve this.
I had the same issue but in my case I had to delete file .ssh/known_hosts from my local machine.
After upgrading Rails from 4.1.x to 4.2, I started getting similar errors when trying to bundle. I fixed it by removing the shared bundle directory. Here's the steps I took:
SHH into the server
cd /my/app/shared/bundle/ruby
rm -rf 2.1.0 or whatever "version" directory is there
Re run the deploy cap production deploy
You may, at this point, hit a memory snag (I did while deploying to a DigitalOcean droplet). The fix for that is to create and enable a swap file on the droplet.

Weird Facebooker Plugin & Pushion Passenger ModRails Production Error

I have an application (Rails 2.3.5) that I'm deploying to production Linux/Apache server using the latest Phushion Passenger/Apache Module 2.2.11 version. After deploying my original application, it returns a 500 error with no logging to production log.
So I created a minimal test rails application, with some active record calls to the database to print out a list of objects to the home controller/my index page. I also cleared out all plugins. That works fine in the production environment. Then I one by one introduced each plugin that I'm using one at a time.
Every plugin works fine EXCEPT facebooker. Every time I load the facebooker plugin into my app/vendor/plugins directory (via script git etc) my test application break (500 error - no error logging). Everytime I remove the facebooker plugin my test application works.
Has anyone seen this before/ have any solutions? I saw this solution but didn't see it in the facebooker code.
Did you add Facebook credentials for production environment?

What's the best way to deploy a JRuby on Rails application to Tomcat?

I'm looking at ways to deploy a Ruby on Rails app (running on JRuby) to a Tomcat instance for testing.
The tomcat instance is running on a Solaris server that I can SSH to. I've looked at using Capistrano, but there doesn't seem to be a lot out there about using it to deploy to Tomcat, or even about running it under JRuby, and I keep hitting bugs in Capistrano due to the Windows/JRuby environment my PC is running (yeah, it's corporate - not my choice, but I've got to live with it).
I'm using warble to build the .war file, and the app deploys and runs fine once I manually copy it up and deploy it. I'm wanting something easier and more automated to actually get it there.
Anyone done this before? Documentation on the web seems pretty thin.
I am running a Rails project using JRuby and deploying to a Tomcat server. I have chosen to deploy with Capistrano because it automates just about everything. I had to make a few minor modifications to Capistrano's deployment lifecycle in order to get it to run on Tomcat:
Step 1: I created a warble task to be run on the server after Capistrano updates the code:
desc "Run the warble command to deploy the site"
namespace(:deploy) do
task :warble do
run ". ~/.profile;cd #{release_path};warble"
end
end
And hooked it into Capistrano lifecycle using:
after 'deploy:update_code', 'deploy:warble'
My Tomcat server has a symlink pointing to the #{release_path}/tmp/war directory created by warble. If you don't like this, you can easily modify the warble task to move the war file into the Tomcat directory instead.
Step 2: I overrode the deploy:start and deploy:stop tasks so that they kick off the Tomcat server instead of a Mongrel server:
desc "Starts the Tomcat Server"
namespace(:deploy) do
task :start do
sudo "#{tomcat_home}/bin/startup.sh"
end
end
desc "Shutdown the Tomcat Server"
namespace(:deploy) do
task :stop do
sudo "#{tomcat_home}/bin/shutdown.sh"
end
end
I run Capistrano tasks using MRI rather than the JRuby interpreter.
I don't have much experience on this, so I don't know if I can give you the BEST way, but if Capistrano doesn't work, and you can't have a separate MRI install just to run it, you have just a few alternatives left:
Try running plain Rake and write your own deployment target:
http://www.gra2.com/article.php/deploy-ruby-on-rails-applications-rake
Or use Ant or Maven.
Or if it just ONE server you have to deploy to, you could just hack together two Ruby scripts - one that listens on the server for shutdown/startup requests, and one local that you run to: Send shutdown, scp over the file, send startup.
By the way, have you submitted any integration bugs you find with Capistrano to the JRuby team? I'm sure they'd be happy to have any contribution.
:)
Might be worth looking at 'Vlad the deployer' it adds remote_task to Rake allowing you to run tasks on a remote server. Personally however I prefer to have a standard Rake task on the server, ssh in and run that task - which would then do an svn checkout, make the WAR file, whatever...
I would probably use Ant for this. After all, it's just another WAR file, right? I don't know which version of Tomcat you're using but version 4.1x comes with an Ant task for deploying to Tomcat.
There's a few Capistrano recipes for deploying to Tomcat -- I built one into a gem called capistrano-tomcat. It takes a WAR you've built (probably with Warbler) and deploys and starts a Tomcat instance on a remote server.
The source is up on Github: http://github.com/rhunter/capistrano-tomcat

Resources