Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With the latest dev of this module and latest stable of s3fs I get 500 errors for every page when enabling this module.
I get warnings and errors like:
Rename 2 failed. Current: public://advagg_file_DHdigz Target: public://advagg_css/advagg_file_DHdigz
and
File public://advagg_file_by1zyP could not be copied because it does not exist.
and
Warning: touch(): S3fsStreamWrapper::stream_metadata is not implemented! in advagg_save_data() (line 1307 of /sites/all/modules/contrib/advagg/advagg.missing.inc).
Comment | File | Size | Author |
---|---|---|---|
#10 | advagg-2843510-10-use-own-temp-file-creation.patch | 5.55 KB | mikeytown2 |
#6 | advagg-2843510-6-no-touch.patch | 1.43 KB | mikeytown2 |
Comments
Comment #2
jimmyko CreditAttribution: jimmyko as a volunteer commentedComment #3
jimmyko CreditAttribution: jimmyko as a volunteer commentedI can confirm this bug as I reported in #2721469-43: AdvAgg & s3fs: rename and temp dir issues..
For the missing implementation of stream_metadata(), it is another bug from s3fs. Please see #2826372: AdvAgg - S3fsStreamWrapper::stream_metadata is not implemented.
Comment #4
jimmyko CreditAttribution: jimmyko as a volunteer commentedAccording to my understanding, it seems the temporary file was created at temporary directory but not the location specify at $dir.
$temporary_file = @drupal_tempnam($dir, 'advagg_file_');
In my installation, `$dir` stored value `public://advagg_js/` but the temp files is created at '/tmp/' but not in S3 bucket.
When it go through `advagg_rename()`, the $source is always empty and its real path can never be found.
Comment #5
jimmyko CreditAttribution: jimmyko as a volunteer commentedI move its priority to major since s3fs is wisely used in large-scale site.
Comment #6
mikeytown2 CreditAttribution: mikeytown2 commentedSo first step is to not use touch, correct?
Comment #7
mikeytown2 CreditAttribution: mikeytown2 commentedSecond step is to get rid of all the workarounds for the limitations of drupal_tempnam and just implement my own version as it shouldn't cause as many issues.
Comment #9
mikeytown2 CreditAttribution: mikeytown2 commentedComment #10
mikeytown2 CreditAttribution: mikeytown2 commentedI'll need feedback on if this change works. Thinking this will do the trick.
Comment #12
mikeytown2 CreditAttribution: mikeytown2 commentedShould be fixed.
Comment #13
jimmyko CreditAttribution: jimmyko as a volunteer commentedI think the last patch is going to the right track. I would like to remove the tedious conditions by replacing a custom file touch function too. But I didn't because I can't fully understand those long code B).
I will test it today. Thanks again.
Comment #14
jimmyko CreditAttribution: jimmyko as a volunteer commentedI would like to say it works perfectly! Thanks @mikeytown2