{"record":{"id":"56abc42883751b97","repo":"phalcon/cphalcon","slug":"the-file-name-cannot-be-opened-with-mode-mod","errorCode":null,"errorMessage":"The file '{name}' cannot be opened with mode '{mode}'","messagePattern":"The file '(.+?)' cannot be opened with mode '(.+?)'","errorType":"exception","errorClass":"Phalcon\\Logger\\Adapter\\Exceptions\\FileOpenFailed","httpStatus":null,"severity":"error","filePath":"phalcon/Logger/Adapter/Stream.zep","lineNumber":117,"sourceCode":"    public function getName() -> string\n    {\n        return this->name;\n    }\n\n    /**\n     * Processes the message i.e. writes it to the file\n     */\n    public function process(<Item> item) -> void\n    {\n        var fileHandler, message;\n\n        if (!is_resource(this->handler)) {\n            let fileHandler = this->phpFopen(this->name, this->mode);\n\n            if (!is_resource(fileHandler)) {\n                let this->handler = null;\n\n                throw new FileOpenFailed(this->name, this->mode);\n            }\n\n            let this->handler = fileHandler;\n        }\n\n        let message = this->getFormattedItem(item) . PHP_EOL;\n        this->phpFwrite(this->handler, message);\n    }\n}\n","sourceCodeStart":99,"sourceCodeEnd":127,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Logger/Adapter/Stream.zep#L99-L127","documentation":"Thrown by Stream adapter::process when phpFopen on the log file with the configured mode fails (returns no resource), typically due to bad path or insufficient permissions. Check the file path's existence and write permissions, and the open mode.","triggerScenarios":"Thrown at phalcon/Logger/Adapter/Stream.zep:117 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check directory existence and write permissions for the PHP process","Verify the path is valid (and reachable, for remote stream wrappers)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","contentChangedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}