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

NoSuchFileExceptions during Data Migration process of wiki attachments from File repo to Amazon S3 repo

    Details

      Description

      If I use attachments in wiki page template and want to perform data migration from File Repository to Amazon S3, files are correctly copied to Amazon S3 but Migration Process throws NoSuchFileExceptions in the log file and new unnecessary folder is created in local file system. Consequently migration process throws error:
      09:39:39,832 ERROR [liferay/convert_process-1][ConvertDocumentLibrary:197] Migration failed for 2
      com.liferay.portlet.documentlibrary.NoSuchFileException: /home/janhaj/Plocha/liferay-portal-6.2.0-ce-b1/data/document_library/1/10468/2/1.0

      I attached two screenshots, on first one is shown that the file (attachment) is under original 1/10471/2 directory, on second screen (after data migration) new directory 1/10468 is present, created by Data migration, which is empty.

      Steps to reproduce:

      1. Setup clean Liferay Portal 6.2.0-CE-b1 with login credentials to Amazon S3 in portal-ext.properties file.
      2. Add page with wiki template, edit front page and add attachment
        -> attachment is saved under $LIFERAY_HOME/data/document_library/1/10471/2 directory in File System
      3. Verify the attachment is downloadeable (from file repository) by clicking attachment on wiki page
      4. Perform Data migration to S3 via Control Panel -> Server Administration -> Data Migration

      Expected Result: Data Migration process finishes successfully, user is redirected to Home page and file is migrated to Amazon S3. No errors in log files.
      Actual Result: Data Migration process finishes successfully, user is redirected to Home page and file is migrated to Amazon S3 properly, but
      -> Following error have been observed in log file: Migration failed for 2 com.liferay.portlet.documentlibrary.NoSuchFileException: /home/janhaj/Plocha/liferay-portal-6.2.0-ce-b1/data/document_library/1/10468/2/1.0
      -> New folder $LIFERAY_HOME/data/document_library/1/10468 has been created in local file system which is not necessary

      1. Navigate back to wiki page and download the attachment
        -> Attachment is downloadable

      Below is full stack exception for migration process:

      09:39:34,780 DEBUG [http-bio-8080-exec-1][MaintenanceUtil:64] Executing com.liferay.portal.convert.ConvertDocumentLibrary
      09:39:34,786 INFO  [liferay/convert_process-1][ConvertProcess:41] Starting conversion for com.liferay.portal.convert.ConvertDocumentLibrary
      09:39:37,232 DEBUG [liferay/convert_process-1][MaintenanceUtil:64] Migrating 0 images
      09:39:37,238 DEBUG [liferay/convert_process-1][MaintenanceUtil:64] Migrating 1 documents and media files
      09:39:37,244 WARN  [liferay/convert_process-1][RestStorageService:221] Content-Length of data stream not set, will automatically determine data length in memory
      09:39:39,810 DEBUG [liferay/convert_process-1][MaintenanceUtil:64] Migrating message boards attachments in 13 messages
      09:39:39,824 DEBUG [liferay/convert_process-1][MaintenanceUtil:64] Migrating wiki page attachments in 2 pages
      09:39:39,832 ERROR [liferay/convert_process-1][ConvertDocumentLibrary:197] Migration failed for 2
      com.liferay.portlet.documentlibrary.NoSuchFileException: /home/janhaj/Plocha/liferay-portal-6.2.0-ce-b1/data/document_library/1/10468/2/1.0
      	at com.liferay.portlet.documentlibrary.store.FileSystemStore.getFileAsStream(FileSystemStore.java:215)
      	at com.liferay.portal.convert.ConvertDocumentLibrary.migrateFile(ConvertDocumentLibrary.java:185)
      	at com.liferay.portal.convert.ConvertDocumentLibrary.migrateDLFileEntry(ConvertDocumentLibrary.java:176)
      	at com.liferay.portal.convert.ConvertDocumentLibrary$4.performAction(ConvertDocumentLibrary.java:287)
      	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActions(BaseActionableDynamicQuery.java:98)
      	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActions(BaseActionableDynamicQuery.java:71)
      	at com.liferay.portal.convert.ConvertDocumentLibrary.migrateWiki(ConvertDocumentLibrary.java:295)
      	at com.liferay.portal.convert.ConvertDocumentLibrary.migratePortlets(ConvertDocumentLibrary.java:259)
      	at com.liferay.portal.convert.ConvertDocumentLibrary.doConvert(ConvertDocumentLibrary.java:112)
      	at com.liferay.portal.convert.ConvertProcess.convert(ConvertProcess.java:44)
      	at com.liferay.portal.convert.messaging.ConvertProcessMessageListener.doReceive(ConvertProcessMessageListener.java:48)
      	at com.liferay.portal.convert.messaging.ConvertProcessMessageListener.receive(ConvertProcessMessageListener.java:33)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.SerialDestination$1.run(SerialDestination.java:65)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:662)
      Caused by: java.io.FileNotFoundException: /home/janhaj/Plocha/liferay-portal-6.2.0-ce-b1/data/document_library/1/10468/2/1.0 (No such file or directory)
      	at java.io.FileInputStream.open(Native Method)
      	at java.io.FileInputStream.<init>(FileInputStream.java:120)
      	at com.liferay.portlet.documentlibrary.store.FileSystemStore.getFileAsStream(FileSystemStore.java:212)
      	... 16 more
      09:39:39,833 DEBUG [liferay/convert_process-1][MaintenanceUtil:64] Please set dl.store.impl in your portal-ext.properties to use com.liferay.portlet.documentlibrary.store.S3Store
      09:39:39,834 INFO  [liferay/convert_process-1][ConvertProcess:47] Finished conversion for com.liferay.portal.convert.ConvertDocumentLibrary in 5048 ms
      

        Attachments

        1. after.png
          after.png
          52 kB
        2. before.png
          before.png
          52 kB

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 45 weeks ago

                  Packages

                  Version Package
                  6.2.0 CE RC1