This issue is similar to https://www.drupal.org/project/feeds/issues/3043378, but rather than trying to fix the file size comparison, I'm only looking to suppress the errors.

Here's an example of the errors I'm seeing flooding my logs:

filesize(): stat failed for public://meetings/agendas/Executive_Board_16-05-23.pdf          [warning]

Patch attached for review.

CommentFileSizeAuthor
feeds-prevent_php_warning.patch644 bytesjenlampton

Comments

jenlampton created an issue. See original summary.

joelpittet’s picture

Status: Needs review » Postponed (maintainer needs more info)

Hey @jenlampton!

The only other module that I know actively suppresses the output of this function is advagg, most don't. Is this a streamwrapper issue for a filesystem like s3? ... or do you have more context?

jenlampton’s picture

@joelpittet No S3. For my site the files are saved on disk as usual, but the filesize() command is being run on remote files (before they are imported via feeds) and sometimes my source feed has URLs that can't be trusted. I often get 404 errors instead of documents. I would prefer my log not get flooded with errors I can't prevent. :)

megachriz’s picture

@jenlampton

the filesize() command is being run on remote files

Are you using either the option “Replace only if different” or “Rename only if different”? These options are not compatible when the file to import is remote. This is noted on the target configuration form:

Works only if the file to import is locally accessible.

So if you are indeed using one of these options, I believe they have no benefit compared to the “Replace” or “Rename” option when importing files from a remote location. In that case, your issue would also be fixed when using either the “Replace” or “Rename” option.

Or is there a situation where the filesize() function does work on remote files? In that case it would make sense to suppress the warnings.

bluegeek9’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Drupal 7 reached end of life and the D7 version of Feeds is no longer being developed. To keep the issue queue focused on supported versions, we’re closing older D7 issues.

If you still have questions about using Feeds on Drupal 7, feel free to ask. While we won’t fix D7 bugs anymore, we’re happy to offer guidance to help you move forward. You can do so by opening (or reopening) a D7 issue, or by reaching out in the #feeds channel on Drupal Slack.

If this issue is still relevant for Drupal 10+, please open a follow-up issue or merge request with proposed changes. Contributions are always welcome!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.