{"record":{"id":"e945722906041f12","repo":"phacility/phabricator","slug":"this-jupyter-notebook-does-not-specify-a-list-of","errorCode":null,"errorMessage":"This Jupyter notebook does not specify a list of \"cells\".","messagePattern":"This Jupyter notebook does not specify a list of \"cells\"\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/files/document/PhabricatorJupyterDocumentEngine.php","lineNumber":343,"sourceCode":"    $nbformat = idx($data, 'nbformat');\n    if ($nbformat == null || !strlen($nbformat)) {\n      throw new Exception(\n        pht(\n          'This document is missing an \"nbformat\" field. Jupyter notebooks '.\n          'must have this field.'));\n    }\n\n    if ($nbformat !== 4) {\n      throw new Exception(\n        pht(\n          'This Jupyter notebook uses an unsupported version of the file '.\n          'format (found version %s, expected version 4).',\n          $nbformat));\n    }\n\n    $cells = idx($data, 'cells');\n    if (!is_array($cells)) {\n      throw new Exception(\n        pht(\n          'This Jupyter notebook does not specify a list of \"cells\".'));\n    }\n\n    if (!$cells) {\n      throw new Exception(\n        pht(\n          'This Jupyter notebook does not specify any notebook cells.'));\n    }\n\n    if (!$for_diff) {\n      return $cells;\n    }\n\n    // If we're extracting cells to build a diff view, split code cells into\n    // individual lines and individual outputs. We want users to be able to\n    // add inline comments to each line and each output block.\n","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/document/PhabricatorJupyterDocumentEngine.php#L325-L361","documentation":"nbformat is 4, but the top-level 'cells' field is missing or is not an array (null, string, number). The engine requires 'cells' to be a PHP array because it iterates it to build the notebook table; any other shape is rejected before rendering.","triggerScenarios":"A v4 notebook JSON object with 'cells' absent, null, or a scalar — e.g. scripts that reshape notebook JSON and drop or corrupt the cells key.","commonSituations":"Programmatically generated notebooks missing the cells array; JSON round-trips through tools that renamed or replaced the key.","solutions":["Ensure the top-level object contains \"cells\" as a JSON array of cell objects","Re-export the notebook from Jupyter to regenerate a well-formed structure"],"exampleFix":"\"cells\": null\n\nafter:\n\"cells\": [\n  { \"cell_type\": \"code\", \"metadata\": {}, \"source\": [], \"outputs\": [] }\n]","handlingStrategy":"validation","validationCode":"$cells = idx($data, 'cells');\nif (!is_array($cells)) {\n  // 'cells' missing or not a list: reject before rendering\n}","typeGuard":null,"tryCatchPattern":"catch Exception and report the structural defect; ask for a re-export from Jupyter.","preventionTips":["Validate the notebook schema (nbformat + cells array) in tooling before upload"],"tags":["jupyter","missing-field","type-validation"],"backgroundTag":"invalid-jupyter-notebook","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}