legacy-knowledge-base
公開されました Sep. 10, 2025

Upgrade Failed due to the Error "No User exists with the primary key..."

written-by

Justin Mann

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

learn-legacy-article-disclaimer-text

Issue

  • When doing the database upgrade from 7.2 DXP-20 to Liferay DXP 7.4 QR 2024.Q3.0, the upgrade can fail with the following error:
ERROR [main][UpgradeExecutor:333] Failed upgrade process for module com.liferay.layout.page.template.service
com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.exception.NoSuchUserException: No User exists with the key {companyId=XXXXXXX,type=0}

 

Environment

  • Liferay DXP 7.4 QR 2024.Q3.0
  • Liferay DXP 7.2

Resolution

  • This error indicates that the guest user for the company with the stated companyId has been somehow deleted from the database, prior to the upgrade
  • To resolve this issue, the guest user can be re-created for the specified companyId in the pre-upgrade environment, and then the upgrade can be run successfully, with that error resolved.
did-this-article-resolve-your-issue

legacy-knowledge-base