You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ChatGPT import fails with KeyError 'create_time' on conversations missing that field #1276
Importing ChatGPT conversations fails with Failed to import ChatGPT conversations: 'create_time' (a KeyError). Some conversations in current ChatGPT export archives lack a create_time field (or carry null), and the importer indexes the key unconditionally. In Basic Memory Cloud this surfaces as Import API returned 500 and the import job fails.
Evidence (from Basic Memory Cloud production)
Cloud Logfire issue: #1968, 3 occurrences 2026-08-14 to 2026-08-17
Error path: cloud import_runtime.import_json_via_asgi receives HTTP 500 from the import API with detail Failed to import ChatGPT conversations: 'create_time'.
An earlier occurrence (2026-08-14) failed on JSON the user supplied (Expecting property name enclosed in double quotes), which is a separate malformed-input case grouped under the same fingerprint; this issue is about the create_time KeyError on well-formed exports.
RCA
Trigger: user imports a real ChatGPT export where at least one conversation has no usable create_time.
Root cause: the ChatGPT importer treats create_time as always present. OpenAI's export format does not guarantee it for every conversation object.
Impact: the whole import fails with a 500; the user gets none of their conversations.
Recovery: none; retrying the same archive fails identically.
Fix scope
Tolerate missing/null create_time (fall back to update_time, first message time, or epoch) and continue importing the remaining conversations; report per-conversation skips rather than failing the archive.
While in there: return a 4xx with a clear message for undecodable JSON instead of a 500.
Regression tests: conversation without create_time; conversation with create_time: null; malformed JSON archive.
Acceptance criteria
A ChatGPT export containing conversations without create_time imports successfully.
Cloud Logfire issue 1968 stops recurring for this cause.
Type: Bug Component: CLI/import (src/basic_memory/importers/chatgpt_importer.py) — surfaced via Cloud import API, but the defect is in the shared core importer, not Cloud-specific logic Priority: High — any ChatGPT export containing a conversation without create_time fails the entire import with a 500, and there's no workaround (retrying fails identically) Complexity: Medium — requires a fallback timestamp strategy, per-conversation error isolation (skip-and-continue instead of abort-all), and a 4xx path for malformed JSON, plus regression tests for each case
Analysis:
Confirmed in code — chatgpt_importer.py indexes create_time unconditionally in three places:
message formatting (line 179) already guards with .get("create_time"), so only the conversation-level reads are unguarded
Since these reads happen inside the per-conversation loop but the try/except wraps the entireimport_data call, one conversation missing create_time currently aborts the whole archive rather than being skipped — consistent with the issue's reported impact.
No duplicate issue found (searched for related ChatGPT import bugs — #451 null titles and #234 recursion error are related but distinct, already closed).
Activity
claude commentedon Aug 18, 2026
Claude finished @phernandez's task in 29s —— View job
Triage
Type: Bug
Component: CLI/import (
src/basic_memory/importers/chatgpt_importer.py) — surfaced via Cloud import API, but the defect is in the shared core importer, not Cloud-specific logicPriority: High — any ChatGPT export containing a conversation without
create_timefails the entire import with a 500, and there's no workaround (retrying fails identically)Complexity: Medium — requires a fallback timestamp strategy, per-conversation error isolation (skip-and-continue instead of abort-all), and a 4xx path for malformed JSON, plus regression tests for each case
Analysis:
Confirmed in code —
chatgpt_importer.pyindexescreate_timeunconditionally in three places:import_data(line 56):created_at = chat["create_time"]_format_chat_content(line 109):created_at = conversation["create_time"].get("create_time"), so only the conversation-level reads are unguardedSince these reads happen inside the per-conversation loop but the
try/exceptwraps the entireimport_datacall, one conversation missingcreate_timecurrently aborts the whole archive rather than being skipped — consistent with the issue's reported impact.No duplicate issue found (searched for related ChatGPT import bugs — #451 null titles and #234 recursion error are related but distinct, already closed).
Labels applied:
bug.fix(cli): import ChatGPT conversations that have no title (#1790)