phalcon/cphalcon · error · Phalcon\Di\Exceptions\ServiceCannotBeResolved

Service '{name}' cannot be resolved

Error message

Service '{name}' cannot be resolved

What it means

Error "Service '{name}' cannot be resolved" thrown in phalcon/cphalcon.

Source

Thrown at phalcon/Di/Di.zep:220

         */
        if this->eventsManager !== null {
            let instance = this->eventsManager->fire(
                "di:beforeServiceResolve",
                this,
                [
                    "name":       name,
                    "parameters": parameters
                ]
            );
        }

        if instance === null {
            if service !== null {
                // The service is registered in the DI.
                try {
                    let instance = service->resolve(parameters, this);
                } catch ServiceResolutionException {
                    throw new ServiceCannotBeResolved(name);
                }

                // If the service is shared then we'll cache the instance.
                if isShared {
                    let this->sharedInstances[name] = instance;
                }
            } else {
                /**
                 * The DI also acts as builder for any class even if it isn't
                 * defined in the DI
                 */
                if unlikely !class_exists(name) {
                    throw Exception::serviceNotFound(name);
                }

                if typeof parameters == "array" && !empty parameters {
                    let instance = create_instance_params(name, parameters);
                } else {

View on GitHub (pinned to b7419de9cd)

When it happens

Trigger: Thrown at phalcon/Di/Di.zep:220 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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