hcengineering/platform · error

not implemented

Error message

not implemented

What it means

Stream.ConcatUploads is invoked by tus/resumable-upload flows when an upload resumes after a failure and existing partial uploads must be concatenated. This implementation deliberately returns 'not implemented' — resumption from partial uploads is unsupported; the TODO says the intended behavior is reloading the raw source from the backup bucket, terminating same-ID streams, and restarting processing.

Source

Thrown at foundations/stream/internal/pkg/mediaconvert/stream.go:147

			}
		}()
	}

	wg.Wait()

	// Signal that the stream is done
	close(w.done)

	return nil
}

// ConcatUploads calls when upload resumed after fail
func (w *Stream) ConcatUploads(ctx context.Context, partialUploads []handler.Upload) error {
	w.logger.Debug("ConcatUploads was executed, it's not implemented")
	//
	// TODO: load raw source from the Buckup bucket, terminate all Streams with same ID and start process again.
	//
	return errors.New("not implemented")
}

// FinishUpload calls when upload finished without errors on the client side
func (w *Stream) FinishUpload(ctx context.Context) error {
	ctx, span := tracer.Start(ctx, "FinishUpload", trace.WithAttributes(
		attribute.String("workspace", w.info.MetaData["workspace"]),
		attribute.String("upload_id", w.info.ID),
	))
	defer span.End()

	w.logger.Debug("finish upload")

	// Close the writer first to signal EOF to all readers
	if err := w.writer.Close(); err != nil {
		tracing.RecordError(span, err)
		w.logger.Error("failed to close writer", zap.Error(err))
		return err
	}

View on GitHub (pinned to 63e28dc964)

Solutions

  1. Do not rely on resume for Stream uploads — restart the upload from the beginning on failure
  2. Implement the TODO: recover raw source from the backup bucket, terminate streams with the same ID, and re-run processing
  3. Configure the tus client to not attempt concat-style resume with this backend (offset restart instead)
  4. If resumability is required, use a storage backend whose ConcatUploads is implemented

Example fix

// before
client.resume(uploadID) // server hits ConcatUploads -> not implemented
// after
client.terminate(uploadID)
client.startFreshUpload(file)
Defensive patterns

Strategy: fallback

Validate before calling

// avoid triggering resume path: detect prior partial upload client-side
const state = await fetch(`${tusURL}/${uploadID}`)
if (state.status === 200 && needsConcatRecovery) {
  await terminateUpload(uploadID) // restart fresh
}

Try / catch

if err := stream.ConcatUploads(ctx, partials); err != nil {
    if err.Error() == "not implemented" {
        // restart processing from backup source instead
        return restartFromBackup(ctx, uploadID)
    }
    return err
}

Prevention

When it happens

Trigger: A tus upload is interrupted and the client resumes, causing the handler to call ConcatUploads with partial uploads; upload retry/recovery paths reaching Stream after a network failure mid-transfer.

Common situations: Unstable client networks interrupting large uploads; server restarts mid-upload followed by client resume; automated retry policies on the client that assume concat/resume works.

Related errors


AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29). Data as JSON: /api/errors/2fd20261ff12b024. Report an issue: GitHub.