{"record":{"id":"223049a0c3d3cf7b","repo":"OpenBB-finance/OpenBB","slug":"unsupported-file-format-please-use-json-or-env","errorCode":null,"errorMessage":"Unsupported file format. Please use .json or .env files.","messagePattern":"Unsupported file format\\. Please use \\.json or \\.env files\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"desktop/src/routes/api-keys.tsx","lineNumber":127,"sourceCode":"\n\t\t\t\t\t\t\t// Remove surrounding quotes if present\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(value.startsWith('\"') && value.endsWith('\"')) ||\n\t\t\t\t\t\t\t\t(value.startsWith(\"'\") && value.endsWith(\"'\"))\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tvalue = value.slice(1, -1);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tnewKeys.push({\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\trequired: false,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Unsupported file format. Please use .json or .env files.\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (newKeys.length > 0) {\n\t\t\t\tsetImportedKeys(newKeys);\n\t\t\t\tsetSelectedKeys(new Set(newKeys.map((k) => k.key)));\n\t\t\t\tsetIsImportConfirmModalOpen(true);\n\t\t\t} else {\n\t\t\t\tsetError(\"No new keys found in the imported file.\");\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.error(\"Error parsing file:\", err);\n\t\t\tsetError(\n\t\t\t\t`Error parsing file: ${err instanceof Error ? err.message : String(err)}`,\n\t\t\t);\n\t\t}\n\t};","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/desktop/src/routes/api-keys.tsx#L109-L145","documentation":"Raised by the Intrinio Market Snapshots fetcher when the Intrinio 'securities/snapshots' endpoint returns a JSON body containing an 'error' key instead of the expected 'snapshots' list. The message text is forwarded verbatim from Intrinio's response ('error' and 'message' fields), so the upstream API diagnosed the request as invalid. This is OpenBB's way of surfacing an upstream API failure rather than silently returning no data.","triggerScenarios":"Calling `equity.market_snapshots(provider='intrinio')` (optionally with a `date` param) when GET https://api-v2.intrinio.com/securities/snapshots?api_key=...&at_datetime=... responds with an error JSON. Typical upstream causes: missing/empty/invalid `intrinio_api_key` (api_key='' is literally interpolated into the URL when credentials are absent), an API key without the required Intrinio real-time/security-master entitlement, or a malformed `at_datetime` value produced by transform_query (line 128-134 mangles '+' into '-').","commonSituations":"Missing INTRINIO_API_KEY environment variable or OpenBB credential ('intrinio_api_key' not set), a free-tier key that lacks snapshots access, expired/rotated API key, passing a date string that survives pydantic validation but is rejected by Intrinio, or running behind a proxy that returns a JSON error body.","solutions":["Verify the Intrinio credential is set: `openbb.credentials.intrinio_api_key = '...'` (or env var INTRINIO_API_KEY), then retry — an empty key is sent as `api_key=` when credentials are None.","Test the key directly against the API: curl 'https://api-v2.intrinio.com/securities/snapshots?api_key=YOUR_KEY' and confirm the response contains 'snapshots' rather than an error object.","Confirm your Intrinio subscription includes the Security Snapshots endpoint; upgrade or switch provider (e.g. yfinance) if it does not.","If passing a date, use an explicit ISO datetime like '2024-03-08T12:15:00-0500'; historical coverage only goes back to mid-June 2022 per the field description.","Read the forwarded 'Error: ... Message: ...' text — it is Intrinio's own diagnosis (e.g. 'Invalid API Key', 'Access Denied') and points at the exact fix."],"exampleFix":"# before\nobb.user.credentials.intrinio_api_key = None  # or unset\nres = obb.equity.market_snapshots(provider='intrinio')  # -> Error: ..., Message: ...\n\n# after\nobb.user.credentials.intrinio_api_key = os.environ['INTRINIO_API_KEY']\nres = obb.equity.market_snapshots(provider='intrinio')","handlingStrategy":"try-catch","validationCode":"import obb\nfrom openbb_core.app.model.abstract.error import OpenBBError\n\n# Validate credentials exist before calling the API\ncreds = obb.user.credentials\nif not getattr(creds, 'intrinio_api_key', None):\n    raise ValueError('intrinio_api_key is not set - call obb.user.credentials.intrinio_api_key = ... first')","typeGuard":"def is_intrinio_api_error(exc: Exception) -> bool:\n    \"\"\"True when OpenBB forwarded an upstream Intrinio API error.\"\"\"\n    return isinstance(exc, OpenBBError) and str(exc).startswith('Error:') and 'Message:' in str(exc)","tryCatchPattern":"from openbb_core.app.model.abstract.error import OpenBBError\n\ntry:\n    res = obb.equity.market_snapshots(provider='intrinio')\nexcept OpenBBError as e:\n    msg = str(e)\n    if 'Invalid API Key' in msg or 'Access' in msg:\n        # credential problem - fix key/subscription, do not retry\n        raise\n    # other upstream errors may be transient\n    raise","preventionTips":["Set intrinio_api_key via obb.user.credentials or the INTRINIO_API_KEY env var before any intrinio provider call.","Smoke-test the key with curl against api-v2.intrinio.com/securities/snapshots when credentials rotate.","Verify the Intrinio plan includes the Security Snapshots entitlement before building on this endpoint.","Pass dates as full ISO datetimes with explicit UTC offset to avoid malformed at_datetime values."],"tags":["openbb","intrinio","api-key","authentication","python"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}