heroku db:pull strange response - ruby-on-rails

i run
$ heroku db:pull
it says
Loaded Taps v0.3.24
Auto-detected local database: mysql2://root:mypassword#127.0.0.1/app?encoding=utf8
Warning: Data in the database 'mysql2://root:mypassword#127.0.0.1/app?encoding=utf8' will be overwritten and will not be recoverable.
! WARNING: Destructive Action
! This command will affect the app: heroku-app-9999
! To proceed, type "heroku-app-9999" or re-run this command with --return heroku-app-9999
so i run
$ cryptic-harbor-6329
then i get this response:
! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
! <html>
! <head>
! <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
! <style type="text/css">
! html, body, iframe { margin: 0; padding: 0; height: 100%; }
! iframe { display: block; width: 100%; border: none; }
! </style>
! <title>Application Error</title></head>
! </head>
! <body>
! <iframe src="//s3.amazonaws.com/heroku_pages/error.html">
! <p>Application Error</p>
! </iframe>
! </body>
! </html>
i have pulled and pushed to heroku with different apps many times. i have never received this error. what dose it mean?

heroku db:pull mysql://root:mypass#localhost/mydb
try this

Related

Quality Gates 500 error

I am using the SonarQube quality gates plugin for Jenkins.
My project has SonarQube ID com.my.package:my-project:origin/feature/WRAP-1-test and URI com.my.package:my-project:origin%2Ffeature%2FWRAP-1-test.
In Jenkins, under Quality Gates, Project Key, I tried using both the ID and the URI.
However, on both occasions when I build the project, I am getting:
SonarQube analysis completed: SUCCESS
quality.gates.jenkins.plugin.QGException: Expected status 200, got: 500. Response: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>SonarQube</title>
<style type="text/css">
body {
background-color: #fff;
color: #666;
text-align: center;
font-family: arial, sans-serif;
}
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}
h1 {
font-size: 100%;
color: #f00;
line-height: 1.5em;
}
</style>
</head>
<body>
<!-- This file lives in public/500.html -->
<div class="dialog">
<h1>We're sorry, but something went wrong.</h1>
<p>Please try back in a few minutes and contact support if the problem
persists.</p>
<p>
<!-- SONAR-4447 Sometimes this error page is served as static html so we hide ruby code -->
Go back to the homepage
<!-- -->
</p>
</div>
</body>
</html>
at quality.gates.sonar.api.SonarHttpRequester.executeGetRequest(SonarHttpRequester.java:59)
at quality.gates.sonar.api.SonarHttpRequester.getAPIInfo(SonarHttpRequester.java:47)
at quality.gates.sonar.api.QualityGatesProvider.getRequesterResult(QualityGatesProvider.java:34)
at quality.gates.sonar.api.QualityGatesProvider.getAPIResultsForQualityGates(QualityGatesProvider.java:29)
at quality.gates.jenkins.plugin.BuildDecision.getStatus(BuildDecision.java:20)
at quality.gates.jenkins.plugin.QGPublisher.perform(QGPublisher.java:73)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1067)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
at hudson.model.Run.execute(Run.java:1753)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Build step 'Quality Gates' marked build as failure
Finished: FAILURE
Any idea why the call fails?
EDIT:
My logs contain the following 2 errors:
2017.02.14 15:25:48 ERROR web[AVoyVzS5I0AJ4yijAAU1][rails] Fails to execute http://localhost:9000/api/events?resource=com.my.package:my-project:origin/feature/WRAP-1-test&format=json&categories=Alert : undefined method `generate' for #<JSON::Ext::Generator::State:0x2f8ea6a2>
And:
web.log:2017.02.14 15:25:48 ERROR web[AVoyVzS5I0AJ4yijAAU1][o.s.s.ui.JRubyFacade] Fail to render: http://localhost:9000/api/events?resource=com.my.package:my-project:origin/feature/WRAP-1-test&format=json&categories=Alert
/Users/octavian/.rvm/gems/ruby-2.2.1/gems/json-1.8.3/lib/json/common.rb:223:in `generate'
/Users/octavian/.rvm/gems/ruby-2.2.1/gems/json-1.8.3/lib/json/common.rb:470:in `JSON'
/Users/octavian/Downloads/sonarqube-6.2/web/WEB-INF/app/controllers/api/api_controller.rb:48:in `jsonp'
/Users/octavian/Downloads/sonarqube-6.2/web/WEB-INF/app/controllers/api/api_controller.rb:132:in `error_to_json'
/Users/octavian/Downloads/sonarqube-6.2/web/WEB-INF/app/controllers/api/api_controller.rb:123:in `render_response'
My version of SonarQube is 6.2.
For anyone having this issue, my steps for solving irwere:
open sonarqube-6.2/web/WEB-INF/config/environment.rb, and change to ENV['GEM_PATH']=''.
go to the folder where sonar.sh is and run unset GEM_PATH
sonar.sh restart
The issue is caused by some incompatibilities with the installed version of ruby.

How to precompile individual css/js files in assets?

I am trying to setup GitLab on my local machine in development env from source.
Please note that I am completely new to Ruby on rails development as my field is PHP.
I followed instructions from
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md where I replaced RAILS_ENV=production with RAILS_ENV=development where appropriate and also tweaked some config files.
All installations steps went smooth, however when I open the gitlab page, it tries to load css and js files that are not present:
...
<link href="/assets/jquery.ui.core.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/jquery.ui.theme.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/jquery.ui.datepicker.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/jquery.ui.menu.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/jquery.ui.autocomplete.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/jquery.atwho.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/select2.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/highlightjs.min.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/dropzone/basic.css?body=1" media="all" rel="stylesheet" />
<link href="/assets/print.css?body=1" media="print" rel="stylesheet" />
<script src="/assets/jquery.js?body=1"></script>
<script src="/assets/jquery.ui.core.js?body=1"></script>
<script src="/assets/jquery.ui.widget.js?body=1"></script>
...
I noticed that after I do
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=development
the only css files that are put into public/assets/ folder are
application-4979ead805bf0eb7d853f1e0104f87ef.css
application-4979ead805bf0eb7d853f1e0104f87ef.css.gz
According to css assets not precompiling in production I added this line
config.assets.precompile += ['*.css', '*.js']
in config/environments/development.rb. However now when I try to precompile assets, I get an error
...
rake aborted!
Sass::SyntaxError: Undefined mixin 'border-radius'.
(in /home/git/gitlab/app/assets/stylesheets/generic/avatar.scss:6)
/home/git/gitlab/app/assets/stylesheets/generic/avatar.scss:6:in `border-radius'
...
Does anyone know how to fix it?
Thanks!
Error
The error can be fixed by including the #border-radius mixin in your avatar.css.scss stylesheet. We typically use a variables.css.scss stylesheet, where our mixins are defined:
#app/assets/stylesheets/variables.css.scss
#mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
-o-border-radius: $radius;
border-radius: $radius;
}
#app/assets/stylesheets/avatar.css.scss
#import 'variables';
This should give you the ability to call the mixin in your avatar stylesheet, which should fix the error you're receiving
--
Precompilation
Typically, if you wanted to add a specific CSS file to your pre-compilation path, you'll have to do this:
#config/environments/production.rb
config.assets.precompile += ['avatar.css']
Precompilation is only recommended for production environments, as if you precompile in development, how are you going to track / manage changes? Bottom line is you won't.
Here's what the Rails docs say about it:
In the production environment Sprockets uses the fingerprinting scheme
outlined above. By default Rails assumes assets have been precompiled
and will be served as static assets by your web server.

Install Hue in Amazon EMR

I tried installing Hue in Amazon EMR using the link https://github.com/cloudera/hue .I am seeing the status
development server running at http://127.0.0.1:8000/
Am also able to curl the url and but getting blank page. The curl content.
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="refresh" content="0; url=/beeswax">
</head>
<body>
</body>
</html>"
But when I hit the browser using the public dns url with port 8000 i am getting error page. Am i missing any steps.
Thanks
What error page are you seeing? It could be just that you did no open 8000 or binded the server on runserver 0.0.0.0:8000 when started it. Also it is recommended to start Hue with runcpserver instead of the development server.
You are running on the loopback interface 127.0.0.1. This is only accessible from the host not externally. You need to change you hue.ini
and set:
http_host=0.0.0.0

Does a db:migrate on Heroku alter the production database?

I'm working with a small app on Heroku and I'm wondering if a heroku run rake db:migrate will affect the production database. Any thoughts?
I tried heroku db:pull but the pull stopped midway (not to mention that it screwed up my local db):
Schema: 60% |==================================================================================== | ETA: 00:00:16
Saving session to pull_201207010723.dat..
!!! Caught Server Exception
HTTP CODE: 503
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
html, body, iframe { margin: 0; padding: 0; height: 100%; }
iframe { display: block; width: 100%; border: none; }
</style>
<title>Application Error</title></head>
</head>
<body>
<iframe src="//s3.amazonaws.com/heroku_pages/error.html">
<p>Application Error</p>
</iframe>
</body>
</html>
Additional notes: local development db is sqlite3 and production db (by Heroku standard is postgresql). The devel db was like that by default and I couldn't find a nice tutorial to convert to postgresql.
Thanks a bunch!
Running heroku run rake db:migrate will indeed alter your database on Heroku -- so it will change your production database.

Getting an 'Application Error' when trying to push my database to Amazon RDS with the heroku gem

Whenever I try to push my local mysql database to Amazon RDS I get a 503 application error:
bundle exec heroku db:push
...
Sending schema
Schema: 40% |================ | ETA: 00:00:38
Saving session to push_201106170529.dat..
!!! Caught Server Exception
HTTP CODE: 503
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
html, body, iframe { margin: 0; padding: 0; height: 100%; }
iframe { display: block; width: 100%; border: none; }
</style>
<title>Application Error</title></head>
</head>
<body>
<iframe src="https://s3.amazonaws.com/heroku_pages/error.html">
<p>Application Error</p>
</iframe>
</body>
</html>
I'm using taps 0.3.23
While the error message is similar to the one reported here : Heroku help Amazon RDS rails push database error my problem is not related to Amazon's security group as this is already configured.
Anybody else encountering this issue?
I got the same HTML response message and HTTP error code using Heroku with a CURL POST request.
Executing heroku logs | tail gave me more insights:
2016-04-20T10:56:17.509354+00:00 heroku[router]:
at=error code=H12 desc="Request timeout" method=POST [...]
The H12 error denotes a request timeout. That means an "HTTP request took longer than 30 seconds to complete" [1].
More on request timeouts on https://devcenter.heroku.com/articles/request-timeout.
[1] https://devcenter.heroku.com/articles/error-codes#h12-request-timeout
I had the same response with heroku db:push, the first time I attempted.
However, when I ran it a second time, there was no error, and the db pushed.

Resources