{"record":{"id":"bf9b967d07c3336c","repo":"PHPOffice/PhpSpreadsheet","slug":"failed-to-copy-cells-in-cache","errorCode":null,"errorMessage":"Failed to copy cells in cache","messagePattern":"Failed to copy cells in cache","errorType":"exception","errorClass":"PhpOffice\\PhpSpreadsheet\\Exception","httpStatus":null,"severity":"error","filePath":"src/PhpSpreadsheet/Collection/Cells.php","lineNumber":430,"sourceCode":"        if ($this->currentCellIsDirty && isset($this->currentCoordinate, $this->currentCell)) {\n            $this->currentCell->detach();\n\n            $stored = $this->cache->set($this->cachePrefix . $this->currentCoordinate, $this->currentCell);\n            if ($stored === false) {\n                $this->destructIfNeeded($this, \"Failed to store cell {$this->currentCoordinate} in cache\");\n            }\n            $this->currentCellIsDirty = false;\n        }\n\n        $this->currentCoordinate = null;\n        $this->currentCell = null;\n    }\n\n    private function destructIfNeeded(self $cells, string $message): void\n    {\n        $cells->__destruct();\n\n        throw new PhpSpreadsheetException($message);\n    }\n\n    /**\n     * Add or update a cell identified by its coordinate into the collection.\n     *\n     * @param string $cellCoordinate Coordinate of the cell to update\n     * @param Cell $cell Cell to update\n     */\n    public function add(string $cellCoordinate, Cell $cell): Cell\n    {\n        if ($cellCoordinate !== $this->currentCoordinate) {\n            $this->storeCurrentCell();\n        }\n        $column = 0;\n        $row = '';\n        sscanf($cellCoordinate, '%[A-Z]%d', $column, $row);\n        /** @var int $row */\n        $this->index[$cellCoordinate] = (--$row * AddressRange::MAX_COLUMN_INT) + Coordinate::columnIndexFromString((string) $column);","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/PHPOffice/PhpSpreadsheet/blob/65b080eef4d9fd11a5796135ab145883e5c3d6a6/src/PhpSpreadsheet/Collection/Cells.php#L412-L448","documentation":"Error \"Failed to copy cells in cache\" thrown in PHPOffice/PhpSpreadsheet.","triggerScenarios":"Thrown at src/PhpSpreadsheet/Collection/Cells.php:430 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"65b080eef4d9fd11a5796135ab145883e5c3d6a6","analyzedAt":"2026-08-17T05:40:41.646Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}