#305·open-seo

DataForSEO account-level errors (40104 unverified) surface as "An unexpected error occurred"

Author: eduyuberoCreated Sep 8, 2026Updated Sep 8, 2026

A fresh self-host install whose DataForSEO account is not yet verified fails every research request with:

An unexpected error occurred. Please check server logs and try again.

The real cause is a DataForSEO account-level status code that is entirely user-actionable:

status_code: 40104
status_message: "Please verify your account before using the API.
                 You can complete verification in the user panel: https://app.dataforseo.com/"
cost: $0

Why it's hard to diagnose

Two separate places drop the message:

  1. UIassertOk (src/server/lib/dataforseo/envelope.ts:225-230) does preserve status_message, but with no matching classifier it becomes AppError("INTERNAL_ERROR", …), which renders as the generic text above.
  2. Logs — the Worker error event contained only server.function error: followed by a minified stack, with no message. So the server logs the UI tells you to check don't contain the reason either.

grep -rn "40104" src/ returns nothing.

The existing createDataforseoBillingClassifier (src/server/lib/dataforseoBillingClassification.ts) covers 40200/40210/402 and only when the request path matches a configured pathPrefix (/backlinks/, AI Optimization), so /dataforseo_labs/ and /keywords_data/ calls get no classification at all.

Impact

This is a day-one blocker for new self-hosters: the DataForSEO signup flow hands you working credentials before the account is verified, and /v3/appendix/user_data succeeds in that state — so the key validates fine while every data endpoint returns 40104. Diagnosing it currently requires reproducing the API call by hand outside the app.

Suggested direction

Classify DataForSEO account-level status codes independently of pathPrefix and surface status_message for them, so 40104 (unverified) and 40200 (insufficient balance) render as themselves. Including the message in the error log would also help — the current log gives a stack but no reason.

Environment

  • Self-host on Cloudflare Workers, OpenSEO 0.1.7
  • Reproduced via Keyword Research (/v3/dataforseo_labs/google/related_keywords/live); the same 40104 applies account-wide