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:
- UI —
assertOk (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.
- 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
A fresh self-host install whose DataForSEO account is not yet verified fails every research request with:
The real cause is a DataForSEO account-level status code that is entirely user-actionable:
Why it's hard to diagnose
Two separate places drop the message:
assertOk(src/server/lib/dataforseo/envelope.ts:225-230) does preservestatus_message, but with no matching classifier it becomesAppError("INTERNAL_ERROR", …), which renders as the generic text above.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) covers40200/40210/402and only when the request path matches a configuredpathPrefix(/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_datasucceeds 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
pathPrefixand surfacestatus_messagefor them, so40104(unverified) and40200(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
0.1.7/v3/dataforseo_labs/google/related_keywords/live); the same 40104 applies account-wide