2017-12-15 3 views
1

Ich habe SonarQube 6.7 (LTS) heruntergeladen und ich habe die Anweisungen in this Seite folgen. Es scheint jedoch, dass ein Problem mit der Datenbank verbunden ist. Ich verwende MySQL 5.7 für die Datenbank und ich habe ein Schema Sonar darin und auch die richtigen Datenbankeinstellungen in den sonar.properties Datei setzen namens erstellt. Auf der Datenbankseite habe ich den Benutzer für SonarQube hinzugefügt und ihm auch Administratorrechte gegeben. Aber wenn ich den Webserver starte, wird er gestoppt und wenn ich die Weblogs in der Datei web.log überprüfe, sehe ich eine Ausnahme. Es scheint, es keinen Eintrag in die Tabelle einfügen können schema_migrations die verursacht zu sein scheint:SonarQube kann nicht in MySql-Datenbank einfügen

Caused by: java.sql.SQLException: The table does not comply with the requirements by an external plugin.

ich die Datenbank überprüft, und ich sah, dass die Tabellen erfolgreich durch Sonarqube erstellt wurden. Woher kommt das Problem? und warum? Könnte dies ein Hauptproblem sein?

Unten ist das vollständige Protokoll:

2017.12.15 17:03:35 INFO web[][o.s.p.ProcessEntryPoint] Starting web 
2017.12.15 17:03:35 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read 
2017.12.15 17:03:36 INFO web[][o.e.p.PluginsService] no modules loaded 
2017.12.15 17:03:36 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin] 
2017.12.15 17:03:36 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin] 
2017.12.15 17:03:36 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin] 
2017.12.15 17:03:36 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin] 
2017.12.15 17:03:38 INFO web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001] 
2017.12.15 17:03:38 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server/6.7.0.33306/5d031d9d2ac3f69b4b9bc600d50563b1886c7d8b 
2017.12.15 17:03:38 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:mysql://localhost:3310/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false 
2017.12.15 17:03:39 INFO web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: D:\Programs\sonarqube-6.7 
2017.12.15 17:03:39 INFO web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled 
2017.12.15 17:03:39 INFO web[][o.s.s.p.d.m.h.MigrationHistoryTableImpl] Creating table schema_migrations 
2017.12.15 17:03:40 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Flex/2.3/79167f762219bea1fd181ff5ef6ca4b34abd1675 
2017.12.15 17:03:40 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarC#/6.5.0.3766/6011a1e9fb002edb044ae3092d92bcfb7d9d8a2d 
2017.12.15 17:03:40 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarJS/3.2.0.5506/86da09565f891121df248835665f5d8ed98772b6 
2017.12.15 17:03:40 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarJava/4.15.0.12310/572454b93016ec73a53fe0e07b2ffdc356d21ba9 
2017.12.15 17:03:40 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPHP/2.11.0.2485/741861a29e5f9a26c6c99c06268facb6c4f4a882 
2017.12.15 17:03:40 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPython/1.8.0.1496/3fe3bc4d0273a5721ea2fb368dc45b1bb82fede3 
2017.12.15 17:03:40 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarQube :: Plugins :: SCM :: Git/1.3.0.869/4da53e3f9e55f4f2e5796625cb0c5768ed152079 
2017.12.15 17:03:40 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarQube :: Plugins :: SCM :: SVN/1.6.0.860/2111fdbd1dddda4ad6d4ed6486fd0b18c1010d3b 
2017.12.15 17:03:40 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarTS/1.1.0.1079/042c9e65239a47d92d305f9767f730b3cc1e5ed3 
2017.12.15 17:03:40 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarXML/1.4.3.1027/39588245cecf538bb27be4e496ff303b0143d20b 
2017.12.15 17:03:46 INFO web[][o.s.s.p.d.m.AutoDbMigration] Automatically perform DB migration on fresh install 
2017.12.15 17:03:46 INFO web[][DbMigrations] Executing DB migrations... 
2017.12.15 17:03:46 INFO web[][DbMigrations] #1 'Create initial schema'... 
2017.12.15 17:07:17 ERROR web[][DbMigrations] #1 'Create initial schema': failure | time=211172ms 
2017.12.15 17:07:17 ERROR web[][DbMigrations] Executed DB migrations: failure | time=211172ms 
2017.12.15 17:07:17 ERROR web[][o.s.s.p.Platform] Web server startup failed 
java.lang.IllegalStateException: Failed to insert row with value 1 in table schema_migrations 
    at org.sonar.server.platform.db.migration.history.MigrationHistoryImpl.done(MigrationHistoryImpl.java:88) 
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:76) 
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67) 
    at java.util.Iterator.forEachRemaining(Unknown Source) 
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source) 
    at java.util.stream.ReferencePipeline$Head.forEachOrdered(Unknown Source) 
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52) 
    at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:52) 
    at org.sonar.server.platform.db.migration.AutoDbMigration.start(AutoDbMigration.java:65) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) 
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) 
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) 
    at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) 
    at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) 
    at org.picocontainer.behaviors.Stored.start(Stored.java:110) 
    at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016) 
    at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009) 
    at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767) 
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:134) 
    at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90) 
    at org.sonar.server.platform.Platform.start(Platform.java:211) 
    at org.sonar.server.platform.Platform.startSafeModeContainer(Platform.java:203) 
    at org.sonar.server.platform.Platform.doStart(Platform.java:104) 
    at org.sonar.server.platform.Platform.doStart(Platform.java:95) 
    at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:46) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) 
    at java.util.concurrent.FutureTask.run(Unknown Source) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
    at java.lang.Thread.run(Unknown Source) 
Caused by: java.sql.SQLException: The table does not comply with the requirements by an external plugin. 
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964) 
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973) 
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909) 
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527) 
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680) 
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2490) 
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) 
    at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1197) 
    at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172) 
    at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172) 
    at org.sonar.server.platform.db.migration.history.MigrationHistoryImpl.done(MigrationHistoryImpl.java:83) 
    ... 37 common frames omitted 
+0

Gibt es einen Primärschlüssel in 'schema_migrations'? –

+0

Haben Sie alle MySQL-Anforderungen auf der Seite [SonarQube-Anforderungen] (https://docs.sonarqube.org/display/SONAR/Requirements) überprüft? –

+0

@Mick Nein. Ich habe nicht explizit einen Primärschlüssel für die Tabelle erstellt oder hinzugefügt. –

Antwort

0

Dies ist nicht die Lösung, aber ich neu installiert MySQL-Server mit der gleichen Konfiguration und Benutzern (zusammen mit Privilegien) und seine Arbeits jetzt aus Gründen kann ich nicht verstehen.

Ich konnte das Problem nicht ermitteln, und ich weiß nicht, wie das Problem repliziert wird, weil die gleiche Aktion zu unterschiedlichen Ergebnissen führte.

1

Diese Ausnahme stammt vom MySQL-Treiber. Sie haben anscheinend ein MySQL-Plugin installiert, das das Erstellen der Tabelle schema_migrations verbietet.

Vielleicht haben Sie installiert „Gruppen Replication“ Plug-in und traf diese Ausnahme wie https://bugs.mysql.com/bug.php?id=83165

Verwandte Themen