Reputation: 3566
I've downloaded sonarqube and made its configurations. I've MySQL 5.6.21 installed and running on my localhost. I've created a database 'sonar' and a user 'sonar' with password 'sonar' as it's shown in this example script:
https://github.com/SonarSource/sonar-examples/blob/master/scripts/database/mysql/create_database.sql
I'm using windows, so I started StartSonar.bat in the windows-x86-64 folder. It seems it started without any problems. However, when I open http://localhost:9000
in my browser, it gives me this JDBCError:
org.jruby.rack.RackInitializationException: ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
from E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
from E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183:in `execute'
from E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:109:in `create_table'
from E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mysql/adapter.rb:247:in `create_table'
from E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:371:in `initialize_schema_migrations_table'
from E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:441:in `initialize'
from E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401:in `up'
from E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383:in `migrate'
from E:/runnable/sonarqube/web/WEB-INF/config/../lib/database_version.rb:62:in `upgrade_and_start'
from E:/runnable/sonarqube/web/WEB-INF/config/../lib/database_version.rb:74:in `automatic_setup'
from E:/runnable/sonarqube/web/WEB-INF/config/environment.rb:236:in `(root)'
from org/jruby/RubyKernel.java:1096:in `load'
from file:/E:/runnable/sonarqube/web/WEB-INF/lib/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1:in `(root)'
from file:/E:/runnable/sonarqube/web/WEB-INF/lib/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25:in `load_environment'
from file:/E:/runnable/sonarqube/web/WEB-INF/lib/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79:in `load_environment'
at org.jruby.rack.RackInitializationException.wrap(RackInitializationException.java:29)
at org.jruby.rack.RackApplicationFactoryDecorator.init(RackApplicationFactoryDecorator.java:98)
at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:50)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
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: org.jruby.exceptions.RaiseException: (StatementInvalid) ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
at RUBY.log(E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227)
at RUBY.execute(E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183)
at RUBY.create_table(E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:109)
at RUBY.create_table(E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mysql/adapter.rb:247)
at RUBY.initialize_schema_migrations_table(E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:371)
at RUBY.initialize(E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:441)
at RUBY.up(E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401)
at RUBY.migrate(E:/runnable/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383)
at RUBY.upgrade_and_start(E:/runnable/sonarqube/web/WEB-INF/config/../lib/database_version.rb:62)
at RUBY.automatic_setup(E:/runnable/sonarqube/web/WEB-INF/config/../lib/database_version.rb:74)
at RUBY.(root)(E:/runnable/sonarqube/web/WEB-INF/config/environment.rb:236)
at org.jruby.RubyKernel.load(org/jruby/RubyKernel.java:1096)
at RUBY.(root)(file:/E:/runnable/sonarqube/web/WEB-INF/lib/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1)
at RUBY.load_environment(file:/E:/runnable/sonarqube/web/WEB-INF/lib/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25)
at RUBY.load_environment(file:/E:/runnable/sonarqube/web/WEB-INF/lib/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79)
I tried Sonarqube 4.5 and 4.0. Both gave me the same error. Do you know anything about this error? I've googled it and couldn't find anything about it.
Upvotes: 0
Views: 655
Reputation: 242
Just start your server without any database connection. If it starts fine than we have a problem in configuring your database connection string or in the database itself. Once this is done you can share your results here. Sometime back i tried to configure the sonar with mysql workbench and it worked fine. i can share those things with you.
Upvotes: 1