Uploaded image for project: 'PUBLIC - Liferay Sync'
  1. PUBLIC - Liferay Sync
  2. SYNC-1730

Adding accounts fail when a site and user have identical names

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Desktop-3.4.2 GA3
    • Fix Version/s: Desktop-3.4.2 GA3
    • Component/s: General
    • Labels:
      None

      Description

      Steps to reproduce:

      1. Create a site called "test" in portal
      2. Add an account to Liferay Sync with the default "test@liferay.com" account

      Expected result:
      No errors with syncing.

      Actual result:
      The following behavior is observed:
      The error in the screenshot will appear and following message will appear in the log:

      09:42:46.602 TRACE [Thread-14] [BaseService:40] Unable to run insert stmt on object {"uiEvent":0,"state":0,"changeLog":null,"checksum":null,"companyId":0,"createTime":0,"description":null,"event":null,"extension":null,"extraSettings":null,"filePathName":"C:\\Users\\deju\\Documents\\deju-mbpro.local (2)\\test","lanTokenKey":null,"localExtraSettings":null,"localSyncTime":1490978566592,"lockExpirationDate":0,"lockUserId":0,"lockUserName":null,"mimeType":null,"modifiedTime":0,"name":"test","parentFolderId":0,"previousModifiedTime":0,"repositoryId":35005,"size":0,"syncAccountId":1,"syncFileId":0,"type":"system","typePK":0,"typeUuid":null,"userId":0,"userName":null,"version":null,"versionId":0,"file":false,"system":true,"folder":true,"unsynced":false,"privateWorkingCopy":false}: INSERT INTO `SyncFile` (`changeLog` ,`checksum` ,`companyId` ,`createTime` ,`description` ,`extension` ,`extraSettings` ,`filePathName` ,`lanTokenKey` ,`localExtraSettings` ,`localSyncTime` ,`lockExpirationDate` ,`lockUserId` ,`lockUserName` ,`mimeType` ,`modifiedTime` ,`name` ,`parentFolderId` ,`previousModifiedTime` ,`repositoryId` ,`size` ,`syncAccountId` ,`type` ,`typePK` ,`typeUuid` ,`userId` ,`userName` ,`version` ,`versionId` ,`state` ,`uiEvent` ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
      java.sql.SQLException: Unable to run insert stmt on object {"uiEvent":0,"state":0,"changeLog":null,"checksum":null,"companyId":0,"createTime":0,"description":null,"event":null,"extension":null,"extraSettings":null,"filePathName":"C:\\Users\\deju\\Documents\\deju-mbpro.local (2)\\test","lanTokenKey":null,"localExtraSettings":null,"localSyncTime":1490978566592,"lockExpirationDate":0,"lockUserId":0,"lockUserName":null,"mimeType":null,"modifiedTime":0,"name":"test","parentFolderId":0,"previousModifiedTime":0,"repositoryId":35005,"size":0,"syncAccountId":1,"syncFileId":0,"type":"system","typePK":0,"typeUuid":null,"userId":0,"userName":null,"version":null,"versionId":0,"file":false,"system":true,"folder":true,"unsynced":false,"privateWorkingCopy":false}: INSERT INTO `SyncFile` (`changeLog` ,`checksum` ,`companyId` ,`createTime` ,`description` ,`extension` ,`extraSettings` ,`filePathName` ,`lanTokenKey` ,`localExtraSettings` ,`localSyncTime` ,`lockExpirationDate` ,`lockUserId` ,`lockUserName` ,`mimeType` ,`modifiedTime` ,`name` ,`parentFolderId` ,`previousModifiedTime` ,`repositoryId` ,`size` ,`syncAccountId` ,`type` ,`typePK` ,`typeUuid` ,`userId` ,`userName` ,`version` ,`versionId` ,`state` ,`uiEvent` ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
      	at com.j256.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:22)
      	at com.j256.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:135)
      	at com.j256.ormlite.stmt.StatementExecutor.create(StatementExecutor.java:450)
      	at com.j256.ormlite.dao.BaseDaoImpl.create(BaseDaoImpl.java:310)
      	at com.liferay.sync.engine.service.persistence.BasePersistenceImpl.create(BasePersistenceImpl.java:52)
      	at com.liferay.sync.engine.service.SyncFileService.addSyncFile(SyncFileService.java:146)
      	at com.liferay.sync.engine.service.SyncAccountService.addSyncAccount(SyncAccountService.java:152)
      	at com.liferay.sync.ui.window.addaccountwizard.service.AddSyncAccountService$AddSyncAccountTask.doCall(AddSyncAccountService.java:115)
      	at com.liferay.sync.ui.window.addaccountwizard.service.AddSyncAccountService$AddSyncAccountTask.doCall(AddSyncAccountService.java:63)
      	at com.liferay.sync.ui.window.service.BaseService$BaseTask.call(BaseService.java:50)
      	at javafx.concurrent.Task$TaskCallable.call(Task.java:1423)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at javafx.concurrent.Service.lambda$null$492(Service.java:725)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javafx.concurrent.Service.lambda$executeTask$493(Service.java:724)
      	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.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "SYNCFILE_FILEPATHNAME_IDX ON PUBLIC.SYNCFILE(FILEPATHNAME) VALUES ( /* 5 */ 'C:\Users\deju\Documents\deju-mbpro.local (2)\test' )"; SQL statement:
      INSERT INTO `SyncFile` (`changeLog` ,`checksum` ,`companyId` ,`createTime` ,`description` ,`extension` ,`extraSettings` ,`filePathName` ,`lanTokenKey` ,`localExtraSettings` ,`localSyncTime` ,`lockExpirationDate` ,`lockUserId` ,`lockUserName` ,`mimeType` ,`modifiedTime` ,`name` ,`parentFolderId` ,`previousModifiedTime` ,`repositoryId` ,`size` ,`syncAccountId` ,`type` ,`typePK` ,`typeUuid` ,`userId` ,`userName` ,`version` ,`versionId` ,`state` ,`uiEvent` ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [23505-176]
      	at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
      	at org.h2.message.DbException.get(DbException.java:178)
      	at org.h2.message.DbException.get(DbException.java:154)
      	at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:103)
      	at org.h2.index.PageBtree.find(PageBtree.java:121)
      	at org.h2.index.PageBtreeLeaf.addRow(PageBtreeLeaf.java:151)
      	at org.h2.index.PageBtreeLeaf.addRowTry(PageBtreeLeaf.java:104)
      	at org.h2.index.PageBtreeIndex.addRow(PageBtreeIndex.java:97)
      	at org.h2.index.PageBtreeIndex.add(PageBtreeIndex.java:88)
      	at org.h2.index.MultiVersionIndex.add(MultiVersionIndex.java:59)
      	at org.h2.table.RegularTable.addRow(RegularTable.java:120)
      	at org.h2.command.dml.Insert.insertRows(Insert.java:157)
      	at org.h2.command.dml.Insert.update(Insert.java:115)
      	at org.h2.command.CommandContainer.update(CommandContainer.java:79)
      	at org.h2.command.Command.executeUpdate(Command.java:254)
      	at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:158)
      	at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:144)
      	at com.j256.ormlite.jdbc.JdbcDatabaseConnection.insert(JdbcDatabaseConnection.java:170)
      	at com.j256.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:91)
      	... 16 common frames omitted
      
      

        Attachments

        1. errorsOnStartSyncing.png
          58 kB
          Shitian "Shelton" Zhang
        2. sync.log
          6 kB
          Shitian "Shelton" Zhang

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 37 weeks ago

                Packages

                Version Package
                Desktop-3.4.2 GA3