Details

    • Databases:
      MariaDB 10.2

      Description

      Reproduce

      Run the Update from Liferay 6.2 to 7.1.0 GA1, execute in the gogo shell

       

      $ upgrade:execute com.liferay.oauth2.provider.service
      

       

      Error occurs:

      g! upgrade:execute com.liferay.oauth2.provider.service upgrade:execute com.liferay.oauth2.provider.service com.liferay.portal.kernel.upgrade.UpgradeException: Bundle com.liferay.oauth2.provider.service_1.0.2 [718] has invalid content in indexes.sql: create index IX_87DAF9C3 on OA2Auths_OA2ScopeGrants (companyId); create index IX_F4C82F24 on OA2Auths_OA2ScopeGrants (oAuth2AuthorizationId); create index IX_2F541817 on OA2Auths_OA2ScopeGrants (oAuth2ScopeGrantId); create index IX_523E5C67 on OAuth2Application (companyId, clientId[$COLUMN_LENGTH:75$]); create index IX_282ECE83 on OAuth2ApplicationScopeAliases (companyId); create index IX_29847127 on OAuth2ApplicationScopeAliases (oAuth2ApplicationId, scopeAliasesHash); create index IX_77D3B9EA on OAuth2Authorization (accessTokenContentHash); create index IX_70DD169C on OAuth2Authorization (oAuth2ApplicationId); create index IX_10C77BD5 on OAuth2Authorization (refreshTokenContentHash); create index IX_719D503E on OAuth2Authorization (userId); create index IX_88938BF on OAuth2ScopeGrant (companyId, oA2AScopeAliasesId, applicationName[$COLUMN_LENGTH:255$], bundleSymbolicName[$COLUMN_LENGTH:255$], scope[$COLUMN_LENGTH:255$]); create index IX_80FCAC23 on OAuth2ScopeGrant (oA2AScopeAliasesId); at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextExtender$ModuleApplicationContextExtension$1.upgrade(ModuleApplicationContextExtender.java:354) at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfosRunnable.run(ReleaseManagerOSGiCommands.java:540) at com.liferay.portal.output.stream.container.internal.OutputStreamContainerFactoryTrackerImpl.runWithSwappedLog(OutputStreamContainerFactoryTrackerImpl.java:117) at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.executeUpgradeInfos(ReleaseManagerOSGiCommands.java:338) at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.doExecute(ReleaseManagerOSGiCommands.java:281) at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.execute(ReleaseManagerOSGiCommands.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137) at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82) at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477) at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403) at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120) at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89) at org.apache.felix.gogo.shell.Console.run(Console.java:62) at org.apache.felix.gogo.shell.Shell.console(Shell.java:203) at org.apache.felix.gogo.shell.Shell.gosh(Shell.java:128) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137) at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82) at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477) at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403) at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120) at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89) at org.eclipse.equinox.console.telnet.TelnetConnection.run(TelnetConnection.java:94) Caused by: java.sql.SQLSyntaxErrorException: Specified key was too long; max key length is 3072 bytes at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:138) at org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106) at org.mariadb.jdbc.MySQLStatement.executeQueryEpilog(MySQLStatement.java:268) at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:296) at org.mariadb.jdbc.MySQLStatement.executeUpdate(MySQLStatement.java:364) at org.mariadb.jdbc.MySQLStatement.executeUpdate(MySQLStatement.java:396) at com.zaxxer.hikari.pool.ProxyStatement.executeUpdate(ProxyStatement.java:117) at com.zaxxer.hikari.pool.HikariProxyStatement.executeUpdate(HikariProxyStatement.java) at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:294) at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:264) at com.liferay.portal.dao.db.BaseDB.runSQLTemplateString(BaseDB.java:449) at com.liferay.portal.dao.db.BaseDB.runSQLTemplateString(BaseDB.java:506) at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextExtender$ModuleApplicationContextExtension$1.upgrade(ModuleApplicationContextExtender.java:350) ... 33 more Caused by: org.mariadb.jdbc.internal.common.QueryException: Specified key was too long; max key length is 3072 bytes at org.mariadb.jdbc.internal.mysql.MySQLProtocol.getResult(MySQLProtocol.java:995) at org.mariadb.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:1050) at org.mariadb.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:1030) at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:289) ... 42 more
      

      Database

      mysql  Ver 15.1 Distrib 10.2.17-MariaDB, for Linux (x86_64) using readline 5.1

      Reason

      The problem is IMHO in the SQL statement in liferay-portal/modules/apps/oauth2-provider/oauth2-provider-service/src/main/resources/META-INF/sql/indexes.sql:

       

      create index IX_88938BF7 on OAuth2ScopeGrant (companyId, oA2AScopeAliasesId, applicationName(255), bundleSymbolicName(255), scope(255));

       

      If I run this statement in the mysql console, it fails too. But if I change one limit from 255 to 254, it works fine. e.g.

      create index IX_88938BF7 on OAuth2ScopeGrant (companyId, oA2AScopeAliasesId, applicationName(255), bundleSymbolicName(255), scope(254));

       

       

        Attachments

          Activity

            People

            • Assignee:
              harry.chai Harry Chai
              Reporter:
              severin.rohner Severin Rohner
              Participants of an Issue:
              Recent user:
              Severin Rohner
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 27 weeks, 5 days ago

                Packages

                Version Package
                7.1.X
                Master