1

I have Magento v2.4.5-p1 and after php version upgrade to 8.1 when running the command: index:reindex i get this error for each index: flock(): supplied resource is not a valid stream resource.

Has anyone experienced this? How can I fix it?

1 Answer 1

1

I found a solution. Like this solution I have a third party extension that was causing me to get the error. Adding validation helped solve the problem.

As it was:

        @flock($pointer, LOCK_UN);
        @fclose($pointer);

My fix:

    if (is_resource($pointer) && get_resource_type($pointer) == 'stream') {
        @flock($pointer, LOCK_UN);
        @fclose($pointer);
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.