Skip to content

The service "messenger.middleware.deduplicate_middleware" has a dependency on a non-existent service "lock.factory" #60329

Closed
@lyrixx

Description

@lyrixx

Symfony version(s) affected

7.3.0

Description

I just updated my application, cleared the cache, and now when the kernel boot, I got the following error:

I have no name! /app/server/backend bin/console 

In CheckExceptionOnInvalidReferenceBehaviorPass.php line 116:
                                                                                                                                                                                           
  The service "messenger.middleware.deduplicate_middleware" has a dependency on a non-existent service "lock.factory". Did you mean one of these: "ulid.factory", "uuid.factory", "form.factory"?                                                                                                                                                                                 

The very strange thing, is we don't use the messenger.middleware.deduplicate_middleware messenger middleware

edit: see

if ($lockEnabled && class_exists(DeduplicateMiddleware::class) && class_exists(LockFactory::class)) {
$defaultMiddleware['before'][] = ['id' => 'deduplicate_middleware'];
} else {
$container->removeDefinition('messenger.middleware.deduplicate_middleware');
}

=> IMHO, this middleware should be optin! But it's another story

How to reproduce

I guess it occurs with a fresh symfony + mesenger + lock + all lock have a name different from default

Possible Solution

#60330

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions