legacy-knowledge-base
公開されました Jun. 30, 2025

In Progress Publications Can't Be Published After Upgrading

投稿者

Madeleine Clay

knowledge-article-header-disclaimer-how-to

knowledge-article-header-disclaimer

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • After upgrading, any "in progress" publications fail to publish.
  • When I attempt to publish them, the publication fails and they are marked "out of date".
  • An Unable to publish from test to Production because it is out of date with the current release error is printed in the logs:
ERROR [liferay/background_task-2][BackgroundTaskMessageListener:162] Unable to execute background task
java.lang.IllegalArgumentException: Unable to publish from test to Production because it is out of date with the current release
at com.liferay.change.tracking.internal.background.task.CTPublishBackgroundTaskExecutor.execute(CTPublishBackgroundTaskExecutor.java:122) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
[...]

Environment

  • Quarterly Releases

Resolution

  • All publications should be published before upgrading as part of our documented Upgrade Preparation and Planning steps.
  • However, there are some cases where this may not be possible, e.g. upgrading to apply fixes to resolve publication issues.
  • In these cases, please open a support ticket and request a hotfix containing LPD-31488 and LPD-32036.
  • Or you can manually work around the issue using the following Groovy script to update the schemaVerionId of publications:

NOTE: Be sure to take a backup of your database prior to making any changes. Always test the changes in a lower environment before making changes in production.

Making manual changes to the database is not recommended, and should be carefully assessed based on your own business needs and risk factors. Any such operation is performed at the sole discretion of your own team.

import com.liferay.portal.kernel.dao.jdbc.DataAccess;

import java.sql.Connection;
import java.sql.PreparedStatement;

try {
Connection connection = DataAccess.getConnection();

PreparedStatement ps =
connection.prepareStatement(
"update CTCollection set status = 2, schemaVersionId = (select max(schemaVersionId) as maxSchemaVersion from CTSchemaVersion) where status in (2,3)" );

ps.execute();

connection.commit();
}
catch (Throwable t) {
out.println(t);
}
  • Note: Remove the connect.commit() line if autocommit=true is set in your environment.

 

did-this-article-resolve-your-issue

legacy-knowledge-base