Quality Gates 500 error - jenkins

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.

Related

How to get access the corporate docker hub inside docker-in-docker?

I have a corporate proxy and docker registry(nexus). When I execute the command:
docker login -u <corporate_login> -p <pass> https://nexus-corporate.com,
I get a successful connection. But when I use docker-in-docker image and execute a similar command, there are problems with proxy. How to solve problem?
Error message:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta type="copyright" content="Copyright (C) 1996-2018 The Squid Software Foundation and contributors">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: The requested URL could not be retrieved</title>
<style type="text/css"><!--
/*
* Copyright (C) 1996-2018 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
/*
Stylesheet for Squid Error pages
Adapted from design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
*/
.....
body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; }
--></style>
</head><body id=ERR_ACCESS_DENIED>
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>
<div id="content">
<p>The following error was encountered while trying to retrieve the URL: http://docker:2375/v1.40/auth</p>
<blockquote id="error">
<p><b>Access Denied.</b></p>
</blockquote>
<p>Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.</p>
<p>Your cache administrator is admin#my_company.com.</p>
<br>
</div>
<hr>
<div id="footer">
<p>Generated Mon, 27 Jan 2020 08:39:45 GMT by proxy.my_company_domain (squid/4.4)</p>
<!-- ERR_ACCESS_DENIED -->
</div>
</body></html>

dart2js Polymer Dart Sample ClickCounter App is OK in Firefox, fails in Chrome

I am trying out a Polymer Dart App under Cordova. So I started with the Dart Editor Sample App.
I use a recent version of Polymer so I had to edit the sample code. Here is my pubspec.yaml
name: cortst
description: Cordova Test Application
dependencies:
polymer: '>=0.15.1+3 <0.16.0'
transformers:
- polymer:
entry_points:
- web/cortst.html
And here is the combined HTML and Dart. I think the initialization uses the new/approved technique:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sample App</title>
<link rel="import" href="clickcounter.html">
<link rel="stylesheet" href="cortst.css">
<script type="application/dart">
import 'dart:async';
import 'package:polymer/polymer.dart';
void main() {
initPolymer().run( () {
Polymer.onReady.then( (_) {
new Future( () {
// stuff goes here!
});
});
});
}
</script>
</head>
<body>
<h1>A Test</h1>
<div id="sample_container_id">
<click-counter count="5"></click-counter>
</div>
</body>
</html>
To generate stand-alone JavaScript I run dart2js via the command line:
pub build --mode=debug
And these are the results:
Dartium (37.0.2062.120 (292122) via Dart Editor 1.7.2) - OK
Run as JavaScript on Chrome (38.0.2125.111 m) - OK
Run as JavaScript on Firefox (33.0.3) - OK
dart2js and run on Chrome - no shadow DOM.
dart2js and run on Firefox - OK
When it fails the click counter is rendered (invisibly) as
<click-counter count="5"></click-counter>
This Chrome problem matters because the standard web host on Android is Chrome.
For brevity, I have embedded the Dart script in the HTML. I get the same results when I use a separate .dart file.
Perhaps I have overlooked something - it wouldn't be the first time...

heroku db:pull strange response

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

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