diff options
5 files changed, 309 insertions, 1 deletions
diff --git a/server/sonar-search/logs/search.log b/server/sonar-search/logs/search.log new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/server/sonar-search/logs/search.log diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/DatabaseMigrations.java b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/DatabaseMigrations.java index fc1413fd316..e42b945d93e 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/DatabaseMigrations.java +++ b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/DatabaseMigrations.java @@ -35,6 +35,7 @@ import org.sonar.server.db.migrations.v44.FeedQProfileDatesMigration; import org.sonar.server.db.migrations.v44.FeedQProfileKeysMigration; import org.sonar.server.db.migrations.v44.IssueActionPlanKeyMigration; import org.sonar.server.db.migrations.v44.MeasureDataMigration; +import org.sonar.server.db.migrations.v45.AddMissingRuleParameterDefaultValuesMigration; import java.util.List; @@ -61,7 +62,10 @@ public interface DatabaseMigrations { FeedQProfileKeysMigration.class, FeedQProfileDatesMigration.class, ChangeLogMigration.class, - ConvertProfileMeasuresMigration.class + ConvertProfileMeasuresMigration.class, + + // 4.5 + AddMissingRuleParameterDefaultValuesMigration.class ); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v45/AddMissingRuleParameterDefaultValuesMigration.java b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v45/AddMissingRuleParameterDefaultValuesMigration.java new file mode 100644 index 00000000000..d11e9c09c2b --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v45/AddMissingRuleParameterDefaultValuesMigration.java @@ -0,0 +1,130 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.server.db.migrations.v45; + +import org.apache.commons.dbutils.DbUtils; +import org.sonar.core.persistence.Database; +import org.sonar.server.db.migrations.BaseDataChange; +import org.sonar.server.db.migrations.Select; +import org.sonar.server.db.migrations.Upsert; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.Date; +import java.util.List; + +/** + * SONAR-5446 + */ +public class AddMissingRuleParameterDefaultValuesMigration extends BaseDataChange { + + public AddMissingRuleParameterDefaultValuesMigration(Database db) { + super(db); + } + + @Override + public void execute(Context context) { + Connection connection = null; + try { + // get all the parameters with default value + List<RuleParam> ruleParameters = context.prepareSelect("select id,rule_id,name,default_value from rules_parameters where default_value is not null") + .query(new Select.RowReader<RuleParam>() { + @Override + public RuleParam read(Select.Row row) throws SQLException { + return new RuleParam(row.getLong(1), row.getLong(2), row.getString(3), row.getString(4)); + } + }); + + for (RuleParam ruleParameter : ruleParameters) { + List<ActiveRule> activeRules = context.prepareSelect("select ar.id, ar.profile_id from active_rules ar " + + "left outer join active_rule_parameters arp on arp.active_rule_id=ar.id and arp.rules_parameter_id=? " + + "where ar.rule_id=? and arp.id is null") + .setLong(1, ruleParameter.id) + .setLong(2, ruleParameter.ruleId) + .query(new Select.RowReader<ActiveRule>() { + @Override + public ActiveRule read(Select.Row row) throws SQLException { + return new ActiveRule(row.getLong(1), row.getLong(2)); + } + }); + + Upsert upsert = context.prepareUpsert("insert into active_rule_parameters(active_rule_id, rules_parameter_id, value, rules_parameter_key) values (?, ?, ?, ?)"); + for (ActiveRule activeRule : activeRules) { + upsert + .setLong(1, activeRule.id) + .setLong(2, ruleParameter.id) + .setString(3, ruleParameter.defaultValue) + .setString(4, ruleParameter.name) + .addBatch(); + } + upsert.execute(); + + // update date for ES indexation + upsert = context.prepareUpsert("update active_rules set updated_at=? where id=?"); + Date now = new Date(); + for (ActiveRule activeRule : activeRules) { + upsert + .setDate(1, now) + .setLong(2, activeRule.id) + .addBatch(); + } + upsert.execute(); + + } + } catch (SQLException e) { + e.printStackTrace(); + } finally { + DbUtils.closeQuietly(connection); + } + } + + private static class RuleParam { + final long id, ruleId; + final String defaultValue, name; + + RuleParam(long id, long ruleId, String name, String defaultValue) { + this.id = id; + this.ruleId = ruleId; + this.name = name; + this.defaultValue = defaultValue; + } + } + + private static class ActiveRule { + final long id, profileId; + + ActiveRule(long id, long profileId) { + this.id = id; + this.profileId = profileId; + } + } + + private static class ActiveRuleParam { + final long activeRuleId, ruleParamId; + final String value, ruleParamKey; + + ActiveRuleParam(long activeRuleId, long ruleParamId, String ruleParamKey, String value) { + this.activeRuleId = activeRuleId; + this.ruleParamId = ruleParamId; + this.ruleParamKey = ruleParamKey; + this.value = value; + } + } +} diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v45/package-info.java b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v45/package-info.java new file mode 100644 index 00000000000..a2769c527fa --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v45/package-info.java @@ -0,0 +1,24 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +@ParametersAreNonnullByDefault +package org.sonar.server.db.migrations.v45; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/sonar-application/SONAR_HOME_IS_UNDEFINED/logs/sonar.log b/sonar-application/SONAR_HOME_IS_UNDEFINED/logs/sonar.log new file mode 100644 index 00000000000..e3e3ac94b47 --- /dev/null +++ b/sonar-application/SONAR_HOME_IS_UNDEFINED/logs/sonar.log @@ -0,0 +1,150 @@ +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] AJP connector is enabled on port 9000 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9000 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] Shutdown command is enabled on port 9010 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] AJP connector is enabled on port 9009 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] AJP connector is enabled on port 9009 +2014.07.16 12:18:39 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:18:40 INFO [o.s.a.Connectors] HTTP connector is enabled on port 0 +2014.07.16 12:18:40 INFO [o.a.c.h.Http11Protocol] Initializing ProtocolHandler ["http-bio-0.0.0.0-auto-1"] +2014.07.16 12:18:40 INFO [o.a.c.c.StandardService] Starting service Tomcat +2014.07.16 12:18:40 INFO [o.a.c.c.StandardEngine] Starting Servlet Engine: Apache Tomcat/7.0.42 +2014.07.16 12:18:40 INFO [o.a.c.s.ContextConfig] No global web.xml found +2014.07.16 12:18:40 INFO [o.a.c.h.Http11Protocol] Starting ProtocolHandler ["http-bio-0.0.0.0-auto-1-54089"] +2014.07.16 12:18:40 INFO [o.a.c.h.Http11Protocol] Pausing ProtocolHandler ["http-bio-0.0.0.0-auto-1-54089"] +2014.07.16 12:18:41 INFO [o.a.c.c.StandardService] Stopping service Tomcat +2014.07.16 12:18:41 ERROR [o.a.c.l.WebappClassLoader] The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. +2014.07.16 12:18:41 INFO [o.a.c.h.Http11Protocol] Stopping ProtocolHandler ["http-bio-0.0.0.0-auto-1-54089"] +2014.07.16 12:18:42 INFO [o.a.c.h.Http11Protocol] Destroying ProtocolHandler ["http-bio-0.0.0.0-auto-1-54089"] +2014.07.16 12:18:42 INFO [o.s.a.Connectors] HTTP connector is enabled on port 0 +2014.07.16 12:18:42 INFO [o.a.c.h.Http11Protocol] Initializing ProtocolHandler ["http-bio-0.0.0.0-auto-2"] +2014.07.16 12:18:42 INFO [o.a.c.c.StandardService] Starting service Tomcat +2014.07.16 12:18:42 INFO [o.a.c.c.StandardEngine] Starting Servlet Engine: Apache Tomcat/7.0.42 +2014.07.16 12:18:42 INFO [o.a.c.s.ContextConfig] No global web.xml found +2014.07.16 12:18:42 INFO [o.a.c.h.Http11Protocol] Starting ProtocolHandler ["http-bio-0.0.0.0-auto-2-54093"] +2014.07.16 12:18:43 INFO [o.a.c.h.Http11Protocol] Pausing ProtocolHandler ["http-bio-0.0.0.0-auto-2-54093"] +2014.07.16 12:18:44 INFO [o.a.c.c.StandardService] Stopping service Tomcat +2014.07.16 12:18:44 INFO [o.a.c.h.Http11Protocol] Stopping ProtocolHandler ["http-bio-0.0.0.0-auto-2-54093"] +2014.07.16 12:18:45 INFO [o.a.c.h.Http11Protocol] Destroying ProtocolHandler ["http-bio-0.0.0.0-auto-2-54093"] +2014.07.16 12:18:45 WARN [o.s.a.Webapp] + + +------ RAILS DEVELOPMENT MODE IS ENABLED ------ + + + +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] AJP connector is enabled on port 9000 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9000 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] Shutdown command is enabled on port 9010 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] AJP connector is enabled on port 9009 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:54:44 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:54:45 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:54:45 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:54:45 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:54:45 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 12:54:45 INFO [o.s.a.Connectors] AJP connector is enabled on port 9009 +2014.07.16 12:54:45 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 12:54:45 INFO [o.s.a.Connectors] HTTP connector is enabled on port 0 +2014.07.16 12:54:45 INFO [o.a.c.h.Http11Protocol] Initializing ProtocolHandler ["http-bio-0.0.0.0-auto-1"] +2014.07.16 12:54:45 INFO [o.a.c.c.StandardService] Starting service Tomcat +2014.07.16 12:54:45 INFO [o.a.c.c.StandardEngine] Starting Servlet Engine: Apache Tomcat/7.0.42 +2014.07.16 12:54:45 INFO [o.a.c.s.ContextConfig] No global web.xml found +2014.07.16 12:54:45 INFO [o.a.c.h.Http11Protocol] Starting ProtocolHandler ["http-bio-0.0.0.0-auto-1-54845"] +2014.07.16 12:54:45 INFO [o.a.c.h.Http11Protocol] Pausing ProtocolHandler ["http-bio-0.0.0.0-auto-1-54845"] +2014.07.16 12:54:46 INFO [o.a.c.c.StandardService] Stopping service Tomcat +2014.07.16 12:54:46 ERROR [o.a.c.l.WebappClassLoader] The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. +2014.07.16 12:54:46 INFO [o.a.c.h.Http11Protocol] Stopping ProtocolHandler ["http-bio-0.0.0.0-auto-1-54845"] +2014.07.16 12:54:47 INFO [o.a.c.h.Http11Protocol] Destroying ProtocolHandler ["http-bio-0.0.0.0-auto-1-54845"] +2014.07.16 12:54:47 INFO [o.s.a.Connectors] HTTP connector is enabled on port 0 +2014.07.16 12:54:47 INFO [o.a.c.h.Http11Protocol] Initializing ProtocolHandler ["http-bio-0.0.0.0-auto-2"] +2014.07.16 12:54:47 INFO [o.a.c.c.StandardService] Starting service Tomcat +2014.07.16 12:54:47 INFO [o.a.c.c.StandardEngine] Starting Servlet Engine: Apache Tomcat/7.0.42 +2014.07.16 12:54:47 INFO [o.a.c.s.ContextConfig] No global web.xml found +2014.07.16 12:54:47 INFO [o.a.c.h.Http11Protocol] Starting ProtocolHandler ["http-bio-0.0.0.0-auto-2-54849"] +2014.07.16 12:54:48 INFO [o.a.c.h.Http11Protocol] Pausing ProtocolHandler ["http-bio-0.0.0.0-auto-2-54849"] +2014.07.16 12:54:49 INFO [o.a.c.c.StandardService] Stopping service Tomcat +2014.07.16 12:54:49 INFO [o.a.c.h.Http11Protocol] Stopping ProtocolHandler ["http-bio-0.0.0.0-auto-2-54849"] +2014.07.16 12:54:50 INFO [o.a.c.h.Http11Protocol] Destroying ProtocolHandler ["http-bio-0.0.0.0-auto-2-54849"] +2014.07.16 12:54:50 WARN [o.s.a.Webapp] + + +------ RAILS DEVELOPMENT MODE IS ENABLED ------ + + + +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] AJP connector is enabled on port 9000 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9000 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] Shutdown command is enabled on port 9010 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] AJP connector is enabled on port 9009 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] AJP connector is enabled on port 9009 +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTPS connector is enabled on port 9443 +2014.07.16 20:30:59 WARN [o.s.a.Webapp] + + +------ RAILS DEVELOPMENT MODE IS ENABLED ------ + + + +2014.07.16 20:30:59 INFO [o.s.a.Connectors] HTTP connector is enabled on port 0 +2014.07.16 20:30:59 INFO [o.a.c.h.Http11Protocol] Initializing ProtocolHandler ["http-bio-0.0.0.0-auto-1"] +2014.07.16 20:30:59 INFO [o.a.c.c.StandardService] Starting service Tomcat +2014.07.16 20:30:59 INFO [o.a.c.c.StandardEngine] Starting Servlet Engine: Apache Tomcat/7.0.42 +2014.07.16 20:30:59 INFO [o.a.c.s.ContextConfig] No global web.xml found +2014.07.16 20:30:59 INFO [o.a.c.h.Http11Protocol] Starting ProtocolHandler ["http-bio-0.0.0.0-auto-1-57803"] +2014.07.16 20:31:00 INFO [o.a.c.h.Http11Protocol] Pausing ProtocolHandler ["http-bio-0.0.0.0-auto-1-57803"] +2014.07.16 20:31:01 INFO [o.a.c.c.StandardService] Stopping service Tomcat +2014.07.16 20:31:01 ERROR [o.a.c.l.WebappClassLoader] The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. +2014.07.16 20:31:01 INFO [o.a.c.h.Http11Protocol] Stopping ProtocolHandler ["http-bio-0.0.0.0-auto-1-57803"] +2014.07.16 20:31:02 INFO [o.a.c.h.Http11Protocol] Destroying ProtocolHandler ["http-bio-0.0.0.0-auto-1-57803"] +2014.07.16 20:31:02 INFO [o.s.a.Connectors] HTTP connector is enabled on port 0 +2014.07.16 20:31:02 INFO [o.a.c.h.Http11Protocol] Initializing ProtocolHandler ["http-bio-0.0.0.0-auto-2"] +2014.07.16 20:31:02 INFO [o.a.c.c.StandardService] Starting service Tomcat +2014.07.16 20:31:02 INFO [o.a.c.c.StandardEngine] Starting Servlet Engine: Apache Tomcat/7.0.42 +2014.07.16 20:31:02 INFO [o.a.c.s.ContextConfig] No global web.xml found +2014.07.16 20:31:02 INFO [o.a.c.h.Http11Protocol] Starting ProtocolHandler ["http-bio-0.0.0.0-auto-2-57807"] +2014.07.16 20:31:02 INFO [o.a.c.h.Http11Protocol] Pausing ProtocolHandler ["http-bio-0.0.0.0-auto-2-57807"] +2014.07.16 20:31:03 INFO [o.a.c.c.StandardService] Stopping service Tomcat +2014.07.16 20:31:03 INFO [o.a.c.h.Http11Protocol] Stopping ProtocolHandler ["http-bio-0.0.0.0-auto-2-57807"] +2014.07.16 20:31:04 INFO [o.a.c.h.Http11Protocol] Destroying ProtocolHandler ["http-bio-0.0.0.0-auto-2-57807"] |