Skip to content

tail-log: reconnect stream after EOF so CLI survives midnight log rotation #724

Description

@GeorgeAlexandru

Problem

aio cloudmanager:tail-log exits silently at midnight (00:00 UTC) when AEM Cloud Manager rotates its daily log files. The stream ends with a normal EOF — no error — so the CLI interprets it as success and terminates.

Root Cause

executeWithRetries in cloudmanager-helpers.js only retries on HTTP 401/403. A normal EOF resolves the promise without error, so the outer TailLog.tailLog() method returns and the process exits.

Fix

Replace the single executeWithRetries call with a while(true) reconnect loop:

  • Swallow transient errors with no error.code (404, network drops, Azure SAS expiry)
  • Re-throw fatal CLI-coded errors (MAX_RETRY_REACHED, NO_IMS_CONTEXT)
  • Wait 2 seconds between reconnects

Jira: https://jira.corp.adobe.com/browse/CMGR-76557

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions