Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-12368

Updating database fails in upgrade from 3.0 when trying twice without purging the cache

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-RC4, 3.1.0-RC5
    • Fix Version/s: 3.1.4-RC1
    • Component/s: None
    • Labels:
      None

      Description

      General Error
      SQL ERROR [ mysqli ]

      Incorrect integer value: 'avatar.driver.upload' for column 'user_avatar_type' at row 2 [1366]

      SQL

      UPDATE phpbb_users SET user_avatar_type = 'avatar.driver.upload' WHERE user_avatar_type = '1'

      BACKTRACE

      FILE: (not given by php)
      LINE: (not given by php)
      CALL: msg_handler()

      FILE: [ROOT]/phpbb/db/driver/driver.php
      LINE: 803
      CALL: trigger_error()

      FILE: [ROOT]/phpbb/db/driver/mysqli.php
      LINE: 181
      CALL: phpbb\db\driver\driver->sql_error()

      FILE: [ROOT]/phpbb/db/migration/data/v310/avatar_types.php
      LINE: 46
      CALL: phpbb\db\driver\mysqli->sql_query()

      FILE: (not given by php)
      LINE: (not given by php)
      CALL: phpbb\db\migration\data\v310\avatar_types->update_user_avatar_type()

      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 455
      CALL: call_user_func_array()

      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 401
      CALL: phpbb\db\migrator->run_step()

      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 250
      CALL: phpbb\db\migrator->process_data_step()

      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 202
      CALL: phpbb\db\migrator->try_apply()

      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 202
      CALL: phpbb\db\migrator->try_apply()

      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 202
      CALL: phpbb\db\migrator->try_apply()

      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 153
      CALL: phpbb\db\migrator->try_apply()

      FILE: [ROOT]/install/database_update.php
      LINE: 222
      CALL: phpbb\db\migrator->update()

      http://img819.imageshack.us/img819/8933/tzn0.png

        Activity

        Hide
        Marc Marc added a comment -

        This shouldn't happen. The migration avatar_types depends on the avatars migration. That should take care of the schema changes including changing the column type of user_avatar_type to VCHAR.

        Show
        Marc Marc added a comment - This shouldn't happen. The migration avatar_types depends on the avatars migration. That should take care of the schema changes including changing the column type of user_avatar_type to VCHAR.
        Hide
        nickvergessen Joas Schilling added a comment -

        Did you have any MODs installed in 3.0?

        Show
        nickvergessen Joas Schilling added a comment - Did you have any MODs installed in 3.0?
        Hide
        nextgen Melvin García added a comment - - edited

        Yes @Joas Schilling, Now I have uninstalled the MODS and I've cleaned the database to see if it works now.

        The migration is now complete, I uninstalled the MODS and the migration worked perfectly.

        Show
        nextgen Melvin García added a comment - - edited Yes @Joas Schilling, Now I have uninstalled the MODS and I've cleaned the database to see if it works now. The migration is now complete, I uninstalled the MODS and the migration worked perfectly.
        Hide
        nickvergessen Joas Schilling added a comment -

        Melvin García is there a Gravatar MOD or something that caused this? If so we should try to make the update smooth with it being updated correctly

        Show
        nickvergessen Joas Schilling added a comment - Melvin García is there a Gravatar MOD or something that caused this? If so we should try to make the update smooth with it being updated correctly
        Hide
        nextgen Melvin García added a comment - - edited

        Joas, the MODs were these

        cBB Quick MOD 1.0.2
        Customisation Database [Aka] Titania
        Contact Board Administration
        moderator_needed_1_0_5

        Show
        nextgen Melvin García added a comment - - edited Joas, the MODs were these cBB Quick MOD 1.0.2 Customisation Database [Aka] Titania Contact Board Administration moderator_needed_1_0_5
        Hide
        Marshalrusty Yuriy Rusko added a comment -

        Ran into the same issue.

        <Nicofuma> but try to add '$this->cache->purge();' in phpbb\console\command\db\migrate.php after '$this->migrator->create_migrations_table();' in the execute method and then run the migration again

        The above took care of it.

        Show
        Marshalrusty Yuriy Rusko added a comment - Ran into the same issue. <Nicofuma> but try to add '$this->cache->purge();' in phpbb\console\command\db\migrate.php after '$this->migrator->create_migrations_table();' in the execute method and then run the migration again The above took care of it.
        Hide
        naderman Nils Adermann added a comment -

        The fix does not actually work properly. A simple cache purge in the migrator happens after data is already loaded from cache. So we need to reset the config after that. More preferably we set the cache driver to null on any CLI process / web request that uses the migrator, and then manually run a purge on the cache driver normally used afterwards, as our cache purge calls will otherwise become ineffective on the null cache.

        Show
        naderman Nils Adermann added a comment - The fix does not actually work properly. A simple cache purge in the migrator happens after data is already loaded from cache. So we need to reset the config after that. More preferably we set the cache driver to null on any CLI process / web request that uses the migrator, and then manually run a purge on the cache driver normally used afterwards, as our cache purge calls will otherwise become ineffective on the null cache.

          People

          • Assignee:
            Marc Marc
            Reporter:
            nextgen Melvin García
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development