{"record":{"id":"2e31ba9ac3117932","repo":"phalcon/cphalcon","slug":"elementname-element-does-not-exist-in-the-s","errorCode":null,"errorMessage":"{elementName} '{element}' does not exist in the {suffix}","messagePattern":"(.+?) '(.+?)' does not exist in the (.+?)","errorType":"exception","errorClass":"Phalcon\\Acl\\Exceptions\\ElementNotFound","httpStatus":null,"severity":"error","filePath":"phalcon/Acl/Adapter/Memory.zep","lineNumber":950,"sourceCode":"        return false;\n    }\n\n    /**\n     * @param array  $collection\n     * @param string $element\n     * @param string $elementName\n     * @param string $suffix\n     *\n     * @throws ElementNotFound\n     */\n    private function checkExists(\n        array collection,\n        string element,\n        string elementName,\n        string suffix = \"ACL\"\n    ) -> void {\n        if (true !== isset(collection[element])) {\n            throw new ElementNotFound(\n                elementName . \" '\" . element .\n                \"' does not exist in the \" . suffix\n            );\n        }\n    }\n\n    /**\n     * Invokes a callable rule, binding the role/component/user objects to the\n     * closure parameters by type and enforcing its arity.\n     */\n    private function invokeRule(\n        var funcAccess,\n        int haveAccess,\n        var parameters,\n        var roleObject,\n        var componentObject,\n        string roleName,\n        string componentName,","sourceCodeStart":932,"sourceCodeEnd":968,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Acl/Adapter/Memory.zep#L932-L968","documentation":"During a length-prefixed read on the beanstalk socket, BeanstalkConnection checks stream_get_meta_data(connection)['timed_out']; if the socket read timed out, it throws Exception('Connection timed out'). The TCP connection is alive but beanstalkd did not deliver the expected bytes in time — a hung server, network stall, or an idle reserve-style wait exceeding the socket timeout.","triggerScenarios":"Reading a job body or status line when beanstalkd stalls mid-response; long reserve-with-timeout waits on a lagging or overloaded server; mobile/unstable networks between app and queue host; the socket being shared after a fork.","commonSituations":"Beanstalkd under heavy load or wedged; network packet loss between app and queue; workers that fork children reusing the same connection resource; timeouts surfaced during deploy/network maintenance.","solutions":["Catch the exception, disconnect(), and reconnect+retry the operation — the stream may be out of sync after a timeout.","Check beanstalkd health and load (stats command, CPU, ready-set size) and restart it if wedged.","Verify network stability/latency between the app host and the queue host.","Never share one connection across forked processes; give each worker its own connection."],"exampleFix":"// before\n$status = $connection->reserveJob(10); // may throw 'Connection timed out'\n\n// after\ntry {\n    $job = $connection->reserveJob(10);\n} catch (\\Phalcon\\Queue\\Exceptions\\Exception $e) {\n    if ($e->getMessage() === 'Connection timed out') {\n        $connection->disconnect();\n        $connection->connect();\n        $job = $connection->reserveJob(10); // one guarded retry\n    } else {\n        throw $e;\n    }\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    $job = $connection->reserveJob($timeout);\n} catch (\\Phalcon\\Queue\\Exceptions\\Exception $e) {\n    if ($e->getMessage() === 'Connection timed out') {\n        $connection->disconnect();   // stream may be desynced\n        $connection->connect();      // reconnect...\n        $job = $connection->reserveJob($timeout); // ...and retry once\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Always reconnect after a socket timeout — never continue reading the same stream.","Give each forked worker its own connection; never share socket resources across processes.","Monitor beanstalkd load and network latency between app and queue hosts."],"tags":["queue","beanstalk","timeout","network","socket"],"backgroundTag":"socket-read-timeout","analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}