Skip to content

Circular call to script handler 'post-file-download' detected #9846

@phenaproxima

Description

@phenaproxima

I have an under-development plugin to marry Composer to PHP-TUF: https://github.com/php-tuf/composer-integration.

Right now, it works nicely in a little local sandbox project I've got set up. However, there's an error that gets raised when requiring a project and downloading dependencies:

Failed to download vendor/package from dist: Circular call to script handler 'post-file-download' detected
    Now trying to download from source

What does this mean? Why is Composer producing this error? My plugin is not, as far as I know, calling anything in a circular fashion -- it's all very straightforward. The event handlers are located in https://github.com/php-tuf/composer-integration/blob/main/src/Plugin.php.

As far as I can tell, the exception is raised by EventDispatcher::pushEvent() if it is already handling an event with the same name. But how does this square with the idea of downloading multiple files at once, which might trigger post-file-download events? Composer does plenty of async file downloading. Is there anything I can do to prevent or mitigate these scary-looking exceptions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions