phalcon/cphalcon · warning · Phalcon\Acl\Exceptions\AccessRuleNotFound

Access '{accessName}' does not exist in component '{componen

Error message

Access '{accessName}' does not exist in component '{componentName}'

What it means

AbstractProducer::setTimeToLive() throws TimeToLiveNotSupportedException when a non-null TTL is requested. The base implementation accepts only null; transports that can expire messages automatically override the method. This keeps ProducerInterface fluent chaining safe: the unsupported call aborts instead of silently ignoring your expiry.

Source

Thrown at phalcon/Acl/Adapter/Memory.zep:767

    /**
     * Checks if a role has access to a component
     */
    private function allowOrDeny(string roleName, string componentName, var access, var action, var func = null) -> void
    {
        var accessList, accessName, accessKey;

        this->checkExists(this->roles, roleName, "Role");
        this->checkExists(this->componentsNames, componentName, "Component");

        let accessList = this->accessList;

        if typeof access == "array" {
            for accessName in access {
                let accessKey = this->buildAccessKey(componentName, accessName);

                if unlikely !isset accessList[accessKey] {
                        throw new AccessRuleNotFound(accessName, componentName);
                    }
            }

            for accessName in access {
                let accessKey = this->buildKey(roleName, componentName, accessName);
                let this->access[accessKey] = action;

                if func != null {
                    let this->functions[accessKey] = func;
                }
            }
        } else {
            if access != "*" {
                let accessKey = this->buildAccessKey(componentName, access);

                if unlikely !isset accessList[accessKey] {
                    throw new AccessRuleNotFound(access, componentName);
                }

View on GitHub (pinned to b7419de9cd)

Solutions

  1. Drop the setTimeToLive() call for this transport, or pass null.
  2. If message expiry is required, move it to a transport that supports TTL, or implement expiry yourself (e.g. a timestamp field checked by consumers).
  3. Verify the concrete producer class actually overrides setTimeToLive() before setting a value.

Example fix

// before
$producer->setTimeToLive(3600); // throws TimeToLiveNotSupportedException

// after
$producer->send($destination, $message);
// or encode expiry in the payload and let the consumer discard stale jobs:
$message->setBody(json_encode(['payload' => $data, 'expiresAt' => time() + 3600]));
Defensive patterns

Strategy: try-catch

Try / catch

try {
    $producer->setTimeToLive($ttl);
} catch (\Phalcon\Queue\Exceptions\TimeToLiveNotSupportedException $e) {
    // encode expiry in the payload instead and let consumers discard stale jobs
    $message->setBody(json_encode(['payload' => $body, 'expiresAt' => time() + $ttl]));
}

Prevention

When it happens

Trigger: $producer->setTimeToLive(3600) on a producer inheriting AbstractProducer's default (e.g. Beanstalk/Redis queue adapters here).

Common situations: Code written against a TTL-capable broker (SQS DelaySeconds/MessageRetentionPeriod, RabbitMQ per-message TTL) reused unchanged; job-dispatch wrappers that always set a TTL; cleanup jobs assuming auto-expiry of unprocessed messages.

Related errors


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/a041092a3e690706. Report an issue: GitHub.