Problem/Motivation

In the original issue (2915322), the first poster notes that file_exists() doesn't work on a remote server. There was a patch (#10) which partially worked, then the issue diverged, and a different patch, addressing what seems to be a different issue, was eventually committed.

The original issue was not, near as I can tell, solved.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

srjosh created an issue. See original summary.

srjosh’s picture

Attached is an extended version of the original patch mentioned in the first ticket.

cmlara’s picture

Status: Active » Needs work

first poster notes that file_exists() doesn't work on a remote server.

Unfortunately posts #6 and #7 in #2915322: Image styles: Error generating image, missing source file. are inaccurate. A file_exists does not (normally) attempt to access the file against the remote server, its all done locally. Any stream processed by the s3fs module is normally done as lookup against the s3fs_file metadata table.

We ended up mostly reverting all of the commit from #2915322 as it was causing other issues and didn't actually solve a real problem.

For the s3fs module the s3fs_file SQL table is considered authoritative of the files list in the bucket. If a file is not listed in this database table it is not considered to be in the bucket and file_exists() should return false.

Is the file for the source image you are trying to load listed in the s3fs_file table in your database? I'm going to guess that it is not and than say the question becomes why is there a file in the bucket that is not in the s3fs_file table as that is the true fault. Do you have files being uploaded through external means not through Drupal? Is the file path very long? Any reported errors showing SQL database writes may have failed (I know we could do better in 3.x on catching some write faults, looking at that in 4.x)

Any background about the install you can give me? How long its been running s3fs, etc to help me think of any other possible faults that could maybe of caused a mismatch?

The short fix is to perform a metadata refresh inside of the s3fs module and see if the issue goes away, the long term the solution would be to determine the reason for why the file is not in the s3fs_file table but is in the bucket.

cmlara’s picture

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

Changing status to postponed-nmi while awaiting feedback on questions raised in #3 regarding environment for possible causes that may lead to a root cause fix.

cmlara’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Unable to reproduce and no additional information has been provided to initial questions in #3.

Closing this issue for now, if you are able to provide more information please reopen.