1.2.5 -> 2.2.0 Beta 2/3 Upgrade - Unknown column 'like_users' in 'where clause'

Mouth

Well-known member
Upgrading RM v1.2.5 to v2.2.0 B2/3 and get the following error when attempting the manual upgrade via /admin.php?add-ons/XFRM/upgrade ....

XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'like_users' in 'where clause' in src/XF/Db/AbstractStatement.php at line 228
  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 39
  3. XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 54
  4. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 94
  5. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 322
  6. XF\Db\AbstractAdapter->update() in src/XF/Install/InstallHelperTrait.php at line 85
  7. XF\AddOn\AbstractSetup->tableColumnsToJson() in src/XF/Install/InstallHelperTrait.php at line 43
  8. XF\AddOn\AbstractSetup->entityColumnsToJson() in src/addons/XFRM/Setup.php at line 729
  9. XFRM\Setup->upgrade2010010Step3() in src/XF/AddOn/StepRunnerUpgradeTrait.php at line 122
  10. XFRM\Setup->upgradeStepRunner() in src/XF/AddOn/StepRunnerUpgradeTrait.php at line 71
  11. XFRM\Setup->upgrade() in src/XF/Admin/Controller/AddOn.php at line 581
  12. XF\Admin\Controller\AddOn->actionUpgrade() in src/XF/Mvc/Dispatcher.php at line 350
  13. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
  14. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
  15. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
  16. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2298
  17. XF\App->run() in src/XF.php at line 459
  18. XF::runApp() in admin.php at line 13
 
Last edited:
Solution
This in itself indicates a wider problem. You shouldn't be still getting the is_fleless error. I didn't during my upgrade from 1.2.5 to 2.2.0 Beta. Why are you? Why is your database missing that column?

Is your database missing the xf_resource.is_fileless column and the xf_resource_update.like_users column before you begin step 9?
At this point, the only possible way this is happening is if you're attempting to run the upgrade on a database which you have previously run the upgrade on.

These columns should not be missing and would not be missing while running 1.2.5 and presumably it was working fine before upgrading.

You can re-add the columns as you had to before for the other issues but they are strongly suspected not to be bugs at this stage - no one else has experienced the same issues and my testing of a similar upgrade path seems to function correctly.
 
At this point, the only possible way this is happening is if you're attempting to run the upgrade on a database which you have previously run the upgrade on.
Yes, that's correct. I had no indication/knowledge that B2 upgrade caused DB corruption issues that B3 couldn't/wouldn't address.
These columns should not be missing and would not be missing while running 1.2.5 and presumably it was working fine before upgrading.

You can re-add the columns as you had to before for the other issues but they are strongly suspected not to be bugs at this stage
Which table should I be adding it to?

v1.2.5 doesn't have a 'like_users' column in 'xf_resource' table.

v1.2.5 has a 'like_users' (also 'likes') column in 'xf_resource_update', but v2.2.0's 'xf_rm_resource_update' table doesn't have either 'likes' or 'like_users' columns. v2.2.0 appears to have 'reactions' and 'reaction_users' columns instead.

Or perhaps I should just be dropping the whole 2.2.0 DB, and starting again with complete xF upgrade, including xF add-ons?
 
Or perhaps I should just be dropping the whole 2.2.0 DB, and starting again with complete xF upgrade, including xF add-ons?
This is still a bug in 2.2.0 Beta 3 Upgrade, against a clean (no prior upgrade) v1.2.5 database.
Should not have been moved from Bugs forum.
 
v1.2.5 has a 'like_users' (also 'likes') column in 'xf_resource_update', but v2.2.0's 'xf_rm_resource_update' table doesn't have either 'likes' or 'like_users' columns. v2.2.0 appears to have 'reactions' and 'reaction_users' columns instead.
When you run an upgrade, every single upgrade step is run from the version you're upgrading from to the version you're upgrading to. The failure you're experiencing is happening while the database is being updated to 2.1.0.

2.1.0 does have a like_users column in xf_rm_resource_update but it is renamed to reaction_users at a later step. In fact your error is happening in step 3 and the column is renamed in step 4.

There is no reason the like_users column should be missing at that point.

Indeed, it isn't, in my testing. I just upgraded an XF 1.5 database to XF 2.2 Beta, I then ran the upgrade of RM 1.2.5 to 2.2 Beta and I did not encounter the error.

This isn't a bug. There is some sort of issue with your process.

Alternatively there may be an issue which is causing the progress to reset. This shouldn't happen ether. But it may be worth trying to investigate whether any errors are happening in the server software itself, such as the webserver or PHP error log.

My test was completed using the web-based installer but if you can, using the CLI may produce different results.
 
Last edited:
There is some sort of issue with your process.
  1. Disable all add-ons.
  2. Upload xF 2.2.0 B3 files to directory
  3. Run web based install to get src/config.php, upload file to src/
  4. Perform cli upgrade, php cmd.php xf:upgrade
  5. Perform emoji support, php cmd.php xf:convert-utf8mb4, and add required to src/config.php
  6. Upload xF ES 2.2.0 B3 files to directory
  7. Perform cli upgrade, php cmd.php xf:addon-upgrade XFES
  8. Rebuild search, php cmd.php xf-rebuild:search --truncate
  9. Upload xF RM 2.2.0 B3 files to directory
  10. Perform cli upgrade, php cmd.php xf:addon-upgrade XFRM
  11. Get https://xenforo.com/community/threa...nown-column-is_fileless-in-field-list.183881/ error. Alter table as per @NixFifty post
  12. Resume cli upgrade, php cmd.php xf:addon-upgrade XFRM
  13. Get error as per OP.
 
This in itself indicates a wider problem. You shouldn't be still getting the is_fleless error. I didn't during my upgrade from 1.2.5 to 2.2.0 Beta. Why are you? Why is your database missing that column?

Is your database missing the xf_resource.is_fileless column and the xf_resource_update.like_users column before you begin step 9?
 
Solution
Is your database missing the xf_resource.is_fileless column and the xf_resource_update.like_users column before you begin step 9?
No.
Here's after just having completed step 8 ....
Code:
/var/www/dev# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1193391
Server version: 5.7.30-33-log Percona Server (GPL), Release '33', Revision '6517692'

Copyright (c) 2009-2020 Percona LLC and/or its affiliates
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use dev;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> describe xf_resource;
+------------------------+---------------------------------------+------+-----+---------+----------------+
| Field                  | Type                                  | Null | Key | Default | Extra          |
+------------------------+---------------------------------------+------+-----+---------+----------------+
| resource_id            | int(10) unsigned                      | NO   | PRI | NULL    | auto_increment |
| title                  | varchar(100)                          | NO   |     |         |                |
| tag_line               | varchar(100)                          | NO   |     |         |                |
| user_id                | int(10) unsigned                      | NO   | MUL | NULL    |                |
| username               | varchar(100)                          | NO   |     |         |                |
| resource_state         | enum('visible','moderated','deleted') | NO   |     | visible |                |
| resource_date          | int(10) unsigned                      | NO   |     | NULL    |                |
| resource_category_id   | int(11)                               | NO   | MUL | NULL    |                |
| current_version_id     | int(10) unsigned                      | NO   |     | NULL    |                |
| description_update_id  | int(10) unsigned                      | NO   |     | NULL    |                |
| discussion_thread_id   | int(10) unsigned                      | NO   | MUL | NULL    |                |
| external_url           | varchar(500)                          | NO   |     |         |                |
| is_fileless            | tinyint(3) unsigned                   | NO   |     | 0       |                |
| external_purchase_url  | varchar(500)                          | NO   |     |         |                |
| price                  | decimal(10,2) unsigned                | NO   |     | 0.00    |                |
| currency               | varchar(3)                            | NO   |     |         |                |
| download_count         | int(10) unsigned                      | NO   |     | 0       |                |
| rating_count           | int(10) unsigned                      | NO   |     | 0       |                |
| rating_sum             | int(10) unsigned                      | NO   |     | 0       |                |
| rating_avg             | float unsigned                        | NO   |     | 0       |                |
| rating_weighted        | float unsigned                        | NO   | MUL | 0       |                |
| update_count           | int(10) unsigned                      | NO   |     | 0       |                |
| review_count           | int(10) unsigned                      | NO   |     | 0       |                |
| last_update            | int(10) unsigned                      | NO   | MUL | NULL    |                |
| alt_support_url        | varchar(500)                          | NO   |     |         |                |
| had_first_visible      | tinyint(3) unsigned                   | NO   |     | 0       |                |
| custom_resource_fields | mediumblob                            | NO   |     | NULL    |                |
| prefix_id              | int(10) unsigned                      | NO   | MUL | 0       |                |
| icon_date              | int(10) unsigned                      | NO   |     | 0       |                |
| tags                   | mediumblob                            | NO   |     | NULL    |                |
+------------------------+---------------------------------------+------+-----+---------+----------------+
30 rows in set (0.00 sec)

mysql> describe xf_resource_update;
+--------------------+---------------------------------------+------+-----+---------+----------------+
| Field              | Type                                  | Null | Key | Default | Extra          |
+--------------------+---------------------------------------+------+-----+---------+----------------+
| resource_update_id | int(11) unsigned                      | NO   | PRI | NULL    | auto_increment |
| resource_id        | int(11)                               | NO   | MUL | NULL    |                |
| title              | varchar(100)                          | NO   |     |         |                |
| message            | mediumtext                            | NO   |     | NULL    |                |
| message_state      | enum('visible','moderated','deleted') | NO   |     | visible |                |
| post_date          | int(10) unsigned                      | NO   |     | NULL    |                |
| attach_count       | int(10) unsigned                      | NO   |     | 0       |                |
| likes              | int(10) unsigned                      | NO   |     | 0       |                |
| like_users         | blob                                  | NO   |     | NULL    |                |
| ip_id              | int(10) unsigned                      | NO   |     | 0       |                |
| had_first_visible  | tinyint(3) unsigned                   | NO   |     | 0       |                |
| warning_id         | int(10) unsigned                      | NO   |     | 0       |                |
| warning_message    | varchar(255)                          | NO   |     |         |                |
+--------------------+---------------------------------------+------+-----+---------+----------------+
13 rows in set (0.00 sec)

mysql> exit
Bye
@server:/var/www/dev# rm -rf /tmp/1/*
@server:/var/www/dev# unzip /tmp/xf/xfresource_2.2.0-Beta-3-Unsupported_<redacted>_full.zip -d /tmp/1/
[...]
@server:/var/www/dev# cp -pr /tmp/1/upload/* ./
@server:/var/www/dev# php cmd.php xf:addon-upgrade XFRM
Upgrading XenForo Resource Manager from 1.2.5 to 2.2.0 Beta 3...
Confirm upgrade? (y/n)y
Upgrading . .
In AbstractStatement.php line 228:
                                                                               
  [XF\Db\Exception (1054)]                                                     
  MySQL statement prepare error [1054]: Unknown column 'is_fileless' in 'fiel  
  d list'                                                                      
                                                                               

Exception trace:
  at src/XF/Db/AbstractStatement.php:228
 XF\Db\AbstractStatement->getException() at src/XF/Db/Mysqli/Statement.php:196
 XF\Db\Mysqli\Statement->getException() at src/XF/Db/Mysqli/Statement.php:39
 XF\Db\Mysqli\Statement->prepare() at src/XF/Db/Mysqli/Statement.php:54
 XF\Db\Mysqli\Statement->execute() at src/XF/Db/AbstractAdapter.php:94
 XF\Db\AbstractAdapter->query() at src/XF/Install/InstallHelperTrait.php:229
 XF\AddOn\AbstractSetup->executeUpgradeQuery() at src/XF/AddOn/AbstractSetup.php:90
 XF\AddOn\AbstractSetup->query() at src/addons/XFRM/Setup.php:365
 XFRM\Setup->upgrade2000010Step3() at src/XF/AddOn/StepRunnerUpgradeTrait.php:122
 XFRM\Setup->upgradeStepRunner() at src/XF/AddOn/StepRunnerUpgradeTrait.php:71
 XFRM\Setup->upgrade() at src/XF/Cli/Command/AddOnActionTrait.php:109
 XF\Cli\Command\AddOnSubAction->performAddOnAction() at src/XF/Cli/Command/AddOnSubAction.php:79
 XF\Cli\Command\AddOnSubAction->execute() at src/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at src/vendor/symfony/console/Application.php:987
 Symfony\Component\Console\Application->doRunCommand() at src/vendor/symfony/console/Application.php:255
 Symfony\Component\Console\Application->doRun() at src/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at src/XF/Cli/Runner.php:76
 XF\Cli\Runner->run() at cmd.php:15

xf:addon-sub-action [--k K] [--] <id> <action>

/var/www/dev# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1193391
Server version: 5.7.30-33-log Percona Server (GPL), Release '33', Revision '6517692'

Copyright (c) 2009-2020 Percona LLC and/or its affiliates
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use dev;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> describe xf_rm_resource;
+-----------------------+---------------------------------------+------+-----+---------+----------------+
| Field                 | Type                                  | Null | Key | Default | Extra          |
+-----------------------+---------------------------------------+------+-----+---------+----------------+
| resource_id           | int(10) unsigned                      | NO   | PRI | NULL    | auto_increment |
| title                 | varchar(100)                          | NO   |     |         |                |
| tag_line              | varchar(100)                          | NO   |     |         |                |
| user_id               | int(10) unsigned                      | NO   | MUL | NULL    |                |
| username              | varchar(100)                          | NO   |     |         |                |
| resource_state        | enum('visible','moderated','deleted') | NO   |     | visible |                |
| resource_date         | int(10) unsigned                      | NO   |     | NULL    |                |
| resource_category_id  | int(10) unsigned                      | NO   | MUL | NULL    |                |
| current_version_id    | int(10) unsigned                      | NO   |     | NULL    |                |
| description_update_id | int(10) unsigned                      | NO   |     | NULL    |                |
| discussion_thread_id  | int(10) unsigned                      | NO   | MUL | NULL    |                |
| external_url          | varchar(500)                          | NO   |     |         |                |
| external_purchase_url | varchar(500)                          | NO   |     |         |                |
| price                 | decimal(10,2) unsigned                | NO   |     | 0.00    |                |
| currency              | varchar(3)                            | NO   |     |         |                |
| download_count        | int(10) unsigned                      | NO   |     | 0       |                |
| rating_count          | int(10) unsigned                      | NO   |     | 0       |                |
| rating_sum            | int(10) unsigned                      | NO   |     | 0       |                |
| rating_avg            | float unsigned                        | NO   |     | 0       |                |
| rating_weighted       | float unsigned                        | NO   | MUL | 0       |                |
| update_count          | int(10) unsigned                      | NO   |     | 0       |                |
| review_count          | int(10) unsigned                      | NO   |     | 0       |                |
| last_update           | int(10) unsigned                      | NO   | MUL | NULL    |                |
| alt_support_url       | varchar(500)                          | NO   |     |         |                |
| custom_fields         | mediumblob                            | NO   |     | NULL    |                |
| prefix_id             | int(10) unsigned                      | NO   | MUL | 0       |                |
| icon_date             | int(10) unsigned                      | NO   |     | 0       |                |
| tags                  | mediumblob                            | NO   |     | NULL    |                |
| resource_type         | varchar(25)                           | NO   |     | NULL    |                |
| view_count            | int(10) unsigned                      | NO   |     | 0       |                |
+-----------------------+---------------------------------------+------+-----+---------+----------------+
30 rows in set (0.00 sec)

mysql> alter table `xf_rm_resource` add column `is_fileless` tinyint unsigned not null default 0;
Query OK, 0 rows affected (0.31 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> exit
Bye
@server:/var/www/dev# php cmd.php xf:addon-upgrade XFRM
Upgrading XenForo Resource Manager from 1.2.5 to 2.2.0 Beta 3...
Confirm upgrade? (y/n)y
Upgrading . . . . . . . . . . . .
In AbstractStatement.php line 228:
                                                                               
  [XF\Db\Exception (1054)]                                                     
  MySQL statement prepare error [1054]: Unknown column 'like_users' in 'where  
   clause'                                                                     
                                                                               

Exception trace:
  at src/XF/Db/AbstractStatement.php:228
 XF\Db\AbstractStatement->getException() at src/XF/Db/Mysqli/Statement.php:196
 XF\Db\Mysqli\Statement->getException() at src/XF/Db/Mysqli/Statement.php:39
 XF\Db\Mysqli\Statement->prepare() at src/XF/Db/Mysqli/Statement.php:54
 XF\Db\Mysqli\Statement->execute() at src/XF/Db/AbstractAdapter.php:94
 XF\Db\AbstractAdapter->query() at src/XF/Db/AbstractAdapter.php:322
 XF\Db\AbstractAdapter->update() at src/XF/Install/InstallHelperTrait.php:85
 XF\AddOn\AbstractSetup->tableColumnsToJson() at src/XF/Install/InstallHelperTrait.php:43
 XF\AddOn\AbstractSetup->entityColumnsToJson() at src/addons/XFRM/Setup.php:729
 XFRM\Setup->upgrade2010010Step3() at src/XF/AddOn/StepRunnerUpgradeTrait.php:122
 XFRM\Setup->upgradeStepRunner() at src/XF/AddOn/StepRunnerUpgradeTrait.php:71
 XFRM\Setup->upgrade() at src/XF/Cli/Command/AddOnActionTrait.php:109
 XF\Cli\Command\AddOnSubAction->performAddOnAction() at src/XF/Cli/Command/AddOnSubAction.php:79
 XF\Cli\Command\AddOnSubAction->execute() at src/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at src/vendor/symfony/console/Application.php:987
 Symfony\Component\Console\Application->doRunCommand() at src/vendor/symfony/console/Application.php:255
 Symfony\Component\Console\Application->doRun() at src/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at src/XF/Cli/Runner.php:76
 XF\Cli\Runner->run() at cmd.php:15

xf:addon-sub-action [--k K] [--] <id> <action>

@server:/var/www/dev# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1193546
Server version: 5.7.30-33-log Percona Server (GPL), Release '33', Revision '6517692'

Copyright (c) 2009-2020 Percona LLC and/or its affiliates
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use dev;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> describe xf_resource_update;
+--------------------+---------------------------------------+------+-----+---------+----------------+
| Field              | Type                                  | Null | Key | Default | Extra          |
+--------------------+---------------------------------------+------+-----+---------+----------------+
| resource_update_id | int(11) unsigned                      | NO   | PRI | NULL    | auto_increment |
| resource_id        | int(11)                               | NO   | MUL | NULL    |                |
| title              | varchar(100)                          | NO   |     |         |                |
| message            | mediumtext                            | NO   |     | NULL    |                |
| message_state      | enum('visible','moderated','deleted') | NO   |     | visible |                |
| post_date          | int(10) unsigned                      | NO   |     | NULL    |                |
| attach_count       | int(10) unsigned                      | NO   |     | 0       |                |
| likes              | int(10) unsigned                      | NO   |     | 0       |                |
| like_users         | blob                                  | NO   |     | NULL    |                |
| ip_id              | int(10) unsigned                      | NO   |     | 0       |                |
| had_first_visible  | tinyint(3) unsigned                   | NO   |     | 0       |                |
| warning_id         | int(10) unsigned                      | NO   |     | 0       |                |
| warning_message    | varchar(255)                          | NO   |     |         |                |
+--------------------+---------------------------------------+------+-----+---------+----------------+
13 rows in set (0.00 sec)

mysql> describe xf_rm_resource_update;
+--------------------+---------------------------------------+------+-----+---------+----------------+
| Field              | Type                                  | Null | Key | Default | Extra          |
+--------------------+---------------------------------------+------+-----+---------+----------------+
| resource_update_id | int(11) unsigned                      | NO   | PRI | NULL    | auto_increment |
| resource_id        | int(10) unsigned                      | NO   | MUL | NULL    |                |
| title              | varchar(100)                          | NO   |     |         |                |
| message            | mediumtext                            | NO   |     | NULL    |                |
| message_state      | enum('visible','moderated','deleted') | NO   |     | visible |                |
| post_date          | int(10) unsigned                      | NO   |     | NULL    |                |
| attach_count       | int(10) unsigned                      | NO   |     | 0       |                |
| reaction_score     | int(11)                               | NO   |     | 0       |                |
| reactions          | blob                                  | YES  |     | NULL    |                |
| reaction_users     | blob                                  | NO   |     | NULL    |                |
| ip_id              | int(10) unsigned                      | NO   |     | 0       |                |
| warning_id         | int(10) unsigned                      | NO   |     | 0       |                |
| warning_message    | varchar(255)                          | NO   |     |         |                |
| embed_metadata     | blob                                  | YES  |     | NULL    |                |
+--------------------+---------------------------------------+------+-----+---------+----------------+
14 rows in set (0.00 sec)

mysql> exit
Bye
 
How was it resolved?
Of course, it was a PEBCAK issue.
My 'xF Replicate Prod to Dev' script was failing when dropping the existing DEV db. Thus, re-attempts for xF upgrade was importing the 1.5 db into the DEV db that already had prior upgrades. Rookie mistake, I'm embarrassed :whistle:. Sorry.
 
Top Bottom