New issue
Advanced search Search tips

Issue 2228 link

Starred by 3 users

Issue metadata

Status: Invalid
Owner: ----
Closed: Jul 2015



Sign in to add a comment

Error in Mysql

Reported by h.g.gloe...@gmail.com, Oct 31 2013

Issue description

************************************************************
***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL *****
***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.    *****
***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS!  *****
************************************************************


Affected Version: 2.7


What steps will reproduce the problem?
1. I create via Webfrontend a Group LuniferaAdmins
2. I want to add a User to this group

I use LDAP to authenticate

My Config-file is:
.../gerrit/etc/gerrit.config
[gerrit]
        basePath = /lunifera/repos
        canonicalWebUrl = https://cnaps.informatik.uni-ulm.de:8082
[database]
        type = MYSQL
        hostname = localhost
        database = reviewdb
        username = gerrit
[auth]
        type = LDAP
[ldap]
        server = ldap://localhost:10389
        username = cn=Directory Manager,cn=Root DNs,cn=config
        accountBase = ou=people,dc=lunifera,dc=org
        groupBase = ou=groups,dc=lunifera,dc=org
        accountFullName = ${givenName} ${sn}
[sendemail]
        enable = true
        smtpServer = mail.uni-ulm.de
        smtpServerPort = 587
        smtpEncryption = tls
        sslVerify = false
        smtpUser = username
        smtpPass = secret
[container]
        user = lunifera
        javaHome = /usr/lib/jvm/java-6-openjdk-amd64/jre
[sshd]
        listenAddress = *:29418
[httpd]
        listenUrl = https://*:8082/
[cache]
        directory = cache


What is the expected output? What do you see instead?
I get the following error:
[2013-10-31 10:48:28,099] WARN  / : Error in suggestAccount
com.google.gwtorm.server.OrmException: fetch failure on accounts
        at com.google.gwtorm.schema.sql.SqlDialect.convertError(SqlDialect.java:151)
        at com.google.gwtorm.jdbc.JdbcAccess.convertError(JdbcAccess.java:448)
        at com.google.gwtorm.jdbc.JdbcAccess.queryList(JdbcAccess.java:146)
        at com.google.gerrit.reviewdb.client.Account_Access_accounts_GwtOrm$$11.suggestByFullName(Unknown Source)
        at com.google.gerrit.httpd.rpc.SuggestServiceImpl.suggestAccount(SuggestServiceImpl.java:142)
        at com.google.gerrit.httpd.rpc.SuggestServiceImpl.access$100(SuggestServiceImpl.java:58)
        at com.google.gerrit.httpd.rpc.SuggestServiceImpl$1.run(SuggestServiceImpl.java:117)
        at com.google.gerrit.httpd.rpc.SuggestServiceImpl$1.run(SuggestServiceImpl.java:115)
        at com.google.gerrit.httpd.rpc.BaseServiceImplementation.run(BaseServiceImplementation.java:68)
        at com.google.gerrit.httpd.rpc.SuggestServiceImpl.suggestAccount(SuggestServiceImpl.java:115)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.google.gwtjsonrpc.server.MethodHandle.invoke(MethodHandle.java:91)
        at com.google.gwtjsonrpc.server.JsonServlet.doService(JsonServlet.java:379)
        at com.google.gwtjsonrpc.server.JsonServlet.service(JsonServlet.java:265)
        at com.google.gerrit.httpd.rpc.GerritJsonServlet.service(GerritJsonServlet.java:120)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
        at com.google.gerrit.pgm.http.jetty.GetUserFilter.doFilter(GetUserFilter.java:76)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.gwtexpui.server.CacheControlFilter.doFilter(CacheControlFilter.java:70)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.gerrit.httpd.RequireSslFilter.doFilter(RequireSslFilter.java:68)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.gerrit.httpd.AllRequestFilter$FilterProxy$1.doFilter(AllRequestFilter.java:64)
        at com.google.gerrit.httpd.AllRequestFilter$FilterProxy.doFilter(AllRequestFilter.java:57)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.gerrit.httpd.RequestContextFilter.doFilter(RequestContextFilter.java:75)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:67)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:365)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
        at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:937)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:998)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at org.eclipse.jetty.io.nio.SslConnection.handle(SslConnection.java:196)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Thread.java:724)
Caused by: java.sql.SQLException: Illegal mix of collations (latin1_bin,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '<='
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2309)
        at com.google.gwtorm.jdbc.JdbcAccess.queryList(JdbcAccess.java:134)
        ... 70 more



Please provide any additional information below.
1) I create the database in MYSQL with the folloing command like in the documentation.
mysql
  CREATE USER 'gerrit'@'localhost' IDENTIFIED BY 'gerrit';
  CREATE DATABASE reviewdb;
  ALTER DATABASE reviewdb charset=latin1;
  GRANT ALL ON reviewdb.* TO 'gerrit'@'localhost';
  FLUSH PRIVILEGES;

2) I use opensuse 12.3 64 bit

3) I use mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 845
Server version: 5.5.33-MariaDB openSUSE package
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

 
I had to do this in my gerrit.config to make it to work.

[database]
	type = mysql
#	hostname = localhost
#	database = reviewdb
#	username = gerrit2
	url = jdbc:mysql://localhost:3306/reviewdb?user=gerrit2&password=<secret>&useUnicode=false&characterEncoding=latin1
I got a "Error in suggestChangeReviewer", but the solution in reply #1 worked for me as well.
Cause: moved the database to a different server. Did not looked into all details but probably because the database or server settings have different defaults for character encoding
Project Member

Comment 3 by edwin.ke...@gmail.com, Jul 3 2015

Status: Invalid
This looks quite old. Closing this issue. Please say if this is still a problem.

Sign in to add a comment