Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-158349

Batch update returned unexpected row count in Instance Settings tests

Details

    Description

      Reproduce Steps:

      1. Create instance in the new instance Do
        1. Go to Instance Settings
        2. Navigate to a factory (repeatable) configuration. In this case, we can use SSO > OpenID Connect Provider
        3. var openIDConnectClientID = PropsUtil.get("google.client.id.1");
          var openIDConnectClientSecret = PropsUtil.get("google.client.secret.1");
        4. Add a configuration entry by clicking on the Add button
        5. Save
      2. Delete instance

      Expected Results
      Delete the instance and there isn‘t error in log.

      Actual Results
      Delete the instance and there is error in log.

      2022-07-26 01:31:47.446 WARN  [CM Configuration Updater (Delete: pid=com.liferay.portal.security.sso.openid.connect.internal.configuration.OpenIdConnectProviderConfiguration~efd270a5-6ad3-47bf-9d7d-79e3ee626f4e)][OpenIdConnectProviderManagedServiceFactory:217] null
      java.lang.NullPointerException: null
              at java.net.URI$Parser.parse(URI.java:3042) ~[?:1.8.0_131]
              at java.net.URI.<init>(URI.java:588) ~[?:1.8.0_131]
              at java.net.URI.create(URI.java:850) ~[?:1.8.0_131]
              at com.liferay.portal.security.sso.openid.connect.internal.configuration.admin.service.OpenIdConnectProviderManagedServiceFactory._generateLocalWellKnownURI(OpenIdConnectProviderManagedServiceFactory.java:270) ~[bundleFile:?]
              at com.liferay.portal.security.sso.openid.connect.internal.configuration.admin.service.OpenIdConnectProviderManagedServiceFactory._deleteOAuthClientASLocalMetadata(OpenIdConnectProviderManagedServiceFactory.java:171) ~[bundleFile:?]
              at com.liferay.portal.security.sso.openid.connect.internal.configuration.admin.service.OpenIdConnectProviderManagedServiceFactory._deleteOAuthClientEntry(OpenIdConnectProviderManagedServiceFactory.java:208) [bundleFile:?]
              at com.liferay.portal.security.sso.openid.connect.internal.configuration.admin.service.OpenIdConnectProviderManagedServiceFactory.deleted(OpenIdConnectProviderManagedServiceFactory.java:87) [bundleFile:?]
              at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.deleted(ManagedServiceFactoryTracker.java:179) [bundleFile:?]
              at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.removeConfiguration(ManagedServiceFactoryTracker.java:120) [bundleFile:?]
              at org.apache.felix.cm.impl.ConfigurationManager$DeleteConfiguration.run(ConfigurationManager.java:1467) [bundleFile:?]
              at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138) [bundleFile:?]
              at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105) [bundleFile:?]
              at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
      2022-07-26 01:31:49.953 WARN  [liferay/adaptive_media_processor-6][CompanyThreadLocal:187] No default user was found for company 40614
      2022-07-26 01:31:49.953 WARN  [liferay/adaptive_media_processor-2][CompanyThreadLocal:187] No default user was found for company 40614
      2022-07-26 01:31:49.953 WARN  [liferay/adaptive_media_processor-4][CompanyThreadLocal:187] No default user was found for company 40614
      

      Testray
      Jenkins

           [exec]     Executing commands: curl -X DELETE -u '[email protected]:test' -H 'Content-Type: application/json' http://localhost:8080/o/headless-portal-instances/v1.0/portal-instances/test-1-37-9.lax.liferay.com
      [beanshell] 2022-07-15 02:47:22.273 ERROR [http-nio-8080-exec-9][BatchingBatch:139] HHH000315: Exception executing batch [org.hibernate.StaleStateException: Batch update returned unexpected row count from update [7]; actual row count: 0; expected: 1; statement executed: delete from ResourcePermission where resourcePermissionId=? and mvccVersion=?], SQL: delete from ResourcePermission where resourcePermissionId=? and mvccVersion=?
      [beanshell] 2022-07-15 02:47:22.292 ERROR [http-nio-8080-exec-9][ExceptionMapper:68] null
      [beanshell] org.hibernate.StaleStateException: Batch update returned unexpected row count from update [7]; actual row count: 0; expected: 1; statement executed: delete from ResourcePermission where resourcePermissionId=? and mvccVersion=?
      [beanshell] 	at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:67) ~[hibernate-core.jar:5.6.7.Final]
      [beanshell] 	at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:54) ~[hibernate-core.jar:5.6.7.Final]
      
           [exec]     Executing commands: curl -X DELETE -u '[email protected]:test' -H 'Content-Type: application/json' http://localhost:8080/o/headless-portal-instances/v1.0/portal-instances/test-1-37-9.lax.liferay.com
      [beanshell] 2022-07-15 02:47:29.531 ERROR [http-nio-8080-exec-5][ExceptionMapper:68] null
      [beanshell] java.sql.SQLSyntaxErrorException: Unknown table 'lportal.User_x_42622'
      [beanshell] 	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql.jar:8.0.21]
      [beanshell] 	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql.jar:8.0.21]
      

      Attachments

        Activity

          People

            support-lep@liferay.com SE Support
            eric.park Eric Park
            Rafaela Nascimento Rafaela Nascimento
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              39 weeks, 6 days ago

              Packages

                Version Package