I am trying to setup a Rails server on AWS using Elastic Beanstalk. I am following the guide here. I managed to configure the EB CLI, and I am at the part where I am trying to deploy the app to an EB environment. However, I am getting an error that the AMI option I provided is inval
[rails-beanstalk$] eb create first-beanstalk-env -sr aws-beanstalk-service-role
WARNING: You have uncommitted changes.
Creating application version archive "app-8bc6-160112_090122".
Uploading rails-beanstalk/app-8bc6-160112_090122.zip to S3. This may take a while.
Upload Complete.
ERROR: Configuration validation exception: Invalid option value: 'ami- 48eb8128' (Namespace: 'aws:autoscaling:launchconfiguration', OptionName: 'ImageId'): No EC2 ImageId found with id: 'ami-48eb8128'
I don't remember ever setting an AMI (or what that even is), so I am very confused as to why I'm getting this error.
Not sure what's up with that error, but I find the EB CLI quite fragile. Try to take a different approach and create the environment via the aws web console and not via the cli.
Once this is ready, use eb init to setup beanstalk for your local project and then eb deploy <env-name> to push your project to the newly created env.
If the error persists, try to change the deployment zone. AWS sometimes have local bugs in some regions.
EDIT: this seems to be an issue with AWS. I tried it myself and it fails with the default setup in all aws zones.
EDIT 2: this is now confirmed with amazon:
Unfortunately we are experiencing an issue on our side related to
Beanstalk and the default Ruby AMI in different regions. We are
already investigating the issue and we plan to fix this as soon as
possible. I will update you through this support case once we will get
any update from the Elastic Beasntalk service team.
'ami- 48eb8128'
This has a space in it and is not a valid AMI ID
Related
Pardon me if my question sounds stupid, but I've been cracking my brain on this for quite a while, obviously its my first time deploying and i'm a beginner.
I've followed this tutorial (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Ruby_rails.html) to deploy my rails app to elastic beanstalk. Everything is successful, eb deploy is successful, eb open opens my application in the terminal(w3m) too.
BUT what am I suppose to do next? I mean
Am i suppose to do anything with the 'upload and deploy' button on Elastic Beanstalk Console? Currently its at Sample Application.
I've tried aws elasticbeanstalk create-application-version --application-name my-application --version-label v2 --source-bundle S3Bucket=(bucket name),S3Key=(zip file)
but in return I get A client error (InvalidParameterCombination) occurred when calling the CreateApplicationVersion operation: Unable to download from S3 location (Bucket: name of bucket Key: name of zip file). Reason: Moved Permanently
What am I suppose to do at the hosted zones at Route 53? I put type: CNAME and value as the url in elastic beanstalk console, and obviously going to my domain says 'Congratulations Your first AWS Elastic Beanstalk Ruby Application is now running on your own dedicated environment in the AWS Cloud' since 'upload and deploy' is at sample application.
OR is my thought process all wrong? Hope someone can enlighten me and tell me what to do. I just need to deploy my web app to my own domain. Thanks in advance.
I don't know if this is useful, the message after eb deploy:
Creating application version archive "(name of app)".
Uploading (name of app).zip to S3. This may take a while.
Upload Complete.
INFO: Environment update is starting.
INFO: Deploying new version to instance(s).
INFO: Environment health has transitioned from Ok to Info. Command is executing on all instances.
INFO: New application version was deployed to running EC2 instances.
INFO: Environment update completed successfully.
Okay, I feel dumb.
I just have to type eb status --verbose into the terminal, copy and paste the CNAME given into Route 53 hosted zone.
This is the first time I am deploying my application to Amazon EC2 using Beanstalk .
I am following this guide.
Click (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Ruby_rails.html)
After filling all the info after eb init.
At the step
Select a solution stack.
It is throwing me the same error everytime
$ SignatureDoesNotMatch. Signature expired: 20141211T092422Z is now earlier than 20141212T091944Z (20141212T092444Z - 5 min.)
I am entering the access key and secret as provided by Amazon security credentials.
How can I deploy my application? Any tutorials/articles where I can find some other way around?
Found the solution,It was happening because of server clock and my local machine time was not synchronized.
It can be done by installing ntp tools on your machine.
Article followed
http://www.cyberciti.biz/faq/howto-install-ntp-to-synchronize-server-clock/
I'm trying to deploy to an AWS EC2 staging instance.
I'm following these instructions:
http://alexbachuk.com/launch-rails-4-application-with-passenger-and-nginx/
When I create a test app and point to it via my local host, AWS successfully recognises the test page.
When I change the nginx conf to point to the actual app and try to point to it with my nginx server, I get a failure.
Does anyone know what's wrong with these instructions (or have any ideas what I could be doing wrong)?
The AWS deployment documentation is lacking. I can't get anything useful from there. Tearing my hair out and ready to use heroku.
Thank you.
There is a good tutorial here:
Setup a Ruby on Rails, Passenger, Nginx running on an AWS EC2 with RDS.
I have an existing app that runs fine on localhost. I tried to deploy it to AWS Elastic Beanstalk today via the step-by-step instructions on this page
After using git aws.push to deploy it onto AWS, I wait for the status of the environment to go to green, and try to access the url it gives me. I get a timeout error after a long while of waiting.
I know this is really not much to go off of, but I'm equally stumped. Is there some kind of server side error log or console log (similar to what I see when I 'rails s' on my computer) so I can see what the AWS environment is writing out? I'm not even sure where to start debugging here.
Your first step is to snapshot your logs from the logs tab of your elastic beanstalk's environment you deployed to. This will give you a snapshot of the recent log activity. If you do need to ssh into the EC2 instance that backs your Elastic Beanstalk instance, it's not immediately evident how to do that. You first need to generate a key pair and download it something like my-key.pem. Then associate that key with the Elastic beanstalk application by editing the configuration and on the first tab, add my-key (note it's just the name, not the actual key). To ssh into your EC2 instance you use ssh -i /path/to/my-key.pem ec2-user#
You get the ec2 public url from the ec2 console. Hope all this helps.
First you'll need to ssh into your server
https://stackoverflow.com/a/4921866/274695
Then, you can look your application logs (passenger.log, production.log) at /var/app/support/logs/
I have one Rails instance and another Node.js instance. The plan is to publish information from the Rails project using Redis's pubsub and subscribe by the Node.js program. The node.js program will publish the information to other clients through web sockets (or long polls).
The whole thing is working perfectly while deployed in combination of remote linux machines. On Heroku, Redis To Go is added as an add-on with the Rails instance. Redis can be connected and working fine from this instance.
But I am not getting how to reach to this Redis add-on from the Node.js instance. I've added REDISTOGO_URL from the environment of Rails instance to the environment of Node.js, but it's not working. Sample errors I'm getting (from logs and REPL) are
redis.set("a","b");
==> Error: Connection in pub/sub mode, only pub/sub commands may be used
redis.psubscribe('*');
==> false
Can somebody please show me a way how to accomplish this?
Yes, all you have to do is set the heroku config value similar to:
'heroku config:add REDISTOGO_URL=[your redis togo url]'
Heroku will then add your config var and restart your app.
You can check to make sure it's added correctly by doing a 'heroku config' on both repositories and comparing them.