4

I'm trying to launch a rails application to Elastic Beanstalk.

On the tutorial here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Ruby_rails.html

I'm on step 6.3 where it covers updating the application.

eb status --verbose

returns ready and green.

Although, the page that displays at the url it gives me says:

"The page you were looking for doesn't exist.

You may have mistyped the address or the page may have moved."

The tutorial is expecting the "Welcome aboard You’re riding Ruby on Rails!" page to render.

What might be the issue here? I'm pretty new at this so I'm not sure where to begin diagnosing the issue.

I've ran rails s for this apps local directory and it does display the "Welcome aboard You’re riding Ruby on Rails!" page properly.

Thanks!


When I do eb status --verbose it does return green and ready although just before that it gives me this error twice like this:

error: git-credential-osxkeychain died of signal 11
error: git-credential-osxkeychain died of signal 11

I followed the tutorial here https://help.github.com/articles/set-up-git to fix this signal 11 error. The error is gone, although visiting the url where my site is located still gives me the same error page.


Ok I fixed the signal 11 error, although its still not rendering the Ruby on Rails welcome page.


When I create an Application from the Elastic Beanstalk UI the Sample Application works fine. But when I upload the app files on my computer to EB and deploy the link to view the app says "403 Forbidden".

Again, this is just a plain vanilla app that works fine locally.

EB UI says "Green and Healthy" as well.


I reinstalled git and consequently updated it, and then just continued on with the tutorial even though the correct page still isn't rendering. Basically I completed the tutorial except for the termination part.

Now I get a 502 Bad Gateway error.


Using "eb log" I found that I keep getting a message about installing mysql2 and adding it to the gemfile, which I have already done and ran "bundle install". Nada.

It is, however, included in my gem list.


2 Answers 2

1

Of course there are not many clues of what might be wrong, but you can have a look at the log after connecting to your instance through ssh.

In short:

  • connect to your instance through ssh

  • go to /var/app/current/log

  • read the production.log file

Sign up to request clarification or add additional context in comments.

7 Comments

what other type of files would there be if not a your_key.pem file? I downloaded a .cvs files with some access keys, although I'm not sure if that's the same info you're looking for in that .pem file. Also, when I go in to EC2 there aren't any instances listed.
a pem key is given you - and can be downloaded just once - along with your EC2 server once you buy the service, which I assumed you had.
I think you're talking about the .cvs file that has the private access keys? That's the only thing I can think of that I was asked to download once and keep safe. I put that in my osx keychain as a note. And yea, I've gotten the service.
I think the cvs file I'm talking about are the access keys for my IAM user. I'm not sure about this pem file tbh. Also, the only way I've seen I can access the log files for an environment is when I create an application and environment, then view the log files form the Elastic beanstalk UI.
The linked blog article has been deleted.
|
1

I had to do the following to stop the 502 Bad Gateway errors. After the app was uploaded using the Dashboard and selecting the Ruby environment go to your rails application on your dev box an install eb cli

$ pip install awsebcli
$ eb init

Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : EU (Ireland)
5) eu-central-1 : EU (Frankfurt)
6) ap-south-1 : Asia Pacific (Mumbai)
7) ap-southeast-1 : Asia Pacific (Singapore)
8) ap-southeast-2 : Asia Pacific (Sydney)
9) ap-northeast-1 : Asia Pacific (Tokyo)
10) ap-northeast-2 : Asia Pacific (Seoul)
11) sa-east-1 : South America (Sao Paulo)
12) cn-north-1 : China (Beijing)
(default is 3): 3

Select an application to use
1) [your eb environment you created] ****PICK THE ENV YOU CREATED ON EB
2) [ Create new Application ]
(default is 2): 1
$ rake secret
[your very long key returned]
$ eb setenv SECRET_KEY_BASE=[your very long key returned]

wait and you will see this...
INFO: Environment update is starting.
INFO: Updating environment [your eb environment you created]'s
configuration settings.
INFO: Environment health has transitioned from Ok to Info. Configuration update in progress (running for 17 seconds).
INFO: Successfully deployed new configuration to environment.

Now access the URL and there should be no Bad Gateway error. The commands above create a environment variable called SECRET_KEY_BASE and placed it up on the webnode that runs your app

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.