{"record":{"id":"53b0a5a580a0be44","repo":"phalcon/cphalcon","slug":"object-passed-as-componentname-must-implement-phal","errorCode":null,"errorMessage":"Object passed as componentName must implement Phalcon\\Acl\\ComponentAwareInterface or Phalcon\\Acl\\ComponentInterface","messagePattern":"Object passed as componentName must implement Phalcon\\\\Acl\\\\ComponentAwareInterface or Phalcon\\\\Acl\\\\ComponentInterface","errorType":"exception","errorClass":"Phalcon\\Acl\\Exceptions\\InvalidComponentImplementation","httpStatus":null,"severity":"error","filePath":"phalcon/Acl/Adapter/Memory.zep","lineNumber":1113,"sourceCode":"            access . \"' for '\" . componentName . \"'.\"\n        );\n    }\n\n    /**\n     * Resolves a component identifier (object or string) to its name\n     */\n    private function toComponentName(var component)\n    {\n        if typeof component === \"object\" {\n            if component instanceof ComponentAwareInterface {\n                return component->getComponentName();\n            }\n\n            if component instanceof ComponentInterface {\n                return component->getName();\n            }\n\n            throw new InvalidComponentImplementation();\n        }\n\n        return component;\n    }\n\n    /**\n     * Resolves a role identifier (object or string) to its name\n     */\n    private function toRoleName(var role)\n    {\n        if typeof role === \"object\" {\n            if role instanceof RoleAwareInterface {\n                return role->getRoleName();\n            }\n\n            if role instanceof RoleInterface {\n                return role->getName();\n            }","sourceCodeStart":1095,"sourceCodeEnd":1131,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Acl/Adapter/Memory.zep#L1095-L1131","documentation":"BeanstalkConnection maps beanstalkd's 'BAD_FORMAT' reply to an exception: the command line sent to the server violated the protocol grammar. The client formats commands internally, so the realistic trigger is invalid arguments injected into a command — most commonly tube names containing characters outside the byte range beanstalkd allows for tube names.","triggerScenarios":"Calling watch()/use()-style operations (or any command whose args you supply) with a tube name containing spaces or special characters, e.g. 'my tube!', so the rendered command line fails the server's parser.","commonSituations":"User- or config-supplied tube names; dynamically composed names from slugs that kept forbidden characters; copying tube names from other systems with different naming rules.","solutions":["Restrict tube names to safe characters — practically [A-Za-z0-9._+-] with no spaces.","Sanitize dynamic names before use: preg_replace('/[^A-Za-z0-9._+-]/', '', $name).","If all arguments are known-good, treat BAD_FORMAT as a desync symptom: recreate the connection."],"exampleFix":"// before\n$queue->watch('incoming orders'); // space breaks the command line -> BAD_FORMAT\n\n// after\n$tube = preg_replace('/[^A-Za-z0-9._+-]/', '-', 'incoming orders'); // 'incoming-orders'\n$queue->watch($tube);","handlingStrategy":"validation","validationCode":"function sanitizeTubeName(string $name): string\n{\n    $safe = preg_replace('/[^A-Za-z0-9._+-]/', '-', $name);\n    if ($safe === '') {\n        throw new \\InvalidArgumentException('Tube name cannot be empty');\n    }\n    return $safe;\n}\n\n$queue->watch(sanitizeTubeName($userSuppliedTube));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate tube names against [A-Za-z0-9._+-] before any queue call.","Never interpolate raw user input into tube names or job arguments."],"tags":["queue","beanstalk","protocol","validation"],"backgroundTag":"protocol-command-format-error","analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}