AIStudio2API icon indicating copy to clipboard operation
AIStudio2API copied to clipboard

[Bug] ErrRegionNotSupported stays in modelRetries, reloading Camoufox every 30s indefinitely (280 consecutive failures / 560 WARN logs in 2h20m)

Open photobrand opened this issue 1 week ago • 0 comments

发生了什么 / What happened

Summary

When an account's exit IP hits camoufoxnative.ErrRegionNotSupported (AI Studio 不支持当前出口地区, redirecting to available-regions) during RefreshAccountState or refreshAccountModelCatalog:

  1. RestrictionDenial (internal/aistudio/accounts.go:2952-2958) intentionally returns nil for ErrRegionNotSupported, so the account stays AccountReady.
  2. refreshAccountState (internal/app/runtime.go:1244-1250) and refreshAccountModelCatalog (runtime.go:969-977) unconditionally add accountID to service.modelRetries.
  3. retryAccountModelCatalogs (runtime.go:1064, 1270-1291) sees the account is still AccountReady in pendingModelRetryIDs() (line 1311) and executes Reload(true) every 30 seconds indefinitely with zero backoff and no retry limit.

Observed Log Evidence (sanitized, real production log)

When one account's proxy exited via an unsupported region from 13:53:57 to 16:13:40, it triggered 280 consecutive 30-second Camoufox page reloads and 560 WARN log entries before manual/restart intervention:

{"time":"2026-11-22T16:12:40+03:00","level":"WARN","source":"account_a","msg":"模型目录同步失败","error":"刷新模型目录: AI Studio 不支持当前出口地区..."}
{"time":"2026-11-22T16:13:10+03:00","level":"WARN","source":"account_a","msg":"WAA Worker 重新载入页面失败","error":"AI Studio 不支持当前出口地区..."}
{"time":"2026-11-22T16:13:10+03:00","level":"WARN","source":"account_a","msg":"模型目录同步失败","error":"刷新模型目录: AI Studio 不支持当前出口地区..."}
{"time":"2026-11-22T16:13:40+03:00","level":"WARN","source":"account_a","msg":"WAA Worker 重新载入页面失败","error":"AI Studio 不支持当前出口地区..."}

Suggested Fix

Do not schedule 30s rapid modelRetries when errors.Is(err, camoufoxnative.ErrRegionNotSupported) (or accounts.go AccountAuthRequired / AccountRestricted / catalogErr is already set, or apply exponential backoff / cap consecutive region-unsupported retries). Note that a 30s reload loop on an unsupported-region IP only hammers Google and Camoufox without changing the proxy's geo-IP.

版本 / Version

v0.3.14

photobrand avatar Nov 22 '26 14:11 photobrand