craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.28k stars 635 forks source link

4.0 migration error #10547

Open lindseydiloreto opened 2 years ago

lindseydiloreto commented 2 years ago

Description

When updating from Craft 3.7.32 to Craft 4.0.x-dev (on a brand new site), it triggered an error message during craft up...

*** applying m211201_131000_filesystems
    > add column fs string AFTER `type` to table {{%volumes}} ... done (time: 0.029s)
    > update in {{%volumes}} ... done (time: 0.009s)
    > alter column fs in table {{%volumes}} to string NOT NULL ... done (time: 0.030s)
Exception: foreach() argument must be of type array|object, null given (/app/.../vendor/craftcms/cms/src/migrations/m211201_131000_filesystems.php:44)
#0 {main}
*** failed to apply m211201_131000_filesystems (time: 0.083s)

Which seems to point to this line...

https://github.com/craftcms/cms/blob/4.0/src/migrations/m211201_131000_filesystems.php#L44

Steps to reproduce

  1. Update from Craft 3.7.32 to Craft 4.0.x-dev
  2. Run craft up
  3. Witness error

Additional info

lindseydiloreto commented 2 years ago

Can confirm, this happened when no Volumes had yet been created.

I rolled back to 3.7, created a Volume, and tried to update again. Everything went smoothly the second time. 👍

brandonkelly commented 2 years ago

Thanks for reporting! Fixed now.