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.

CommentFileSizeAuthor
#2 3412146.patch1.22 KBsidharth_soman

Issue fork feeds-3412146

Command icon 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

Greg Boggs created an issue. See original summary.

sidharth_soman’s picture

StatusFileSize
new1.22 KB

I'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.

greg boggs’s picture

You 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

MegaChriz made their first commit to this issue’s fork.

megachriz’s picture

Status: Active » Needs review

I 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.

greg boggs’s picture

MR looks good.

  • MegaChriz committed 34268245 on 8.x-3.x
    Issue #3412146 by MegaChriz, sidharth_soman, Greg Boggs: Fixed missing...
megachriz’s picture

Status: Needs review » Fixed

I finally merged this one!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.