Rails Admin comes up empty on heroku - ruby-on-rails

I'm trying to use Rails Admin on heroku. It works perfectly in both production and development, but when I try to access /admin through heroku, the Dashboard renders completely empty(it has the basic Rails Admin scaffolding, but none of my content). The rest of the site is working fine. There are no errors in heroku logs, which look like this:
2013-01-03T09:05:48+00:00 app[web.1]:
2013-01-03T09:05:48+00:00 app[web.1]:
2013-01-03T09:05:48+00:00 app[web.1]: Started GET "/admin/" for 76.93.177.75 at 2013-01-03 09:05:48 +0000
2013-01-03T09:05:48+00:00 app[web.1]: Processing by RailsAdmin::MainController#dashboard as HTML
2013-01-03T09:05:48+00:00 app[web.1]: Rendered vendor/bundle/ruby/1.9.1/gems/rails_admin-0.0.3/app/views/rails_admin/main/dashboard.html.haml within layouts/rails_admin/application (0.3ms)
2013-01-03T09:05:48+00:00 app[web.1]: Rendered vendor/bundle/ruby/1.9.1/gems/rails_admin-0.0.3/app/views/layouts/rails_admin/_secondary_navigation.html.haml (1.3ms)
2013-01-03T09:05:48+00:00 app[web.1]: Rendered vendor/bundle/ruby/1.9.1/gems/rails_admin-0.0.3/app/views/layouts/rails_admin/pjax.html.haml (2.1ms)
2013-01-03T09:05:48+00:00 app[web.1]: Completed 200 OK in 20ms (Views: 17.2ms | ActiveRecord: 1.4ms)
2013-01-03T09:05:48+00:00 heroku[router]: at=info method=GET path=/admin/ host=rocky-oasis-1876.herokuapp.com fwd=76.93.177.75 dyno=web.1 queue=0 wait=0ms connect=12ms service=43ms status=200 bytes=2603
2013-01-03T09:05:48+00:00 heroku[router]: at=info method=GET path=/assets/rails_admin/rails_admin-b54745219c9cfcf789963ed61310c222.css host=rocky-oasis-1876.herokuapp.com fwd=76.93.177.75 dyno=web.1 queue=0 wait=0ms connect=1ms service=29ms status=200 bytes=129747
2013-01-03T09:05:48+00:00 heroku[router]: at=info method=GET path=/assets/rails_admin/rails_admin-713b6f759f0edf80a0c69b3ced027e1e.js host=rocky-oasis-1876.herokuapp.com fwd=76.93.177.75 dyno=web.1 queue=0 wait=0ms connect=1ms service=34ms status=200 bytes=283158
2013-01-03T09:05:49+00:00 heroku[router]: at=info method=GET path=/assets/glyphicons-halflings-f6675c325532ec11a984d58e172b8e2a.png host=rocky-oasis-1876.herokuapp.com fwd=76.93.177.75 dyno=web.1 queue=0 wait=0ms connect=1ms service=7ms status=200 bytes=13826
I'm not sure what else to include, since everything is "working". I am using rails 3.2.9 and
rails_admin 0.0.3, and the up-to-date heroku toolbelt. If anyone has any ideas, I would greatly appreciate the help!

You're not alone. I had this, too, and it seems others have. The solution that worked for me was to upgrade rails_admin. This works because fixes have been committed to rails_admin in later versions; here's a link:
https://github.com/sferik/rails_admin/pull/1184
This pull request went in after version 0.0.3, which you say you are using, so I think upgrading will help you.
bundle update rails_admin
After you do this, remember to commit your Gemfile.lock, precompile assets (if you normally do this, it depends on your set up) and run your tests before you deploy.

Related

Why responses my heroku hosted container app with "Not authoritative"

I try to run my simple Web-App as Docker Container within Heroku.
When build and run the container locally all works fine.
But on accessing the generated endpoint https://html5-landingpage-buddah.herokuapp.com/ Heroku responses with HTTP 400 Bad Request and the message "Not authoritative"
Logs inside Heroku don't help much:
2020-09-19T14:45:45.269487+00:00 heroku[router]: at=info method=GET path="/" host=html5-landingpage-buddah.herokuapp.com request_id=5f07ea7e-d925-4fbe-b7ba-29387a3284cc fwd="XX.XX.XX.XXX" dyno=web.1 connect=1ms service=1ms status=400 bytes=212 protocol=https
I did a research for the error but found no helpful information.
Also re-creating the App in Heroku, renaming the URL and moving the App to another Region did not help.
Here is the log from restart to the first request on the web app:
2021-06-15T17:11:36.977277+00:00 heroku[web.1]: Starting process with command `./app`
2021-06-15T17:11:39.852345+00:00 app[web.1]: [main] INFO de.clique.westwood.example.html5.landingpage.buddah.App - Server started on port 54225
2021-06-15T17:11:39.852374+00:00 app[web.1]: [main] INFO de.clique.westwood.example.html5.landingpage.buddah.App - Serving albums from ./static/album
2021-06-15T17:11:41.363857+00:00 heroku[web.1]: State changed from starting to up
2021-06-15T17:11:48.162254+00:00 heroku[router]: at=info method=GET path="/" host=html5-landingpage-buddah.herokuapp.com request_id=85c642cb-a48d-41ac-89e1-7a520749e9bc fwd="94.31.82.142" dyno=web.1 connect=1ms service=4ms status=421 bytes=219 protocol=https
2021-06-15T17:11:48.275223+00:00 heroku[router]: at=info method=GET path="/" host=html5-landingpage-buddah.herokuapp.com request_id=406e9e77-f40e-47b9-a33b-af0af5b8f171 fwd="94.31.82.142" dyno=web.1 connect=1ms service=3ms status=421 bytes=219 protocol=https
2021-06-15T17:11:48.520876+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=html5-landingpage-buddah.herokuapp.com request_id=d3782734-765c-45f1-98a8-04e2098e7267 fwd="94.31.82.142" dyno=web.1 connect=1ms service=4ms status=421 bytes=219 protocol=https
2021-06-15T17:11:48.906097+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=html5-landingpage-buddah.herokuapp.com request_id=79e4404f-e505-4c16-9778-9f72882d74be fwd="94.31.82.142" dyno=web.1 connect=1ms service=4ms status=421 bytes=219 protocol=https
The error Not Authoritative simply means that Heroku is unable to redirect the traffic from the said domain name to your application.
According to Heroku,
The web process must listen for HTTP traffic on $PORT, which is set by Heroku. EXPOSE in Dockerfile is not respected, but can be used for local testing. Only HTTP requests are supported.
You will need to replace your EXPOSE and ENTRYPOINT as such
CMD [ "sh", "-c", "java -jar ./app --bind 0.0.0.0:$PORT" ]

rails api on heroku

I built an api-only rails app using rails-api. It works great locally. However, when I deploy it to heroku, it produces error saying We're sorry, but something went wrong. If you are the application owner check the logs for more information..
I then checked logs with command heroku logs in CLI:
2016-01-26T22:11:39.472621+00:00 app[web.1]: Puma starting in single mode...
2016-01-26T22:11:39.472645+00:00 app[web.1]: * Version 2.15.3 (ruby 2.0.0-p648), codename: Autumn Arbor Airbrush
2016-01-26T22:11:39.472647+00:00 app[web.1]: * Min threads: 5, max threads: 5
2016-01-26T22:11:39.472647+00:00 app[web.1]: * Environment: production
2016-01-26T22:11:40.839892+00:00 app[web.1]: * Listening on tcp://0.0.0.0:12329
2016-01-26T22:11:40.840054+00:00 app[web.1]: Use Ctrl-C to stop
2016-01-26T22:11:40.994291+00:00 heroku[web.1]: State changed from starting to up
2016-01-26T22:11:42.865549+00:00 heroku[router]: at=info method=GET path="/" host=hereze.herokuapp.com request_id=2823dd98-073a-40b5-9faa-1caed3ed263f fwd="89.166.7.101" dyno=web.1 connect=0ms service=38ms status=404 bytes=1744
2016-01-26T22:11:50.101468+00:00 heroku[router]: at=info method=GET path="/reviews" host=hereze.herokuapp.com request_id=2d0d04a6-90c5-4ae7-84a8-2fd1e6287ea3 fwd="89.166.7.101" dyno=web.1 connect=1ms service=16ms status=500 bytes=1669
2016-01-26T22:12:41.819043+00:00 heroku[router]: at=info method=GET path="/reviews" host=hereze.herokuapp.com request_id=854512e4-7a19-4453-9254-2ce09472b5bb fwd="89.166.7.101" dyno=web.1 connect=1ms service=36ms status=500 bytes=1669
But I don't see anything wrong in the logs, can you help me out? Thank you.
You can do Cntrl+F and then search for error. The code you listed does not include any errors.
But if it is working locally but not in Heroku you probably have forgotten to run
heroku run rake db:migrate
or
heroku run rake db:seed

Redirect Loop on Heroku with Rails 4 App, but not on local machine

App running Ruby 2.2.2, Rails 4.2.1
When I run my app locally everything is fine. It was running fine on heroku until I made some updates. Now all I get in a browser is "Err too many redirects" from Chrome, or "Too many redirects..." in Safari. Even after I rolled back the version on heroku and reset the database I am still getting this. I have wiped out the cookies and cache on both browsers too. Still the error.
I get a bunch of these one after the other in the heroku log:
2015-06-14T15:09:23.160000+00:00 heroku[router]: at=info method=GET path="/" host=www.domain.com request_id=28455761-bc94-4a27-852f-249f5409a4f2 fwd="50.152.172.74,199.27.128.248" dyno=web.1 connect=1ms service=1ms status=301 bytes=157
Followed by one of these:
2015-06-14T16:11:18.084247+00:00 heroku[router]: at=info method=POST path="/payola/events" host=www.domain.com request_id=2ab49dd7-0392-4261-ae1e-1279998e37e1 fwd="54.241.34.107,199.27.133.164" dyno=web.1 connect=0ms service=1ms status=301 bytes=170
And then this before it shuts down:
2015-06-14T16:39:40.305372+00:00 heroku[router]: at=info method=GET path="/" host=www.domain.com request_id=a54f6089-ca85-428f-ac01-0c02421a83da fwd="50.152.172.74,199.27.128.73" dyno=web.1 connect=1ms service=1ms status=301 bytes=157
2015-06-14T16:39:40.498317+00:00 heroku[router]: at=info method=GET path="/" host=www.domain.com request_id=1f0aa9d4-7ae1-4141-ab32-7103aa0c1ef5 fwd="50.152.172.74,199.27.128.73" dyno=web.1 connect=0ms service=1ms status=301 bytes=157
2015-06-14T16:51:40.945338+00:00 heroku[router]: at=info method=GET path="/robots.txt" host=www.domain.com request_id=6a37a7d4-3277-4f55-9321-bdab79a744ff fwd="68.180.228.91,108.162.246.80" dyno=web.1 connect=3ms service=4ms status=301 bytes=167
2015-06-14T16:51:41.287899+00:00 heroku[router]: at=info method=GET path="/pricing" host=www.domain.com request_id=433b98e3-d445-47f3-b9b3-212dff1dfb57 fwd="68.180.228.91,108.162.246.226" dyno=web.1 connect=2ms service=8ms status=301 bytes=164
2015-06-14T16:56:30.228037+00:00 heroku[router]: at=info method=POST path="/payola/events" host=www.domain.com request_id=9de5611a-4cc4-474e-a4cf-26dfd1de31b3 fwd="54.241.34.107,199.27.133.114" dyno=web.1 connect=6ms service=2ms status=301 bytes=170
2015-06-14T17:58:38.217217+00:00 heroku[router]: at=info method=POST path="/payola/events" host=www.domain.com request_id=48a6417f-69f4-4ed2-b468-bf0edfae0c90 fwd="54.241.34.107,199.27.133.189" dyno=web.1 connect=0ms service=1ms status=301 bytes=170
2015-06-14T18:32:20.867295+00:00 heroku[router]: at=info method=POST path="/payola/events" host=www.domain.com request_id=276fc89e-3e07-441b-ad00-f2b60c77e540 fwd="54.241.34.107,199.27.133.189" dyno=web.1 connect=0ms service=1ms status=301 bytes=170
2015-06-14T19:05:57.170756+00:00 heroku[router]: at=info method=GET path="/robots.txt" host=www.domain.com request_id=22174ed2-db0a-45bb-b9d7-0a6f2ba2ac8c fwd="208.115.113.85,108.162.246.205" dyno=web.1 connect=4ms service=15ms status=301 bytes=167
2015-06-14T19:44:10.474487+00:00 heroku[router]: at=info method=POST path="/payola/events" host=www.domain.com request_id=bb575e60-1017-41c7-869e-31c0f3ec2528 fwd="54.241.34.107,199.27.133.164" dyno=web.1 connect=1ms service=2ms status=301 bytes=170
2015-06-14T20:46:06.583978+00:00 heroku[router]: at=info method=POST path="/payola/events" host=www.domain.com request_id=c348fef6-6ada-4825-a9ca-3631840d8e51 fwd="54.241.31.99,199.27.133.53" dyno=web.1 connect=8ms service=5ms status=301 bytes=170
Does anyone know what is causing this?
I discovered the answer. I am on Cloudflare's network. Turns out that if on their "Crypto" panel, if the SSL is set to "flexible" then you will get the redirect loop error. Had to set it to "Full".

Rails + Heroku + Devise: Sign in page does not work but log doesn't say anything

I have an app
http://buzzme.herokuapp.com/
but when I click sign in: http://buzzme.herokuapp.com/clients/sign_in
It gives me an error We're sorry, but something went wrong.
But heroku logs don't say anything:
=0ms service=15ms status=500 bytes=1754
2015-05-03T02:38:27.676212+00:00 heroku[router]: at=info method=GET path="/clients/sign_in" host=buzzme.herokuapp.com request_id=38444765-b318-4719-8017-ff9fc9dd5031 fwd="207.41.179.38" dyno=web.1 connect=0ms service=17ms status=500 bytes=1754
2015-05-03T02:38:27.715718+00:00 heroku[router]: at=info method=GET path="/clients/sign_in" host=buzzme.herokuapp.com request_id=49cba466-6bf5-4413-b25e-aeec7a0bac57 fwd="207.41.179.38" dyno=web.1 connect=4ms service=17ms status=500 bytes=1754
2015-05-03T02:39:06.600569+00:00 heroku[router]: at=info method=POST path="/clients/sign_in" host=buzzme.herokuapp.com request_id=fd6acefb-22ff-4e49-a50b-5a70f21f25de fwd="207.41.179.38" dyno=web.1 connect=1ms service=9ms status=422 bytes=328
How would I debug this? I already changed the log level to debug but it doesn't say anything.

Heroku Migration Issues

ve been working on Ruby on Rails application development using NitrousIO for my environment and Heroku for Deployment. For some of the modules I could successfully deploy on Heroku and it's working fine but for some of the modules, it says We're sorry, but something went wrong.
I've been all the steps like heroku run rake db:migrate after pushing the latest code to heroku but no success But on NitrousIO, everything works perfect
What are the ways now to reset my db on Heroku such that It can work for all the modules without issues. Guide/Point me the step-by-step procedure please
Is there only db reset option to get going or do we have any intermediate solution which gets me out of this situation ?
These are my Heroku Logs with heroku logs -n 250
action#rksrailszone-182221:~/enterpriseape(nesting-purchases)$ heroku logs -n 250
2015-01-16T16:35:08.590482+00:00 heroku[web.1]: Unidling
2015-01-16T16:35:08.591399+00:00 heroku[web.1]: State changed from down to starting
2015-01-16T16:35:12.002231+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 46010 -e production`
2015-01-16T16:35:16.619546+00:00 app[web.1]: [2015-01-16 16:35:16] INFO WEBrick 1.3.1
2015-01-16T16:35:16.619962+00:00 app[web.1]: [2015-01-16 16:35:16] INFO WEBrick::HTTPServer#start: pid=3 port=46010
2015-01-16T16:35:16.619570+00:00 app[web.1]: [2015-01-16 16:35:16] INFO ruby 2.0.0 (2014-11-13) [x86_64-linux]
2015-01-16T16:35:16.950487+00:00 heroku[web.1]: State changed from starting to up
2015-01-16T16:35:17.990652+00:00 heroku[router]: at=info method=GET path="/" host=enterpriseape-ramakballa.herokuapp.com request_id=6a0355dc-73fd-4b10-9a2e-066ae51a403a fwd="49.205.144.212" dyno=web
.1 connect=2ms service=115ms status=200 bytes=1896
2015-01-16T16:35:24.243086+00:00 heroku[router]: at=info method=GET path="/assets/application-f71602a6cb0cb5ada02d834e1b9e35cb.css" host=enterpriseape-ramakballa.herokuapp.com request_id=6251571f-d5
6c-4af4-bc4a-7bf0b4ea1961 fwd="49.205.144.212" dyno=web.1 connect=2ms service=5817ms status=304 bytes=231
2015-01-16T16:35:24.699601+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=enterpriseape-ramakballa.herokuapp.com request_id=0cc95f6f-5255-4345-8f63-e53c43bad31f fwd="49.205.144.21
2" dyno=web.1 connect=1ms service=9ms status=404 bytes=1829
2015-01-16T16:35:50.967577+00:00 heroku[router]: at=info method=GET path="/invoices" host=enterpriseape-ramakballa.herokuapp.com request_id=e8cdea65-e2f0-4a5a-acbd-cbd599a5e8a6 fwd="49.205.144.212"
dyno=web.1 connect=2ms service=108ms status=200 bytes=2765
2015-01-16T16:35:51.378408+00:00 heroku[router]: at=info method=GET path="/assets/application-f71602a6cb0cb5ada02d834e1b9e35cb.css" host=enterpriseape-ramakballa.herokuapp.com request_id=9d2facec-b8
cb-40d5-aebf-264154e5e59e fwd="49.205.144.212" dyno=web.1 connect=2ms service=14ms status=304 bytes=231
action#rksrailszone-182221:~/enterpriseape(nesting-purchases)$
Based on the 'Missing host to link to' error message in your screenshot it looks like you are missing some configuration. The link_to method needs to know the hostname to use to generate the full URL for the given link. You can configure this in each environment file, in this case you need to add something like this to your config/environments/production.rb:
config.action_mailer.default_url_options = { :host => "enterpriseape-ramakballa.herokuapp.com" }

Resources