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

ステージング タスクが開始されず、0% のままになる

written-by

David Tello

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

問題

  • ライブ コンテンツ (Web コンテンツ、ページなど) を公開して新しいタスクを作成しようとすると、公開タスクがスタックして開始されません。
  • タスクの進行状況は常に 0% のままです。

Environment

  • DXP 7.3
  • DXP 7.2

解決策

  • 場合によっては、 com.liferay.exportimport.internal.background.task.LayoutStagingBackgroundTaskExecutor バックグラウンド タスクがデータベースでロックされているために、この状況が発生する可能性があります。
  • 一度に実行できるのは、各タイプの 1 つのタスクだけです。実行すべきタスクにロックがある場合は、残りのタスクも待機する必要があります。
  • ノードがクラッシュするか、順序のないシャットダウンがこの状況を引き起こす可能性があります。
  • これが発生すると、 Lock_ テーブルに削除する必要がある行があります。 この問題のある行を簡単に削除するには、次のスクリプトが役立ちます。
    import com.liferay.portal.kernel.model.*;
    import com.liferay.portal.kernel.service.*;
    import com.liferay.portal.background.task.service.*;
    import com.liferay.portal.kernel.backgroundtask.*;
    import com.liferay.portal.lock.service.*;
    
    
    String taskExecutorClassNametaskExecutorClassName = "com.liferay.exportimport.internal.background.task.LayoutStagingBackgroundTaskExecutor";
    
    String groupId = "3172392";
    
    String lockKey = taskExecutorClassName + "#" + groupId;
    
    boolean isLocked = LockLocalServiceUtil.isLocked(BackgroundTaskExecutor.class.getName(), lockKey);
    
    if(isLocked) {
        LockLocalServiceUtil.unlock(BackgroundTaskExecutor.class.getName(), lockKey);
        out.println("Unlocking " + lockKey);
    }
    
    def backgroundTask = BackgroundTaskLocalServiceUtil.fetchFirstBackgroundTask(
    taskExecutorClassName, BackgroundTaskConstants.STATUS_QUEUED);
    
    while (backgroundTask != null)
    {
        out.println("Cancelling " + backgroundTask.getBackgroundTaskId());
        BackgroundTaskLocalServiceUtil.amendBackgroundTask(
            backgroundTask.getBackgroundTaskId(), null, BackgroundTaskConstants.STATUS_CANCELLED,
            "Cancelled", new ServiceContext());
    
        backgroundTask = BackgroundTaskLocalServiceUtil.fetchFirstBackgroundTask(
            taskExecutorClassName, BackgroundTaskConstants.STATUS_QUEUED);
    }
  • このスクリプトは、ローカル ステージングで機能します。 リモートステージングを使用している場合は、変数 taskExecutorClassName の開始を "com.liferay.exportimport.internal.background.task.LayoutStagingBackgroundTaskExecutor" から "com.liferay.exportimport.internal.background.task" に変更する必要があります。 .LayoutRemoteStagingBackgroundTaskExecutor".

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base