bytebase/bytebase · error

done requires a non-empty text string

Error message

done requires a non-empty text string

What it means

getIndexes fetches index comments (extended properties on indexes) in a separate rows iterator and maps them by objectID/indexID. If that iterator fails with rows.Err(), the whole index fetch fails with 'failed to fetch index comments'. The code's own comment says comments are not critical, yet the error is propagated and aborts getKeyAndIndexes.

Source

Thrown at frontend/src/modules/agent/logic/tools/index.ts:76

    .filter((option): option is AgentAskUserOption => !!option);
};

const parseAskUserKind = (
  value: unknown,
  options: AgentAskUserOption[]
): AgentAskUserKind => {
  if (value === "confirm") {
    return "confirm";
  }
  if (value === "choose" && options.length > 0) {
    return "choose";
  }
  return "input";
};

const parseDoneArgs = (args: Record<string, unknown>): ToolExecutionResult => {
  if (typeof args.text !== "string" || !args.text.trim()) {
    throw new Error("done requires a non-empty text string");
  }
  return {
    kind: "done",
    text: args.text,
    success: args.success !== false,
  };
};

const parseAskUserArgs = (
  args: Record<string, unknown>,
  toolCallId: string
): ToolExecutionResult => {
  if (typeof args.prompt !== "string" || !args.prompt.trim()) {
    throw new Error("ask_user requires a non-empty prompt string");
  }

  const options = parseAskUserOptions(args.options);
  const ask: AgentPendingAsk = {

View on GitHub (pinned to 1870550677)

Solutions

  1. Retry the schema sync once connectivity is confirmed stable
  2. Log and continue: replace the return with a warning so indexes sync without comments, per the stated intent
  3. Grant the sync login permission to read sys.extended_properties and index catalog views
  4. Tune connection pool/idle timeouts (driver ConnParams, server keepalive) to survive long syncs

Example fix

// before
if err := commentsRows.Err(); err != nil {
    return nil, errors.Wrap(err, "failed to fetch index comments")
}
// after
if err := commentsRows.Err(); err != nil {
    log.Warn("failed to fetch index comments, continuing", log.BBError(err))
}
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: The comments query rows iterator hits a transport error mid-scan (connection reset, cancellation) or the extended_properties query on indexes fails against the target SQL Server edition or under restricted permissions.

Common situations: Long SyncDBSchema runs where the connection drops between sequential queries; sync accounts lacking catalog-view read permissions; Azure SQL vs on-prem differences in sys index metadata; idle connection reaping by firewalls/load balancers.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of bytebase/bytebase@1870550677 (2026-09-06). Data as JSON: /api/errors/16a4f9f54474a113. Report an issue: GitHub.