Image Style folders deleted in s3 bucket when migrating Drupal 8.3 to 8.9

Created on 17 August 2023, 11 months ago
Updated 8 September 2023, 10 months ago

When I run drush updb then Image Style folders deleted from S3 bucket, I am using S3fs module.

a) Upgrade Drupal from 8.3. to 8.9
b) connected code with Latest prod sanitised database
c) run drush updb
d) after successfully run, I have checked and found that my prod s3 Style images are missing. Only from this folders only.

Any one can help on it?

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ’ฌ Support request
Status

Fixed

Version

3.3

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia sunilkansodiya

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sunilkansodiya
  • Status changed to Postponed: needs info 11 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States cmlara

    A responses to this had been posted in SLACK earlier in the day before this issue was opened.
    https://drupal.slack.com/archives/C01SRAJN0FK/p1692216001835239

    Unlikely to be s3fs.

    Probaly an upgrade hook or other module instructing Drupal core to delete the files.

    S3fs just provides a file system, itโ€™s up to other modules and core to request I/O on files.

    Changing to a support request as there is no evidence at this time that this is an s3fs issue.
    Postponing on awaiting more information as we need the reporter to advise what they have checked regarding their upgrade to indicate this might be an s3fs issue.
    Priority to minor due to the issue being cross posted in multiple locations and the reporter directly contacting maintainers.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sunilkansodiya

    Thank you cmlara.

    Any one know how only Image Style is deleting when upgrading from drupal 8.3 to 8.9 ?

    I have run drush updb only and found this issue.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sunilkansodiya

    I think what happened in my case:

    Step-1: upgrade UAT env with 8.3 to 8.9
    step-2: Taken production database into new host and connect with UAT code.
    step-3 run drush updb and drus cr commands.
    step-4 in this case, some files are still into 's3fs_file' table.
    During cache clear, this table trying to find files on UAT environment /bucket and it was failed so these styles files are deleted.

    Still it is in investigation mode and trying to reproduce it. Could you please share your thoughts on it?

    Due to cross env. it happened I think

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States cmlara

    All of this sounds like 'as designed' for s3fs.

    I can't accurately comment on what your upgrade is doing, this will all depend upon your specific site and could even be as specific as what version of a module you are upgrading from (as upgrade hooks are sequential). Even if these were a Drupal Core update hook changing them D8.4+ was released so long ago that that many of us would likely not be able to remember without referring to release notes or code.

    Its highly recommended not to use a production bucket in a dev lab, and its also recommended not to use the same bucket on multiple sites because of the need to keep the s3fs_file table in sync.

    Ultimately yes you could be on the right track regarding finding/not finding files from having an incomplete dev lab, or could be having other issues.

    As noted s3fs just does what it is instructed regarding files, its up to whatever code chooses to call for deletion that would be responsible and where an issue would need to be opened if you feel the deletion is a bug.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain jansete

    I agree with cmlara, working with image styles sometimes could be difficult. If you change a image style the default behaviour is delete all the image styles previously generated and if you use a external service like s3 could be a problem.
    You can afford with some tricks, add temporary patches to core to avoid this or use queues to generated in background.
    I'm sure that it will be more strategies depends on the problem.

    Regards.

  • Status changed to Fixed 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States cmlara

    As it has been 2 weeks without additional details I'm assuming the advice previously given allowed for resolution. Marking Fixed.

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

Production build 0.69.0 2024