Skip to content

Wrongly thrown exception with new RemoveService::file() logic due to missing existance check #468

Description

@stepo2

Since the newest version we occasionally get this Exception in our logs

Could not remove file /redacted/path/in/ext_sfc/cache/directory/index.php

This was introduced with this commit: 8c9ee23

The problem here is that is_writable returns false if the file is already not existing: https://www.php.net/manual/en/function.is-writable.php

Returns true if the filename exists and is writable.

In our case the exception is thrown when the file for some reason already was not existing beforehand.

As you state in your commit yourself

don't care what removed file, as long as it's gone

So, the check before throwing should probably rather be

file_exists($absoluteFileName) && !@is_writable($absoulteFileName)

To not create dummy-exceptions.

The logic itself works, I am not entirely sure what user-interactions causes this. Maybe a race-condition between two requests. The exception pops up every few days in a large environment with lots of editors and FE requests.

It's on TYPO3 14, btw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions