Legacy Knowledge Base
Published Sep. 10, 2025

Error 'A folder already exists with name image.default.company.logo' during startup after Upgrade

Written By

Cristina Rodriguez

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

After upgrading from a previous version of Liferay DXP, the server fails to start up correctly and throws a DuplicateFolderNameException in the logs. The error indicates that a folder named image.default.company.logo already exists.

ERROR [main][UpgradeExecutor:333] A folder already exists with name image.default.company.logo
com.liferay.document.library.kernel.exception.DuplicateFolderNameException: A folder already exists with name image.default.company.logo
    at com.liferay.portlet.documentlibrary.service.impl.DLFolderLocalServiceImpl.validateFolder(DLFolderLocalServiceImpl.java:1441)
    ...
    at com.liferay.commerce.product.internal.model.listener.AddRepositoryIdInitialRequestPortalInstanceLifecycleListener.doPortalInstanceRegistered(AddRepositoryIdInitialRequestPortalInstanceLifecycleListener.java:112)

This issue occurs because a Liferay Commerce startup process attempts to create a default folder that already exists due to orphaned data from the previous version.

Environment

  • Liferay DXP Quarterly Releases

Resolution

The solution is to remove the orphaned repository and folder records by running a Groovy script. As a prerequisite, it is highly recommended to perform a full backup of the database and the document library.

  1. Check there is at least one DLFolder with the name 'image.default.company.logo':

    select * from DLFolder d where name = 'image.default.company.logo'
  2. Check no DLFileEntry exists related to any of the 'image.default.company.logo' related repositories:

    select * from dlfileentry where repositoryId in (select repositoryId from Repository r where name = 'image.default.company.logo' AND portletId = "com.liferay.commerce.product");
  3. Find the Repository IDs related to 'image.default.company.logo' and Commerce Portlet:

    SELECT repositoryId FROM Repository WHERE name = 'image.default.company.logo' AND portletId = 'com.liferay.commerce.product';

    Take note of the repositoryIds returned by this query.

  4. Run the Cleanup Script

    Navigate to Control Panel → Server Administration → Script and execute the following Groovy script. Replace the x with the IDs you found in the previous step.

    import java.util.Arrays;
    import java.util.List;
    import com.liferay.portal.kernel.service.RepositoryLocalServiceUtil;
    
    List<Integer> repositoryIdList = Arrays.asList(x,x,x,x,x);
    
    for (int i = 0; i < repositoryIdList.size(); i++) {
    	RepositoryLocalServiceUtil.deleteRepository(Long.valueOf(repositoryIdList.get(i)));
    }

    This script will delete the problematic repository and its associated folder. You must then perform a reindex.

    Please backup your ddbb and DL before running this script.

After these steps, the error should no longer appear during startup.

 

Did this article resolve your issue ?

Legacy Knowledge Base