credit / maxCredits failure
`max_credits_required` `max_credits_exceeded` `credit_balance_insufficient` の見分け方と復旧手順です。
このページの内容3項目
credit を消費する実行は、必ず上限付きで進めます。 sf list estimate と sf list candidates は無料です。sf list materialize --execute で saved List row を作る時に Basic credit を使います。
まず見るコマンド
sf credits balance --json sf list estimate "上場企業のうち、売上100億以上" --json
見る key:
balance.available_creditsbalance.grants[]billing.materialize.estimated_creditsestimate.estimate_idnext_actions
エラーの見分け方
| Code | 意味 | 復旧 |
|---|---|---|
max_credits_required | 課金対象の実行に --max-credits がない | estimate の必要 credit を確認して、上限を付けて再実行 |
max_credits_exceeded | 見積もり credit が指定した上限を超えた | 上限を上げるか、query を狭めて estimate からやり直す |
credit_balance_insufficient | account の利用可能 credit が足りない | sf credits balance --json で grant 残高を確認し、追加後に再実行 |
max_credits_required
max_credits_required は、実行上限を明示していない時に返ります。 agent は勝手に上限を決めず、estimate の値を確認してください。
sf list estimate "上場企業のうち、売上100億以上" --json sf list materialize --from-estimate <estimateId> --name "売上100億以上の上場企業" --execute --max-credits <estimatedCredits> --json
<estimatedCredits> には billing.materialize.estimated_credits を使います。 ユーザーが指定した予算がある場合は、その数字を超えて実行しないでください。
max_credits_exceeded
max_credits_exceeded は、保存に必要な credit が --max-credits を超えた時に返ります。 この場合、credit は消費されません。
復旧は 2 択です。
sf list estimate "上場企業のうち、売上100億以上 AND プライム市場" --json sf list candidates --from-estimate <estimateId> --json
query を狭めても良いなら、estimate からやり直します。
sf list materialize --from-estimate <estimateId> --name "売上100億以上の上場企業" --execute --max-credits <higherLimit> --json
対象件数に納得しているなら、人間に確認してから上限を上げます。
credit_balance_insufficient
credit_balance_insufficient は、上限は足りていても account の利用可能 credit が足りない時に返ります。
sf credits balance --json
見る key:
balance.available_creditsbalance.remaining_creditsbalance.reserved_creditsbalance.consumption_orderbalance.grants[].source_typebalance.grants[].available_creditsbalance.grants[].expires_at
残高が足りない場合は、Free / Pro / Credit Pack / campaign grant のどれが不足しているかを確認します。 credit が追加された後、同じ estimate がまだ有効なら materialize を再実行します。
sf list materialize --from-estimate <estimateId> --name "売上100億以上の上場企業" --execute --max-credits <estimatedCredits> --json
estimate が見つからない場合は、estimate / materialize failure に戻って estimate から作り直します。
再発防止
- execute 前に
sf list estimate ... --jsonを読む billing.materialize.estimated_credits以下の--max-creditsで保存しないsf credits balance --jsonでavailable_creditsを確認してから長い job を始めるweak/unsupported/needs_humanの条件を、0 件扱いで保存しない
credit は、保存済み row や enrichment column / evidence を作る実行時に発生します。 preview や estimate は確認用です。