stanford-oval/storm · error · Exception
Error: Unable to retrieve results. Status code: {response.st
Error message
Error: Unable to retrieve results. Status code: {response.status_code} What it means
VectorRM._retrieve queries the You.com web-search API and, when the HTTP response status is not 200, raises a generic Exception with the status code. This surfaces through forward() when running STORM with source='you'. The status code distinguishes causes: 401/403 bad API key, 429 rate limit, 4xx bad params, 5xx upstream outage.
Source
Thrown at knowledge_storm/rm.py:383
results = []
for response_data in response_data_list:
result = {
"title": response_data["document_title"],
"url": response_data["url"],
"snippets": [response_data["content"]],
"description": response_data.get("description", "N/A"),
"meta": {
key: value
for key, value in response_data.items()
if key not in ["document_title", "url", "content"]
},
}
results.append(result)
return results
else:
raise Exception(
f"Error: Unable to retrieve results. Status code: {response.status_code}"
)
def forward(
self, query_or_queries: Union[str, List[str]], exclude_urls: List[str] = []
):
collected_results = []
queries = (
[query_or_queries]
if isinstance(query_or_queries, str)
else query_or_queries
)
for query in queries:
try:
results = self._retrieve(query)
collected_results.extend(results)
except Exception as e:View on GitHub (pinned to fb951af774)
Solutions
- Check the status code in the message: 401/403 -> fix YDC_API_KEY; 429 -> add backoff/retries or reduce k/query_params['num']; 5xx -> retry after a delay
- Verify the key: echo $YDC_API_KEY and test a single curl request to the You.com API
- Catch the exception per-query in your pipeline so one failed search doesn't kill the whole run
- If limits persist, switch VectorRM to another source (serper, bing, etc.)
Example fix
// before
results = rm.forward([query]) # Exception: Error: Unable to retrieve results. Status code: 429
// after
from tenacity import retry, wait_exponential, stop_after_attempt
@retry(wait=wait_exponential(multiplier=2), stop=stop_after_attempt(4))
def safe_forward(rm, q):
try:
return rm.forward(q)
except Exception as e:
if '429' in str(e) or '5' in str(e).split()[-1]:
raise
return []
results = safe_forward(rm, [query]) Defensive patterns
Strategy: retry
Validate before calling
import os
if not os.getenv('YDC_API_KEY'):
raise SystemExit('Set YDC_API_KEY for the you.com retrieval source') Try / catch
import time
def search_with_retry(rm, query, attempts=4):
for i in range(attempts):
try:
return rm.forward(query)
except Exception as e:
code = str(e).rsplit(' ', 1)[-1]
if code in ('401', '403'):
raise SystemExit('Invalid YDC_API_KEY')
if i == attempts - 1:
return [] # degrade gracefully per-query
time.sleep(2 ** (i + 1))
return [] Prevention
- Validate YDC_API_KEY before starting a long STORM run
- Wrap per-query retrieval so one failed search returns [] instead of aborting the article generation
- Use exponential backoff for 429/5xx and reduce k or query_params['num'] if rate limits persist
When it happens
Trigger: Calling rm.forward(...) / a STORM pipeline run with engine='you' when the You.com API returns non-200: invalid or unset YDC_API_KEY, exhausted quota/rate limit, or transient 5xx from the service.
Common situations: Expired You.com API key or key never exported; free-tier rate limits during a long multi-query STORM run (many queries per article); transient upstream errors treated as fatal because any non-200 raises.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
- You must supply a serper_search_api_key param or set environ
- Please provide an embedding model.
- Qdrant client is not initialized.
- Collection {self.collection_name} does not exist. Please cre
- Please provide an api key.
AI-assisted analysis of stanford-oval/storm@fb951af774 (2026-08-28).
Data as JSON: /api/errors/032eca8a1681c9cf.
Report an issue: GitHub.