Uploaded image for project: 'PUBLIC - OAuth2'
  1. PUBLIC - OAuth2
  2. OAUTH2-135

OAuth2ApplicationScopeAliases scopeAliases column is too short for most usages

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0-portal_7.1.0
    • Fix Version/s: 1.0-portal_7.1.0
    • Component/s: None
    • Labels:
      None

      Description

      Also accessTokenContent and refreshTokenContent

       

      The problem: 

      create index IX_D8310AF9 on OAuth2ApplicationScopeAliases (oAuth2ApplicationId, scopeAliases[$COLUMN_LENGTH:4096$]);
      ...
      DB2 SQL Error: SQLCODE=-350, SQLSTATE=42962, SQLERRMC=SCOPEALIASES, DRIVER=4.16.53

      Documentation:
      For variable-length strings longer than 255 bytes, you can use the LVARCHAR data type, whose upper limit is 32,739 bytes, instead of VARCHAR.
      https://www.ibm.com/support/knowledgecenter/en/SSGU8G_12.1.0/com.ibm.sqlr.doc/ids_sqr_148.htm

      A LOB, LONG VARCHAR, LONG VARGRAPHIC, XML, or structured type column cannot be used in a unique constraint.
      https://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.messages.sql.doc/doc/msql00350n.html

      Stacktrace

      java.lang.RuntimeException: com.liferay.portal.kernel.upgrade.UpgradeException: Bundle com.liferay.oauth2.provider.service_1.0.0 [667] 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_D8310AF9 on OAuth2ApplicationScopeAliases (oAuth2ApplicationId, scopeAliases[$COLUMN_LENGTH:4096$]);
      
      create index IX_3B12D3C on OAuth2Authorization (accessTokenContent[$COLUMN_LENGTH:4096$]);
      create index IX_70DD169C on OAuth2Authorization (oAuth2ApplicationId);
      create index IX_C2109CA7 on OAuth2Authorization (refreshTokenContent[$COLUMN_LENGTH:4096$]);
      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.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfosRunnable.run(ReleaseManagerOSGiCommands.java:564)
      	at com.liferay.portal.output.stream.container.internal.OutputStreamContainerFactoryTrackerImpl.runWithSwappedLog(OutputStreamContainerFactoryTrackerImpl.java:106)
      	at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.executeUpgradeInfos(ReleaseManagerOSGiCommands.java:337)
      	at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.doExecute(ReleaseManagerOSGiCommands.java:280)
      	at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfoServiceTrackerMapListener.keyEmitted(ReleaseManagerOSGiCommands.java:505)
      	at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfoServiceTrackerMapListener.keyEmitted(ReleaseManagerOSGiCommands.java:495)
      	at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$DefaultEmitter.emit(ServiceTrackerMapImpl.java:222)
      	at com.liferay.osgi.service.tracker.collections.map.PropertyServiceReferenceMapper.map(PropertyServiceReferenceMapper.java:43)
      	at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$ServiceReferenceServiceTrackerCustomizer.addingService(ServiceTrackerMapImpl.java:261)
      	at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$ServiceReferenceServiceTrackerCustomizer.addingService(ServiceTrackerMapImpl.java:248)
      	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
      	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
      	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
      	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
      	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318)
      	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)
      	at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl.<init>(ServiceTrackerMapImpl.java:64)
      	at com.liferay.osgi.service.tracker.collections.map.ServiceTrackerMapFactory.openMultiValueMap(ServiceTrackerMapFactory.java:120)
      	at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.activate(ReleaseManagerOSGiCommands.java:240)
      	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.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)
      	at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)
      	at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)
      	at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)
      	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:302)
      	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:294)
      	at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:297)
      	at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:108)
      	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:906)
      	at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:879)
      	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:748)
      	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:1012)
      	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:968)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167)
      	at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127)
      	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
      	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:917)
      	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
      	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
      	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
      	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:886)
      	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:873)
      	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132)
      	at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:940)
      	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:740)
      	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:1012)
      	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:968)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167)
      	at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127)
      	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
      	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:917)
      	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
      	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
      	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
      	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:482)
      	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:1001)
      	at com.liferay.registry.internal.RegistryImpl.registerService(RegistryImpl.java:355)
      	at com.liferay.portal.servlet.MainServlet.registerPortalInitialized(MainServlet.java:1348)
      	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:425)
      	at javax.servlet.GenericServlet.init(GenericServlet.java:158)
      	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1124)
      	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1079)
      	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:971)
      	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4765)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5075)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:742)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
      	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
      	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1840)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
      	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
      	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:525)
      	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:424)
      	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1586)
      	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
      	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
      	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
      	at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
      	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:966)
      	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
      	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
      	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
      	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
      	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      	at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
      	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.catalina.startup.Bootstrap.start(Bootstrap.java:353)
      	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: Bundle com.liferay.oauth2.provider.service_1.0.0 [667] 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_D8310AF9 on OAuth2ApplicationScopeAliases (oAuth2ApplicationId, scopeAliases[$COLUMN_LENGTH:4096$]);
      
      create index IX_3B12D3C on OAuth2Authorization (accessTokenContent[$COLUMN_LENGTH:4096$]);
      create index IX_70DD169C on OAuth2Authorization (oAuth2ApplicationId);
      create index IX_C2109CA7 on OAuth2Authorization (refreshTokenContent[$COLUMN_LENGTH:4096$]);
      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:350)
      	at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfosRunnable.run(ReleaseManagerOSGiCommands.java:539)
      	... 122 more
      Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-350, SQLSTATE=42962, SQLERRMC=SCOPEALIASES, DRIVER=4.16.53
      	at com.ibm.db2.jcc.am.fd.a(fd.java:739)
      	at com.ibm.db2.jcc.am.fd.a(fd.java:60)
      	at com.ibm.db2.jcc.am.fd.a(fd.java:127)
      	at com.ibm.db2.jcc.am.to.c(to.java:2771)
      	at com.ibm.db2.jcc.am.to.d(to.java:2759)
      	at com.ibm.db2.jcc.am.to.b(to.java:2126)
      	at com.ibm.db2.jcc.t4.ab.i(ab.java:226)
      	at com.ibm.db2.jcc.t4.ab.c(ab.java:48)
      	at com.ibm.db2.jcc.t4.o.b(o.java:38)
      	at com.ibm.db2.jcc.t4.tb.h(tb.java:124)
      	at com.ibm.db2.jcc.am.to.jb(to.java:2121)
      	at com.ibm.db2.jcc.am.to.a(to.java:3294)
      	at com.ibm.db2.jcc.am.to.c(to.java:748)
      	at com.ibm.db2.jcc.am.to.executeUpdate(to.java:727)
      	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:295)
      	at com.liferay.portal.dao.db.DB2DB.runSQL(DB2DB.java:81)
      	at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:264)
      	at com.liferay.portal.dao.db.BaseDB.runSQLTemplateString(BaseDB.java:450)
      	at com.liferay.portal.dao.db.BaseDB.runSQLTemplateString(BaseDB.java:507)
      	at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextExtender$ModuleApplicationContextExtension$1.upgrade(ModuleApplicationContextExtender.java:346)
      	... 123 more

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                1.0-portal_7.1.0