Page MenuHomePhabricator

Database error on Admin talk page when Flow Role enabled in Vagrant: "Error: 1146 Table 'blobs' doesn't exist"
Open, Needs TriagePublic

Description

Error

Database error

A database query error has occurred. This may indicate a bug in the software.

[5211a376443eb015697a4555] /wiki/User_talk:Admin Wikimedia\Rdbms\DBQueryError from line 1506 of /vagrant/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: SELECT blob_text FROM `blobs` WHERE blob_id = '94' LIMIT 1 
Function: ExternalStoreDB::fetchBlob
Error: 1146 Table 'wiki.blobs' doesn't exist (127.0.0.1)
Backtrace:

#0 /vagrant/mediawiki/includes/libs/rdbms/database/Database.php(1476): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
#1 /vagrant/mediawiki/includes/libs/rdbms/database/Database.php(1236): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /vagrant/mediawiki/includes/libs/rdbms/database/Database.php(1703): Wikimedia\Rdbms\Database->query(string, string)
#3 /vagrant/mediawiki/includes/libs/rdbms/database/Database.php(1528): Wikimedia\Rdbms\Database->select(string, string, array, string, array, array)
#4 /vagrant/mediawiki/includes/libs/rdbms/database/DBConnRef.php(49): Wikimedia\Rdbms\Database->selectField(string, string, array, string)
#5 /vagrant/mediawiki/includes/libs/rdbms/database/DBConnRef.php(248): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#6 /vagrant/mediawiki/includes/externalstore/ExternalStoreDB.php(241): Wikimedia\Rdbms\DBConnRef->selectField(string, string, array, string)
#7 /vagrant/mediawiki/includes/externalstore/ExternalStoreDB.php(49): ExternalStoreDB->fetchBlob(string, string, boolean)
#8 /vagrant/mediawiki/includes/externalstore/ExternalStore.php(86): ExternalStoreDB->fetchFromURL(string)
#9 /vagrant/mediawiki/includes/Storage/SqlBlobStore.php(421): ExternalStore::fetchFromURL(string, array)
#10 /vagrant/mediawiki/includes/libs/objectcache/WANObjectCache.php(1291): MediaWiki\Storage\SqlBlobStore->MediaWiki\Storage\{closure}(boolean, integer, array, NULL)
#11 /vagrant/mediawiki/includes/libs/objectcache/WANObjectCache.php(1160): WANObjectCache->doGetWithSetCallback(string, integer, Closure, array)
#12 /vagrant/mediawiki/includes/Storage/SqlBlobStore.php(425): WANObjectCache->getWithSetCallback(string, integer, Closure, array)
#13 /vagrant/mediawiki/includes/Storage/SqlBlobStore.php(353): MediaWiki\Storage\SqlBlobStore->expandBlob(string, array, string)
#14 /vagrant/mediawiki/includes/Storage/SqlBlobStore.php(281): MediaWiki\Storage\SqlBlobStore->fetchBlob(string, integer)
#15 /vagrant/mediawiki/includes/libs/objectcache/WANObjectCache.php(1291): MediaWiki\Storage\SqlBlobStore->MediaWiki\Storage\{closure}(boolean, integer, array, NULL)
#16 /vagrant/mediawiki/includes/libs/objectcache/WANObjectCache.php(1160): WANObjectCache->doGetWithSetCallback(string, integer, Closure, array)
#17 /vagrant/mediawiki/includes/Storage/SqlBlobStore.php(283): WANObjectCache->getWithSetCallback(string, integer, Closure, array)
#18 /vagrant/mediawiki/includes/Revision/RevisionStore.php(1461): MediaWiki\Storage\SqlBlobStore->getBlob(string, integer)
#19 /vagrant/mediawiki/includes/Revision/RevisionStore.php(1634): MediaWiki\Revision\RevisionStore->loadSlotContent(MediaWiki\Revision\SlotRecord, NULL, NULL, NULL, integer)
#20 [internal function]: MediaWiki\Revision\RevisionStore->MediaWiki\Revision\{closure}(MediaWiki\Revision\SlotRecord)
#21 /vagrant/mediawiki/includes/Revision/SlotRecord.php(309): call_user_func(Closure, MediaWiki\Revision\SlotRecord)
#22 /vagrant/mediawiki/includes/Revision/RevisionRecord.php(175): MediaWiki\Revision\SlotRecord->getContent()
#23 /vagrant/mediawiki/includes/Revision.php(940): MediaWiki\Revision\RevisionRecord->getContent(string, integer, NULL)
#24 /vagrant/mediawiki/includes/page/WikiPage.php(809): Revision->getContent(integer, NULL)
#25 /vagrant/mediawiki/extensions/Flow/includes/WorkflowLoaderFactory.php(81): WikiPage->getContent()
#26 /vagrant/mediawiki/extensions/Flow/includes/Actions/Action.php(105): Flow\WorkflowLoaderFactory->createWorkflowLoader(Title)
#27 /vagrant/mediawiki/extensions/Flow/includes/Actions/ViewAction.php(20): Flow\Actions\FlowAction->showForAction(string, OutputPage)
#28 /vagrant/mediawiki/extensions/Flow/includes/Actions/Action.php(50): Flow\Actions\ViewAction->showForAction(string)
#29 /vagrant/mediawiki/includes/MediaWiki.php(501): Flow\Actions\FlowAction->show()
#30 /vagrant/mediawiki/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#31 /vagrant/mediawiki/includes/MediaWiki.php(862): MediaWiki->performRequest()
#32 /vagrant/mediawiki/includes/MediaWiki.php(517): MediaWiki->main()
#33 /vagrant/mediawiki/index.php(42): MediaWiki->run()
#34 /var/www/w/index.php(5): require(string)
#35 {main}

Impact

Structured discussion page not working.

Notes

Steps to Reproduce:

  • Disable all roles in vagrant
vagrant up
vagrant roles reset
vagrant provision
  • Enable echo, wikimediaflow, and monobook roles
vagrant roles enable echo wikimediaflow monobook
vagrant provision

talkwithechoandflow_2019-01-07_21-56-32.png (668×1 px, 243 KB)

Event Timeline

Aklapper renamed this task from Database error on Admin talk page when Flow Role enabled in Vagrant to Database error on Admin talk page when Flow Role enabled in Vagrant: "Error: 1146 Table 'blobs' doesn't exist".Jan 8 2019, 3:48 AM

As I understand this task it is not a problem appearing on a Wikimedia production wiki, hence I'm removing the tag Wikimedia-production-error .

I wonder if running the script /maintenance/storage/make-blobs in MediaWiki core might help locally.

Provisioning roles failed with Error: Cannot allocate memory - fork(2) me. 🤔

vagrant up
vagrant roles reset
vagrant provision
vagrant roles enable echo wikimediaflow monobook
vagrant provision
...
==> default: Notice: /Stage[main]/Varnish/Group[varnish]/ensure: created
==> default: Notice: /Stage[main]/Varnish/User[varnish]/ensure: created
==> default: Notice: /Stage[main]/Varnish/File[/etc/varnish]/ensure: created
==> default: Notice: /Stage[main]/Varnish/File[/srv/varnish-build]/ensure: created
==> default: Notice: /Stage[main]/Varnish/File[/srv/varnish-build/build-varnish.sh]/ensure: defined content as '{md5}c9e27256c7f68f45db3dcf751d7f407c'
==> default: Notice: /Stage[main]/Varnish/File[/srv/varnish-build/build-tbf.sh]/ensure: defined content as '{md5}2a9adf9483c83aa1e94cecefba2fe8e6'
==> default: Notice: /Stage[main]/Varnish/File[/etc/varnish/secret]/ensure: defined content as '{md5}de98d400f70b9cc9671f192cd88f21f4'
==> default: Notice: /Stage[main]/Varnish/File[/var/run/varnish]/ensure: created
==> default: Notice: /Stage[main]/Varnish/File[/usr/local/var]/ensure: created
==> default: Notice: /Stage[main]/Varnish/File[/usr/local/var/varnish]/ensure: created
==> default: Notice: /Stage[main]/Varnish/File[/usr/local/var/varnish/mediawiki-vagrant]/ensure: created
==> default: Notice: /Stage[main]/Varnish/File[/srv/varnish-build/build-varnish-modules.sh]/ensure: defined content as '{md5}3f2b5aea361b06111b5ceb53a14474b8'
==> default: Notice: /Stage[main]/Varnish/File[/usr/local/lib/python3.5/dist-packages/wikimedia_varnishlogconsumer.py]/ensure: defined content as '{md5}b630c6cb6dd91b31d6207b9ed2bc23f1'
==> default: Notice: /Stage[main]/Varnish/File[/usr/local/bin/varnishslowlog]/ensure: defined content as '{md5}0d5a20c86f0ad3f6cd9f6fa782ea981b'
==> default: Info: /Stage[main]/Varnish/File[/usr/local/bin/varnishslowlog]: Scheduling refresh of Service[varnishslowlog]
==> default: Notice: /Stage[main]/Varnish/File[/usr/local/bin/varnishospital]/ensure: defined content as '{md5}0874a0a2a9e4d4a81a6e74031caaf116'
==> default: Notice: /Stage[main]/Varnish/File[/etc/mtail/varnish]/ensure: created
==> default: Notice: /Stage[main]/Varnish/File[/usr/local/bin/varnishmtail]/ensure: defined content as '{md5}0f72ac988f97b9aedca229f26ece5e16'
==> default: Info: /Stage[main]/Varnish/File[/usr/local/bin/varnishmtail]: Scheduling refresh of Systemd::Service[varnishmtail]
==> default: Info: Systemd::Service[varnishmtail]: Scheduling refresh of Exec[systemd reload for varnishmtail]
==> default: Info: Systemd::Service[varnishmtail]: Scheduling refresh of Service[varnishmtail]
==> default: Notice: /Stage[main]/Varnish/Git::Clone[Varnish-Cache]/File[/srv/varnish-build/Varnish-Cache]/ensure: created
==> default: Notice: /Stage[main]/Varnish/Git::Clone[Varnish-Cache]/Exec[git_clone_Varnish-Cache]/returns: executed successfully
==> default: Error: Cannot allocate memory - fork(2)
==> default: Notice: /Stage[main]/Varnish/File[/etc/varnish/default.vcl]: Dependency Exec[build_varnish] has failures: true
==> default: Notice: /Stage[main]/Varnish/File[/etc/varnish/conf-d.vcl]: Dependency Exec[build_varnish] has failures: true
==> default: Notice: /Stage[main]/Varnish/File[/etc/varnish/conf.d]: Dependency Exec[build_varnish] has failures: true
==> default: Error: /Stage[main]/Varnish/Exec[build_varnish]/returns: change from notrun to 0 failed: Cannot allocate memory - fork(2)
==> default: Warning: /Stage[main]/Varnish/File[/etc/varnish/default.vcl]: Skipping because of failed dependencies
==> default: Warning: /Stage[main]/Varnish/File[/etc/varnish/conf-d.vcl]: Skipping because of failed dependencies
==> default: Warning: /Stage[main]/Varnish/File[/etc/varnish/conf.d]: Skipping because of failed dependencies
...

Provisioning each role separately works fine. 😄

I'm not sure what caused the error in T213142#4862356. Provisioning roles one by one (so all three are enabled at the end) did not cause any problems.

I was able to reproduce this on my machine. I will update reproduction steps to make them slightly more clear.

Confirmed by @SBisson - wikimediaflow role is broken in vagrant due to issues with external storage setup. Enabling flow role should be sufficient for dealing with most of Structured discussion functionality.

I tried provisioning roles one by one, but am still running into the same error. Not sure how to run /maintenance/storage/make-blobs.

I think if you put $wgFlowExternalStore = false; in your local config to force Flow to store the revision content in the flow_revision table, you should be able to provision and use the software.

I tried provisioning roles one by one, but am still running into the same error. Not sure how to run /maintenance/storage/make-blobs.

Sorry, I think I've confused you. Provisioning all roles at once did not work on my machine, but provisioning one by one worked eventually. Both ways lead to the same state (all roles provisioned), it is not a solution.

Confirmed by @SBisson - wikimediaflow role is broken in vagrant due to issues with external storage setup. Enabling flow role should be sufficient for dealing with most of Structured discussion functionality.

@Ephemeralwaves if I understood @Etonkovidova, try disabling all roles and enabling just flow role, that should work.

So:

vagrant up
vagrant roles reset
vagrant roles enable flow
vagrant provision
Warning: file_put_contents(/vagrant/mediawiki/extensions/Flow/handlebars/compiled/flow_block_topiclist.handlebars.php): failed to open stream: Permission denied in /vagrant/mediawiki/extensions/Flow/includes/TemplateHelper.php on line 101

flow.png (821×1 px, 182 KB)

Provisioning roles failed with Error: Cannot allocate memory - fork(2) me. 🤔

The next time I've tried it (with a new VM) it worked just fine. 🙄

I think if you put $wgFlowExternalStore = false; in your local config to force Flow to store the revision content in the flow_revision table, you should be able to provision and use the software.

In case you don't know how to do this (I had to look it up and I use mediawiki-vagrant for years), this should do it:

Create file vagrant/settings.d/wgFlowExternalStore.php with content

<?php
$wgFlowExternalStore = false;

So:

printf '<?php\n$wgFlowExternalStore = false;' > settings.d/wgFlowExternalStore.php

I'm provisioning roles so I can't test if it works. @SBisson, please correct me if I'm wrong.

I think if you put $wgFlowExternalStore = false; in your local config to force Flow to store the revision content in the flow_revision table, you should be able to provision and use the software.

Didn't work for me. 😢

I've added that to local config (T213142#4867089), ran vagrant provision (with roles echo, wikimediaflow and monobook already enabled and provisioned) and I still get the same error message at User_talk:Admin.

Do I need to create the file before enabling and provisioning the roles? Should I provision just flow role? I'm confused.

I think if you put $wgFlowExternalStore = false; in your local config to force Flow to store the revision content in the flow_revision table, you should be able to provision and use the software.

Didn't work for me. 😢

I've added that to local config (T213142#4867089), ran vagrant provision (with roles echo, wikimediaflow and monobook already enabled and provisioned) and I still get the same error message at User_talk:Admin.

Do I need to create the file before enabling and provisioning the roles? Should I provision just flow role? I'm confused.

Disabling external store for Flow is not going to fix pages that already had content. This is just a workaround to get the role working when you provision from scratch. It may or may not be useful in your case. The role is broken. Let's hope someone finds the time to fix it.