Topic on Project:Support desk

Error Saving edited System (i.e. MediaWiki:x) Pages

12
Joanne222 (talkcontribs)

I just upgraded my MediaWiki installation from version 1.23.1 to 1.28.2.  I am also using PHP 7.1.6 and SQLIte 3.15.1.

Everything so far seems to be working ok except that we can no longer save edits for the MediaWiki:Sidebar and MediaWiki:Mainpage.  I can navigate to MediaWiki:Mainpage and click Edit to bring up the edit box ok and the Show preview works.  When I click Save Changes however I receive an Internal Error message: 

Internal error

 [bd5a9c5eda1b36d701550ed9] 2017-07-14 15:06:19: Fatal exception of type "Error"

The only information I could find on this issue was to check the permissions to make sure the user account has the editinterface permission.

My user account is a member of Administrators and Bureaucrats.  When I look at the Special:UserGroupRight page in my wiki it indicates the Administrator group includes the editinterface, editprotected, editsemiprotected etc., permissions.

I am not extremely knowledgeable about the wiki/php/SQLIte software.  Any assistance in fixing this is greatly appreciated.

This post was hidden by AhmadF.Cheema (history)
AhmadF.Cheema (talkcontribs)

This could be due to an incompatibility of newer MediaWiki version with some older extension version.

Try Manual:How to debug to get more detailed error description.

Joanne222 (talkcontribs)

Thank you for the debug instructions link. I added some of the debug calls to my LocalSettings.php file as indicated and the following was displayed in the Fatal Error area when I attempted to save changes to the MediaWiki:Mainpage page:

0623456c8d721035156ed27f] /wikilinc/index.php?title=MediaWiki%3AMainpage&action=submit Error from line 138 of C:\inetpub\wwwroot\WikiLinc\extensions\TitleBlacklist\TitleBlacklist.hooks.php: Call to undefined method Title::newFromRedirect()

Backtrace:

#0 C:\inetpub\wwwroot\WikiLinc\includes\Hooks.php(195): TitleBlacklistHooks::validateBlacklist(EditPage, string, string, string, string)

#1 C:\inetpub\wwwroot\WikiLinc\includes\EditPage.php(1803): Hooks::run(string, array)

#2 C:\inetpub\wwwroot\WikiLinc\includes\EditPage.php(1470): EditPage->internalAttemptSave(NULL, boolean)

#3 C:\inetpub\wwwroot\WikiLinc\includes\EditPage.php(612): EditPage->attemptSave(NULL)

#4 C:\inetpub\wwwroot\WikiLinc\includes\actions\EditAction.php(59): EditPage->edit()

#5 C:\inetpub\wwwroot\WikiLinc\includes\actions\SubmitAction.php(38): EditAction->show()

#6 C:\inetpub\wwwroot\WikiLinc\includes\MediaWiki.php(495): SubmitAction->show()

#7 C:\inetpub\wwwroot\WikiLinc\includes\MediaWiki.php(289): MediaWiki->performAction(Article, Title)

#8 C:\inetpub\wwwroot\WikiLinc\includes\MediaWiki.php(851): MediaWiki->performRequest()

#9 C:\inetpub\wwwroot\WikiLinc\includes\MediaWiki.php(512): MediaWiki->main()

#10 C:\inetpub\wwwroot\WikiLinc\index.php(43): MediaWiki->run()

#11 {main}

Also, will add that when I was performing the upgrade and following the instructions, I attempted to change the require_once extension calls to wfLoadExtension calls in LocalSettings.php and it would not work. I had to change them back to the require_once calls which I presume might indicate that I have done something incorrectly during my upgrade? The require_once calls work though.

Thank you for your help.

Joanne222 (talkcontribs)

So I have made a little progress on this issue. When I did the upgrade, I copied the LocalSettings.php file as well as the extensions and images directories. After I extracted my new version into my website directory, I copied in and overwrote the LocalSettings.php, extensions and images directories with the old ones. I had to add some code to the LocalSettings.php file, but everything seemed to work ok except for the MediaWiki:x pages.

Since the debugging was indicating the TitleBlacklist extension was an issue, I copied the new TitleBlacklist extension directory into my installation path replacing the old one that I had copied over during installation.

I can now save the edited MediaWiki:Sidebar and MediaWiki:Mainpage pages.

I still have the issue with the new extension calls not working so am using the require_once method still. I assume that must also be an extension issue as well?

I attempted to use the entire new extension directory and contents instead of my old ones, but then my wiki website was not displaying at all so I only am using the new TitleBlacklist extension and all the reset are from my old version of 1.23.

Please let me know if you have any suggestions or solutions.

Thank you.

AhmadF.Cheema (talkcontribs)

You appear to be under the mistaken impression that wfLoadExtension is to be used because of the new MediaWiki core version. This has more to do with the extension files than with MediaWiki core.

The newer method can only be used when an extension.json file is present in the extension directory. The older require_once method is deprecated and now wfLoadExtension method for enabling extensions is encouraged. Note that not all extensions are enabled using the new method as some extensions haven't been updated with the extension.json file.

As all but one of your extension files are from the days of MediaWiki v1.23 and the extension.json files are absent from the extension directories, therefore the new method of calling extensions will not work for them.

It is recommended that you upgrade all your extensions due to reasons of security and incompatibility with MediaWiki core. Upgrade the extensions one at a time, and then debug them to get a better idea of which extensions are causing fatal errors so that all the issues can be systematically resolved one-by-one.

Joanne222 (talkcontribs)

Thank you very much for the information and clarification on what drives the Extension call method. That definitely points me in the right direction.

Joanne222 (talkcontribs)

The original issue I posted about has been resolved. Thank you for your help.

I have another issue now that I cannot solve. It seems to be the same issue posted here:

https://www.mediawiki.org/wiki/Topic:Tgruq6xu81m149d3

by Dbeidle I tried some of things mentioned in that thread and the thread referenced in that post from here:

https://phabricator.wikimedia.org/T88312

I do not see where his issue was ever fixed. I am hoping that you can help me fix it with mine though.

Specifically, I have an intermittent issue where we try to edit a page and when we save or preview it may or may not work. If we then Retry on the error page it might post then. I have turned on debugging information to capture what is happening. When the page fails to post the debugging message displayed is:

[2e80a656914a00173f89ea4b] /wikilincluden/index.php?title=Counsel_Portfolio_Services&action=submit DBQueryError from line 1054 of C:\inetpub\wwwroot\WikiLincluden\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: BEGIN

Function: Database::query (MessageCache::loadFromDB(en)-big)

Error: 1 cannot start a transaction within a transaction

Backtrace:

#0 C:\inetpub\wwwroot\WikiLincluden\includes\libs\rdbms\database\Database.php(912): Database->reportQueryError(string, integer, string, string, boolean)

#1 C:\inetpub\wwwroot\WikiLincluden\includes\libs\rdbms\database\DatabaseSqlite.php(752): Database->query(string, string)

#2 C:\inetpub\wwwroot\WikiLincluden\includes\libs\rdbms\database\Database.php(2718): DatabaseSqlite->doBegin(string)

#3 C:\inetpub\wwwroot\WikiLincluden\includes\libs\rdbms\database\Database.php(851): Database->begin(string, string)

#4 C:\inetpub\wwwroot\WikiLincluden\includes\libs\rdbms\database\Database.php(1254): Database->query(string, string)

#5 C:\inetpub\wwwroot\WikiLincluden\includes\cache\MessageCache.php(485): Database->select(string, string, array, string)

#6 C:\inetpub\wwwroot\WikiLincluden\includes\cache\MessageCache.php(408): MessageCache->loadFromDB(string, NULL)

#7 C:\inetpub\wwwroot\WikiLincluden\includes\cache\MessageCache.php(330): MessageCache->loadFromDBWithLock(string, array, NULL)

#8 C:\inetpub\wwwroot\WikiLincluden\includes\cache\MessageCache.php(932): MessageCache->load(string)

#9 C:\inetpub\wwwroot\WikiLincluden\includes\cache\MessageCache.php(862): MessageCache->getMsgFromNamespace(string, string)

#10 C:\inetpub\wwwroot\WikiLincluden\includes\cache\MessageCache.php(831): MessageCache->getMessageForLang(Language, string, boolean, array)

#11 C:\inetpub\wwwroot\WikiLincluden\includes\cache\MessageCache.php(771): MessageCache->getMessageFromFallbackChain(Language, string, boolean)

#12 C:\inetpub\wwwroot\WikiLincluden\includes\Message.php(1188): MessageCache->get(string, boolean, Language)

#13 C:\inetpub\wwwroot\WikiLincluden\includes\Message.php(950): Message->fetchMessage()

#14 C:\inetpub\wwwroot\WikiLincluden\extensions\Gadgets\includes\MediaWikiGadgetsDefinitionRepo.php(113): Message->exists()

#15 C:\inetpub\wwwroot\WikiLincluden\extensions\Gadgets\includes\MediaWikiGadgetsDefinitionRepo.php(83): MediaWikiGadgetsDefinitionRepo->fetchStructuredList()

#16 C:\inetpub\wwwroot\WikiLincluden\includes\libs\objectcache\WANObjectCache.php(1004): MediaWikiGadgetsDefinitionRepo->{closure}(boolean, integer, array, NULL)

#17 C:\inetpub\wwwroot\WikiLincluden\includes\libs\objectcache\WANObjectCache.php(906): WANObjectCache->doGetWithSetCallback(string, integer, Closure, array)

#18 C:\inetpub\wwwroot\WikiLincluden\extensions\Gadgets\includes\MediaWikiGadgetsDefinitionRepo.php(90): WANObjectCache->getWithSetCallback(string, integer, Closure, array)

#19 C:\inetpub\wwwroot\WikiLincluden\extensions\Gadgets\includes\MediaWikiGadgetsDefinitionRepo.php(23): MediaWikiGadgetsDefinitionRepo->loadGadgets()

#20 C:\inetpub\wwwroot\WikiLincluden\extensions\Gadgets\includes\GadgetRepo.php(36): MediaWikiGadgetsDefinitionRepo->getGadgetIds()

#21 C:\inetpub\wwwroot\WikiLincluden\extensions\Gadgets\GadgetHooks.php(52): GadgetRepo->getStructuredList()

#22 C:\inetpub\wwwroot\WikiLincluden\includes\Hooks.php(195): GadgetHooks::userGetDefaultOptions(array)

#23 C:\inetpub\wwwroot\WikiLincluden\includes\user\User.php(1552): Hooks::run(string, array)

#24 C:\inetpub\wwwroot\WikiLincluden\includes\user\User.php(5131): User::getDefaultOptions()

#25 C:\inetpub\wwwroot\WikiLincluden\includes\user\User.php(483): User->loadOptions()

#26 C:\inetpub\wwwroot\WikiLincluden\includes\libs\objectcache\WANObjectCache.php(884): User->{closure}(boolean, integer, array, NULL)

#27 C:\inetpub\wwwroot\WikiLincluden\includes\libs\objectcache\WANObjectCache.php(1004): WANObjectCache->{closure}(boolean, integer, array, NULL)

#28 C:\inetpub\wwwroot\WikiLincluden\includes\libs\objectcache\WANObjectCache.php(889): WANObjectCache->doGetWithSetCallback(string, integer, Closure, array, NULL)

#29 C:\inetpub\wwwroot\WikiLincluden\includes\user\User.php(495): WANObjectCache->getWithSetCallback(string, integer, Closure, array)

#30 C:\inetpub\wwwroot\WikiLincluden\includes\user\User.php(437): User->loadFromCache()

#31 C:\inetpub\wwwroot\WikiLincluden\includes\user\User.php(401): User->loadFromId(integer)

#32 C:\inetpub\wwwroot\WikiLincluden\includes\session\UserInfo.php(88): User->load()

#33 C:\inetpub\wwwroot\WikiLincluden\includes\session\CookieSessionProvider.php(119): MediaWiki\Session\UserInfo::newFromId(string)

#34 C:\inetpub\wwwroot\WikiLincluden\includes\session\SessionManager.php(486): MediaWiki\Session\CookieSessionProvider->provideSessionInfo(WebRequest)

#35 C:\inetpub\wwwroot\WikiLincluden\includes\session\SessionManager.php(189): MediaWiki\Session\SessionManager->getSessionInfoForRequest(WebRequest)

#36 C:\inetpub\wwwroot\WikiLincluden\includes\WebRequest.php(735): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)

#37 C:\inetpub\wwwroot\WikiLincluden\includes\session\SessionManager.php(128): WebRequest->getSession()

#38 C:\inetpub\wwwroot\WikiLincluden\includes\Setup.php(759): MediaWiki\Session\SessionManager::getGlobalSession()

#39 C:\inetpub\wwwroot\WikiLincluden\includes\WebStart.php(137): require_once(string)

#40 C:\inetpub\wwwroot\WikiLincluden\index.php(40): require(string)

#41 {main} 

Thank you in advance for your help with this.

AhmadF.Cheema (talkcontribs)

As a starting point, have you already run update.php? Through SSH, in your Wiki directory run the following command: php maintenance/update.php

(Manual:Update.php)

Part of the error which mentions "Did you forget to run your application's database schema updater after upgrading?" indicates that update.php has not been run.

Joanne222 (talkcontribs)

I did the update via the web browser using these instructions in the Upgrade document:

Web browser[edit]

MediaWiki version: 1.17
See also update.phpManual:update.php

If your database is already big and in high production usage, then you should not be using the Web updater, e.g. because the update process will time out when the maximum_execution_time is reached. In that case you should use update.php from the command-line interface (not from the web). What exactly is "too big" depends on your server (e.g. on its performance, the load and on how long the maximum execution time of PHP allows the script to run). If your wiki is too big for the web updater and your hosting provider does not allow command-line access, then you need to migrate your wiki to another hosting account, preferably to one that does have shell access.

  1. Always backup before performing database maintenance.
  2. Navigate your webbrowser to /mw-config/. For example, if your wiki is at http://example.org/w/index.php, then navigate to http://example.org/w/mw-config/.
  3. Select your language and click continue.
  4. The existing installation should be detected. Follow the instructions on the screen to upgrade it. If asked for the "upgrade key", open your LocalSettings.phpManual:LocalSettings.php file and look for the key assigned to $wgUpgradeKeyManual:$wgUpgradeKey.

The message at the end indicated that everything updated ok.

This is an intermittent problem, and does not happen every time you try to save a change. It may not happen for 5 times in a row on one page, then the 6th time it will throw the error.

AhmadF.Cheema (talkcontribs)

In-between these "5th" and "6th" edits, you haven't by any chance been involved in enabling or disabling any extensions, have you? The need to update the database using update.php usually comes up when some new extension is enabled/disabled.

Joanne222 (talkcontribs)

Nothing is changed between the edits while I am testing. I simple select to edit the page, change a simple text value to "test" then press the Save Changes button. Then I select Edit and change text value to "test2" then press the Save Changes button. Then select Edit and change the text value to "test3" and continue with this test until it fails.

I did add the CollapsibleVector extension and change some of my extensions to the new ones after I did the initial upgrade, so I went ahead and rat the mw-config again just now to see if that would improve matters but it did not. The very first edit I did after this triggered the exact same error....page was not saved and error message indicated database may not have been updated.

When I run the upgrade it states:

Environmental checks

Basic checks will now be performed to see if this environment is suitable for MediaWiki installation. Remember to include this information if you seek support on how to complete the installation.

PHP 7.1.6 is installed.

Warning: Could not find APCu, XCache or WinCache.

Object caching is not enabled.

GNU diff3 not found.

Found ImageMagick: C:\ImageMagick\convert.exe.

Image thumbnailing will be enabled if you enable uploads.

Git version control software not found.

Using server name "http://wiki".

Using server URL "http://wiki/wikilincluden".

Warning: Your default directory for uploads C:\inetpub\wwwroot\WikiLincluden/images/ is vulnerable to arbitrary scripts execution.

Although MediaWiki checks all uploaded files for security threats, it is highly recommended to close this security vulnerability before enabling uploads.

Warning: The intl PECL extension is not available to handle Unicode normalization, falling back to slow pure-PHP implementation.

If you run a high-traffic site, you should read a little on Unicode normalization.

The environment has been checked. You can install MediaWiki.

Then:

Upgrade existing installation

There are MediaWiki tables in this database. To upgrade them to MediaWiki 1.28.2, click Continue

Then pressing Continue:

Upgrade existing installation

...index ls_field_val already set on log_search table.

...index change_tag_rc_tag already set on change_tag table.

...have rd_interwiki field in redirect table.

...transcache tc_time already converted.

...fulltext search table appears to be in order.

...iwlinks table already exists.

...index iwl_prefix_title_from already set on iwlinks table.

...have ul_value field in updatelog table.

...have iw_api field in interwiki table.

...iwl_prefix key doesn't exist.

...have cl_collation field in categorylinks table.

...module_deps table already exists.

...ar_page_revid key doesn't exist.

...index ar_revid already set on archive table.

...index user_email already set on user table.

...uploadstash table already exists.

...user_former_groups table already exists.

...index type_action already set on logging table.

...batch conversion of user_options: nothing to migrate. done.

...user table does not contain user_options field.

...have rev_sha1 field in revision table.

...have ar_sha1 field in archive table.

...index page_redirect_namespace_len already set on page table.

...have us_chunk_inx field in uploadstash table.

...have job_timestamp field in job table.

...index page_user_timestamp already set on revision table.

...have ipb_parent_block_id field in ipblocks table.

...index ipb_parent_block_id already set on ipblocks table.

...category table does not contain cat_hidden field.

...have rev_content_format field in revision table.

...have rev_content_model field in revision table.

...have ar_content_format field in archive table.

...have ar_content_model field in archive table.

...have page_content_model field in page table.

Content Handler DB fields should be usable now.

...site_stats table does not contain ss_admins field.

...recentchanges table does not contain rc_moved_to_title field.

...sites table already exists.

...have fa_sha1 field in filearchive table.

...have job_token field in job table.

...have job_attempts field in job table.

...have us_props field in uploadstash table.

...ug_group in table user_groups already modified by patch patch-ug_group-length-increase-255.sql.

...ufg_group in table user_former_groups already modified by patch patch-ufg_group-length-increase-255.sql.

...index pp_propname_page already set on page_props table.

...index img_media_mime already set on image table.

...index iwl_prefix_from_title already set on iwlinks table.

...have ar_id field in archive table.

...have el_id field in externallinks table.

...have rc_source field in recentchanges table.

...index log_user_text_type_time already set on logging table.

...index log_user_text_time already set on logging table.

...have page_links_updated field in page table.

...have user_password_expires field in user table.

...have pp_sortkey field in page_props table.

...recentchanges table does not contain rc_cur_time field.

...index wl_user_notificationtimestamp already set on watchlist table.

...have page_lang field in page table.

...have pl_from_namespace field in pagelinks table.

...have tl_from_namespace field in templatelinks table.

...have il_from_namespace field in imagelinks table.

...hitcounter doesn't exist.

...site_stats table does not contain ss_total_views field.

...page table does not contain page_counter field.

...fa_deleted_reason in table filearchive already modified by patch patch-editsummary-length.sql.

...msg_resource_links doesn't exist.

...msg_resource doesn't exist.

...bot_passwords table already exists.

...have wl_id field in watchlist table.

...cl_collation key doesn't exist.

...index cl_collation_ext already set on categorylinks table.

...collations up-to-date.

...index rc_name_type_patrolled_timestamp already set on recentchanges table.

...have ct_id field in change_tag table.

...have ts_id field in tag_summary table.

...site_stats is populated...done.

Purging caches...done.

Upgrade complete.

You can now start using your wiki

It seems to me that the database upgrade message is not the cause of the pages not saving or else I would think that I would be unable to post messages every time I make an attempt. The database upgrade error message appears whether the page posts ok or not.

Thank you for helping me try to figure this out.