affaan-m/ECC · error · RuntimeError

could not append

Error message

could not append {event['id']}

What it means

After importing the asset, apply_placements calls media_pool.AppendToTimeline with explicit startFrame/endFrame/trackIndex/recordFrame and requires exactly one timeline item back. If AppendToTimeline returns None, an empty list, or more than one item, the append did not land as requested and it raises this RuntimeError naming the event id.

Solutions

  1. Verify the host's endpoint convention and pass the correct source_end_mode ('inclusive' or 'exclusive') as documented on this Resolve install.
  2. Ensure record_frame + frames stays within the timeline duration and trackIndex refers to an existing video track.
  3. Compute event['frames'] at the timeline's true fps so endFrame > startFrame for every event.

Example fix

// before
apply_placements(tl, pool, placements, source_end_mode="exclusive", ...)
// after
apply_placements(tl, pool, placements, source_end_mode="inclusive", ...)  # convention verified on this host
Defensive patterns

Strategy: validation

Validate before calling

tl_end = timeline.GetEndFrame()
for e in plan:
    end = e["record_frame"] + e["frames"] - (mode == "inclusive")
    if end <= e["record_frame"] or end > tl_end:
        raise ValueError(f"event {e['id']} out of timeline bounds")

Type guard

def placements_in_bounds(plan, timeline, mode):
    tl_end = timeline.GetEndFrame()
    return all(
        e["frames"] > (mode == "inclusive")
        and e["record_frame"] + e["frames"] - (mode == "inclusive") <= tl_end
        for e in plan
    )

Try / catch

try:
    apply_placements(tl, pool, placements, source_end_mode=mode, ...)
except RuntimeError as e:
    if "could not append" in str(e):
        print("verify source_end_mode convention and record frames on this host")
    else:
        raise

Prevention

When it happens

Trigger: recordFrame beyond the timeline end (Resolve pads differently or rejects), endFrame <= startFrame (e.g. frames==1 with source_end_mode='inclusive' yields endFrame 0), trackIndex pointing at a track Resolve won't write, or Resolve silently failing the placement due to format mismatch.

Common situations: Very short overlays (1 frame) combined with the wrong source_end_mode convention for the host; record frames computed at the wrong fps (see the fps mismatch guard) landing past the timeline duration; Resolve version behavior differences in AppendToTimeline returns.

Understand the failure class

Background: "invalid response format", "malformed payload", "missing data field": when an API returns 200 but the response shape is wrong — this error's family across 23 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/ec3e93d099178faf. Report an issue: GitHub.

Appendix: source

Thrown at skills/taste-application/scripts/tasteforge/resolve.py:294

    appended = []
    for event in plan:
        imported = media_pool.ImportMedia([event["asset"]])
        if not imported or len(imported) != 1:
            raise RuntimeError(f"could not import {event['asset']}")
        items = media_pool.AppendToTimeline(
            [
                {
                    "mediaPoolItem": imported[0],
                    "startFrame": 0,
                    "endFrame": event["frames"] - (source_end_mode == "inclusive"),
                    "mediaType": 1,
                    "trackIndex": event["track"],
                    "recordFrame": event["record_frame"],
                }
            ]
        )
        if not items or len(items) != 1:
            raise RuntimeError(f"could not append {event['id']}")
        item = items[0]
        for key, value in [
            ("Opacity", event["opacity"]),
            ("CompositeMode", event["composite"]),
        ]:
            if not item.SetProperty(key, value):
                raise RuntimeError(f"could not set {key} for {event['id']}")
        _readback(timeline, item, event)
        appended.append((event, item))
    receipts = []
    for event, item in appended:
        actual = _readback(timeline, item, event)
        receipts.append(
            {
                "id": event["id"],
                "asset": event["asset"],
                "requested": {
                    key: event[key]

View on GitHub (pinned to 8321021c54)