{
  "id": "mongodb/timeseries-bucket-closing-too-early",
  "signature": "MongoServerError: time series bucket closing too early: bucket with min time < meta.maxTime already closed",
  "signature_zh": "MongoServerError：时间序列桶过早关闭：最小时间小于meta.maxTime的桶已关闭",
  "regex": "time series bucket closing too early",
  "domain": "mongodb",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Time series bucket was closed prematurely due to a misconfigured timeField or metaField, causing data to be inserted into an already closed bucket.",
  "root_cause_type": "generic",
  "root_cause_zh": "由于timeField或metaField配置错误，时间序列桶被过早关闭，导致数据被插入到已关闭的桶中。",
  "versions": [
    {
      "version": "mongodb 7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "mongodb 6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The same misconfiguration will cause the error again.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The error is about closing logic, not span; incorrect metaField is the root cause.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Correct the timeField and metaField in the collection schema: db.createCollection('sensor_data', { timeseries: { timeField: 'timestamp', metaField: 'sensor_id', granularity: 'seconds' } })",
      "success_rate": 0.9,
      "how": "Correct the timeField and metaField in the collection schema: db.createCollection('sensor_data', { timeseries: { timeField: 'timestamp', metaField: 'sensor_id', granularity: 'seconds' } })",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a bucket granularity that matches data frequency (e.g., 'hours' for hourly data) to prevent premature closing.",
      "success_rate": 0.8,
      "how": "Use a bucket granularity that matches data frequency (e.g., 'hours' for hourly data) to prevent premature closing.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "修正集合架构中的timeField和metaField：db.createCollection('sensor_data', { timeseries: { timeField: 'timestamp', metaField: 'sensor_id', granularity: 'seconds' } })",
    "使用与数据频率匹配的桶粒度（例如，对于每小时数据使用'hours'）以防止过早关闭。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.mongodb.com/docs/manual/core/timeseries-collections/#bucket-closing",
  "official_doc_section": null,
  "error_code": "546",
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-11-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}