Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-3635: display core init failure info (from CoreAdminHandler) in the web UI

Chris M. Hostettercb8c32204100
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index a214b21a9b3..7075fbea868 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -97,10 +97,11 @@ New Features
lib folder. The factories are automatically made available with SPI.
(Chris Male, Robert Muir, Uwe Schindler)
-* SOLR-3634: CoreContainer and CoreAdminHandler will now remember and report
- back information about failures to initialize SolrCores. These failures will
- be accessible from the STATUS command until they are "reset" by
- creating/renaming a SolrCore with the same name. (hossman)
+* SOLR-3634, SOLR-3635: CoreContainer and CoreAdminHandler will now remember
+ and report back information about failures to initialize SolrCores. These
+ failures will be accessible from the web UI and CoreAdminHandler STATUS
+ command until they are "reset" by creating/renaming a SolrCore with the
+ same name. (hossman, steffkes)
* SOLR-1280: Added commented-out example of the new script update processor
to the example configuration. See http://wiki.apache.org/solr/ScriptUpdateProcessor (ehatcher)
diff --git a/solr/webapp/web/admin.html b/solr/webapp/web/admin.html
index a051ad4c07e..23b58566d85 100644
--- a/solr/webapp/web/admin.html
+++ b/solr/webapp/web/admin.html
@@ -63,7 +63,15 @@ limitations under the License.
</div>
<div id="main" class="clearfix">
-
+
+ <div id="init-failures">
+
+ <h2>SolrCore Initialization Failures</h2>
+ <ul></ul>
+ <p>Please check your logs for more information</p>
+
+ </div>
+
<div id="content-wrapper">
<div id="content">
diff --git a/solr/webapp/web/css/styles/common.css b/solr/webapp/web/css/styles/common.css
index c06ec563db2..01839245c9e 100644
--- a/solr/webapp/web/css/styles/common.css
+++ b/solr/webapp/web/css/styles/common.css
@@ -284,6 +284,38 @@ ul
border-color: #66b866;
}
+#init-failures
+{
+ border: 1px solid #f00;
+ display: none;
+ margin-left: 150px;
+ margin-bottom: 20px;
+}
+
+#main.error #init-failures
+{
+ margin-left: 0;
+}
+
+#init-failures h2,
+#init-failures ul,
+#init-failures p
+{
+ padding: 10px;
+}
+
+#init-failures h2
+{
+ background-color: #f00;
+ color: #fff;
+ font-weight: bold;
+}
+
+#init-failures p
+{
+ color: #c0c0c0;
+ padding-top: 0;
+}
#content-wrapper
{
diff --git a/solr/webapp/web/js/scripts/app.js b/solr/webapp/web/js/scripts/app.js
index e38e495432c..1adef69fd1c 100644
--- a/solr/webapp/web/js/scripts/app.js
+++ b/solr/webapp/web/js/scripts/app.js
@@ -231,6 +231,29 @@ var solr_admin = function( app_config )
.append( core_tpl );
}
+ if( response.initFailures )
+ {
+ var failures = [];
+ for( var core_name in response.initFailures )
+ {
+ failures.push
+ (
+ '<li>' +
+ '<strong>' + core_name.esc() + ':</strong>' + "\n" +
+ response.initFailures[core_name].esc() + "\n" +
+ '</li>'
+ );
+ }
+
+ if( 0 !== failures.length )
+ {
+ var init_failures = $( '#init-failures' );
+
+ init_failures.show();
+ $( 'ul', init_failures ).html( failures.join( "\n" ) );
+ }
+ }
+
if( 0 === core_count )
{
show_global_error