Problem/Motivation
The website encountered an unexpected error. Please try again later.
Drupal\Core\File\Exception\InvalidStreamWrapperException: in Drupal\Core\File\FileUrlGenerator->doGenerateString() (line 106 of core/lib/Drupal/Core/File/FileUrlGenerator.php).
Drupal\Core\File\FileUrlGenerator->generateAbsoluteString('private://feeds/log/1162/source/http_fetcher_CckOea') (Line: 32)
Drupal\feeds_log\Plugin\Field\FieldFormatter\FileUriLinkFormatter->viewElements(Object, 'en') (Line: 89)
Steps to reproduce
The log module stores the logs in files and it doesn't check to see if the files exist and are readable before trying to load them which is a fatal error. So, if one of the files is ever missing or damaged, the interface no longer loads.
Proposed resolution
Check that a log file is valid before trying to stream wrap it.
Remaining tasks
Write patch.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3412146.patch | 1.22 KB | sidharth_soman |
Issue fork feeds-3412146
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
sidharth_soman commentedI've introduced a try-catch block to make sure execution doesn't stop. I'm not sure how viable it would be to check if a file is valid or exists before wrapping it... since you need the URI in the first place to check if the file exists. Correct me if I'm wrong about this.
Comment #3
greg boggsYou still have an item object, so item is not empty.
Looks like this is a core bug:
https://www.drupal.org/project/drupal/issues/3269813
Comment #7
megachrizI can reproduce the issue after I disable the private file system on a site (by commenting out
$settings['file_private_path']in settings.php). So therefore I think it is worth to fix this in Feeds.The tests only MR should fail tests.
The fix is similar to that of the patch in #2, the difference is that the url will be rendered as plain text if generating it as link failed.
Comment #8
greg boggsMR looks good.
Comment #10
megachrizI finally merged this one!