Project:Support desk

Jump to: navigation, search

About this board

vde   Welcome to MediaWiki.org's Support desk, where you can ask MediaWiki questions!

There are also other places where to askCommunication: IRCCommunication#Chat, mailing listsMailing lists, Q&A etc.

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using (reported by your wiki's Special:Version page):
    • MediaWiki
    • PHP
    • Database
  2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
  3. To start a new thread, click "Start a new topic".
Language: English  español
By clicking "Add topic", you agree to our Terms of Use and agree to irrevocably release your text under the CC BY-SA 3.0 License and GFDL
Haroun al Mouwahid (talkcontribs)

Hello,

I would like to update my mediawiki 1.15.5-7 that work under postgres. However, Ive an error message when I try this command :

root@server:/usr/share/mediawiki/maintenance# php update.php WikiSysop --pass $Pass ($Pass is set of obviously)

MediaWiki 1.15.5-7 Updater

No superuser credentials could be found. Please provide the details of a user with appropriate permissions to update the database. See AdminSettings.sample for more details.

What's the problem please ? What is this credential ?

87.123.62.243 (talkcontribs)

Version 1.15 is really old and updating it is a good idea!

MediaWiki 1.15 is trying to read the database credentials from AdminSettings.php.

However, you do not need this file at all: When you are doing the upgrade, you will usually first upgrade the files of the installation and only afterwards run the update.php script. With other words: At the point where you are using update.php, you will already be using your new version of MediaWiki. The supported versions currently are 1.23, 1.26 and 1.27 and none of them is using AdminSettings.php anymore.

Haroun al Mouwahid (talkcontribs)

Ok thanks a lot. However, if I take the 1.26 or 1.27 files, how I do, I have to delete the old files or I uncompress the new files ABOVE the olders ?

87.123.62.243 (talkcontribs)

You should extract the new files into a new folder to make sure that old files are out of the way. Then you move over the files, which you still need (like LocalSettings.php or the contents of the images/ folder for example).

More details are on page upgrade!

Haroun al Mouwahid (talkcontribs)

Thank you but it still not working :( :( :(

Actually my old version 1.15.5-7 was in /var/lib/mediawki working with postgres 9.1 and the config file in /etc/mediawiki/LocalSettings.php

I have downloded mediawiki 1.26.4 and extracted the content in /etc/mediawiki-1.26.4 then and I have copied the /etc/mediawiki/LocalSettings.php in /opt/mediawiki-1.26.4/LocalSettings.php

Idem for images : cp -p /var/lib/mediawiki/images /opt/mediawiki-1.26.4/images and chown www-data: /opt/mediawiki-1.26.4/images.

Then I have tryied again : root@server:/usr/share/mediawiki/maintenance# php update.php WikiSysop --pass $Pass and here is what it yields :

PHP Fatal error: Cannot redeclare class SiteConfiguration in /usr/share/mediawiki/includes/SiteConfiguration.php on line 18

root@server:/opt/mediawiki-1.26.4/maintenance# sudo -u postgres psql -d wikidb -c "select user_name,user_password from mwuser where user_name like '%Sysop%';"

user_id | user_name | user_password

----------+----------------+----------------------------------------------

80 | WikiSysop |  :B:3a0ae96a:e442723142df548e474a7905cc23c6632

(1 row)

wikidb=# select * from user_groups where ug_user like '%80%';

ug_user | ug_group

---------+------------

80 | sysop

(1 row)

WTF ?

87.123.32.63 (talkcontribs)

I found your topic Topic:T1iv2xnsaqu13zvr from 7 months ago. In that topic you told us that you were using a number of different MediaWiki installation, which would be linked somehow. Is that still what you are trying to update here? (At least the error message is the same.)

You currently have

/etc/mediawiki-1.26.4  => MW 1.26
/opt/mediawiki-1.26.4/LocalSettings.php => New LocalSettings.php file
/opt/mediawiki-1.26.4/images => New images/ folder

Then you tried

$/usr/share/mediawiki/maintenance# php update.php WikiSysop --pass $Pass

As far as I understand it, you are running this command on the old installation. Make sure to run it from inside /opt/mediawiki-1.26.4/maintenance/ instead - and leave away the parameters:

/opt/mediawiki-1.26.4/maintenance/#php update.php

Also in Topic:T1iv2xnsaqu13zvr Ciencia gave you an advice on what to do with the weird directory structure, which you are currently having.

Haroun al Mouwahid (talkcontribs)

Hi, yes during this moment I tried a lot of things but it was not working, I admit that I did not do the rights manipulations and I should forget it for while. Now I can work on this update, at least till the end of the next week.... You can trust me, since Im talking to you, I tried exactly what I said in this thread, it means :

- Uncompress the mediawiki 1.26.4 in /opt/mediawiki-1.26.4

- Copy the old images from /var/lib/mediawiki/images to /opt/mediawiki-1.26.4/images (+ chown -R www-data: /opt/mediawiki-1.26.4/images)

- I have copied my old /etc/mediawiki/LocalSettings.php to /opt/mediawiki-1.26.4/LocalSettings.php

- Then I tried /opt/mediawiki-1.26.4/maintenance/#php update.php (with or without WikiSysop --pass $Pass), that it yields this error :

PHP Fatal error: Cannot redeclare class SiteConfiguration in /usr/share/mediawiki/includes/SiteConfiguration.php on line 18

However, I just read your message and you told me, I have to put the NEW LocalSettings.php in /opt/mediawiki-1.26.4 and therefore Im wondering how can I obtain the new one ??? To have it I have to create a new vhost to point to /opt/mediawiki-1.26.4 (ok no pb) after it asks me to install this new mediawiki ....

87.123.0.246 (talkcontribs)

I do trust you in what you say; I just have to understand what it means.

With the "new" LocalSettings.php file I just mean the copy, which you created when you put that file into the folder /opt/mediawiki-1.26.4/. You can just continue using this copy of the file. There is no need to "install the wiki again" or something like that in order to create a new file with different content. The file can just be used as is.

I have now checked the source code of SiteConfiguration.php and line 18 does not contain a class declaration. See https://github.com/wikimedia/mediawiki/blob/REL1_26/includes/SiteConfiguration.php. Actually, although you now executed the update.php file from the right directory, the error message is still mentioning the folder /usr/share/mediawiki, which is the old installation!

I don't know why the Ubuntu guys have split up the installation files into different locations and what they have done to make the one location link to the other. However, you still have to make sure that the old files are not used anymore!

Haroun al Mouwahid (talkcontribs)

1 : Yes, I don't know why it uses the /usr/share/mediawiki path instead the path where Im ... The problem is I have to keep this path because when it will work, I should prepare a package to update all our servers (we have a lot of MW 1.15.5-7 unfortunatly ...)

2 : I don't understand for the LocalSettings.php, you mean I can use the old one as well ? and I have to put it in /opt/mediawiki-1.26.4 ?

Haroun al Mouwahid (talkcontribs)

So I tried something else. I had a /etc/apache2/conf.d/mediawiki.conf with :

Alias /mediawiki /var/lib/mediawiki

<Directory /var/lib/mediawiki>

<Location /mediawiki> etc ...

Then today I created /etc/apache2/conf.d/mediawiki126.conf

Alias /mediawiki126 /opt/mediawiki-1.26.4

<Directory /opt/mediawiki-1.26.4/>

<Location /mediawiki126> etc ...

I deleted the old LocalSettings of MW 1.15 in /opt/mediawiki-1.26.4

Then I typed the URL https://localhost/mediawiki126 and set up the new configuration :

DbType : postgres

DbName : wikidb126

install account : postgres

DB account for web access : wikiuser (as before)

Admin account : WikiSysop (as before)

Ok the install has worked, but for the owner of the wikidb126 that I had to change despite the fact I specified wikiuser for db account, its owner will be postgres :

postgres=# \l

List of databases

Name | Owner | Encoding | Collate | Ctype | Access privileges

-----------+----------+----------+-------------+-------------+-----------------------

postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |

wikidb | wikiuser | UTF8 | en_US.UTF-8 | en_US.UTF-8 |

wikidb126 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |

postgres=# alter database wikidb126 owner to wikiuser;

ALTER DATABASE

postgres=# \l

Name | Owner | Encoding | Collate | Ctype | Access privileges

-----------+----------+----------+-------------+-------------+-----------------------

wikidb | wikiuser | UTF8 | en_US.UTF-8 | en_US.UTF-8 |

wikidb126 | wikiuser | UTF8 | en_US.UTF-8 | en_US.UTF-8 |

postgres=# \du

List of roles

Role name | Attributes | Member of

-----------+------------------------------------------------+-----------

postgres | Superuser, Create role, Create DB, Replication | {}

wikiuser | | {}

After I change the db target : $wgDBname = "wikidb"; (instead of wikidb126, there are the 2 databases) and I start the update :

/opt/mediawiki-1.26.4/maintenance/# php update.php

MediaWiki 1.26.4 Updater

Your composer.lock file is up to date with current dependencies!

Going to run database updates for wikidb

Depending on the size of your database this may take a while!

Abort with control-c in the next five seconds (skip this countdown with --quick) ... 0

...index mwuser_pkey already set on mwuser table.

...index mwuser_user_name_key already set on mwuser table.

...index pagecontent_pkey already set on pagecontent table.

Renaming sequence ipblocks_ipb_id_val to ipblocks_ipb_id_seq

Renaming sequence rev_rev_id_val to revision_rev_id_seq

Renaming sequence text_old_id_val to text_old_id_seq

Renaming sequence rc_rc_id_seq to recentchanges_rc_id_seq

Renaming sequence log_log_id_seq to logging_log_id_seq

Renaming sequence pr_id_val to page_restrictions_pr_id_seq

Renaming sequence category_id_seq to category_cat_id_seq

Creating sequence archive_ar_id_seq

Creating sequence externallinks_el_id_seq

...category table already exists.

[..]

Altering column 'user_properties.up_user' to be DEFERRABLE INITIALLY DEFERRED

Altering column 'watchlist.wl_user' to be DEFERRABLE INITIALLY DEFERRED

Refreshing add_interwiki() ...A database query error has occurred.

Query: DROP FUNCTION IF EXISTS add_interwiki(TEXT,INT,CHARACTER) CASCADE

Function: DatabaseBase::sourceFile( /opt/mediawiki-1.26.4/maintenance/postgres/archives/patch-add_interwiki.sql )

Error: 42501 ERROR:  must be owner of function add_interwiki

What's happen again ?

Haroun al Mouwahid (talkcontribs)

Obviously I did a chown -R root: /opt/mediawiki-1.26.4 + chown -R www-data: /opt/mediawiki-1.26.4/images/

Haroun al Mouwahid (talkcontribs)

The update is done now but I ve got an Internal error (error 500). Here is what I did :

- mv /usr/share/mediawiiki /usr/share/mediawiiki_old (to avoid update.php looks for something in /usr/share/mediawiki/includes/SiteConfiguration.php)

- Replaced $wgDBuser = "wikiuser"; and $wgDBpassword = "wikiuser_password"; by $wgDBuser = "postgres"; and $wgDBpassword = "";

Then I started /opt/mediawiki-1.26.4/maintenance# php update.php

MediaWiki 1.26.4 Updater

Your composer.lock file is up to date with current dependencies!

Going to run database updates for wikidb

Depending on the size of your database this may take a while!

Abort with control-c in the next five seconds (skip this countdown with --quick) ... 4

0

...index mwuser_pkey already set on mwuser table.

...index mwuser_user_name_key already set on mwuser table.

[..]

Populating img_sha1 field

Done 0 of 80, 0.000%

 

Done 80 files in 0.2 seconds

Fixing protocol-relative entries in the externallinks table...

Done, 0 rows updated.

Populating fa_sha1 field from fa_storage_key

Done 0 files in 0.0 seconds

Updating *_from_namespace fields in links tables.

...doing page_id from 1 to 200

...doing page_id from 200 to 399

...doing page_id from 399 to 598

Set the local repo temp zone container to be private.

Purging caches...done.

Done in 10 s.

Then I typed the URL https://localhost/mediawiki but the server told me :

Set $wgShowExceptionDetails = true; at the bottom of LocalSettings.php to show detailed debugging information. One done, here is the error :

Internal error

A database error has occurred

Query: SELECT page_id,page_namespace,page_title,page_restrictions,page_counter,page_is_redirect,page_is_new,page_random,page_touched,page_latest,page_len FROM page WHERE page_namespace = '0' AND page_title = 'Main_Page' LIMIT 1

Function: Article::pageData

Error: 1 ERROR: column "page_counter" does not exist

LINE 1: ...ge_id,page_namespace,page_title,page_restrictions,page_count...

^

Backtrace:

#0 /usr/share/mediawiki/includes/db/Database.php(616): DatabasePostgres->reportQueryError('ERROR: column ...', 1, 'SELECT page_id...', 'Article::pageDa...', false)

#1 /usr/share/mediawiki/includes/db/Database.php(1026): Database->query('SELECT page_id...', 'Article::pageDa...')

#2 /usr/share/mediawiki/includes/db/Database.php(1106): Database->select('page', Array, Array, 'Article::pageDa...', Array, Array)

#3 /usr/share/mediawiki/includes/Article.php(369): Database->selectRow('page', Array, Array, 'Article::pageDa...')

#4 /usr/share/mediawiki/includes/Article.php(381): Article->pageData(Object(DatabasePostgres), Array)

#5 /usr/share/mediawiki/includes/Wiki.php(300): Article->pageDataFromTitle(Object(DatabasePostgres), Object(Title))

#6 /usr/share/mediawiki/includes/Wiki.php(60): MediaWiki->initializeArticle(Object(Title), Object(WebRequest))

#7 /usr/share/mediawiki/index.php(116): MediaWiki->initiaIndeed the page_counter does not exist anymore seeing that you deleted it jerk !!! lollize(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest))

#8 {main}

Haroun al Mouwahid (talkcontribs)

Indeed the page_counter column does not exist anymore seeing that you deleted it jerk !!!! lol

wikidb=# \d page

Table "public.page"

Column       |           Type           |                       Modifiers                        

--------------------+--------------------------+--------------------------------------------------------

page_id            | integer                  | not null default nextval('page_page_id_seq'::regclass)

page_namespace     | smallint                 | not null

page_title         | text                     | not null

page_restrictions  | text                     |

page_is_redirect   | smallint                 | not null default 0

page_is_new        | smallint                 | not null default 0

page_random        | numeric(15,14)           | not null default random()

page_touched       | timestamp with time zone |

page_latest        | integer                  | not null

page_len           | integer                  | not null

titlevector        | public.tsvector          |

page_content_model | text                     |

page_links_updated | timestamp with time zone |

page_lang          | text                     |

Ohhh please !!! PLEEEEEEEEEAASEEEEE !!!

Reply to "Updating mediawiki 1.15.5-7"

Saving specific sides from a broken Ubuntu

7
62.156.184.62 (talkcontribs)

Hello,

because of a HDD failure of the Host VM my Ubuntu Installation with the MediaWiki installed on it is broken. I am able to boot from a LiveCD and access the mounted HDD, however wasnt able to fix the OS.

My question now is: is it possible to get two specific wiki sides with only access to the file system? I dont really care for the rest but these sides are pretty important for me and yes i know i am an idiot for not making a proper backup.

Thank you!

Wargo (talkcontribs)

Yes, you can access database files and script files (core, extensions, config...).

62.156.184.62 (talkcontribs)

Okay where can i find them?

Wargo (talkcontribs)

By default it's in /var/www and /var/lib/mysql. Maybe you can describe error?

62.156.184.62 (talkcontribs)

Thank you for the fast response!

Well there isnt really an error for Mediawiki, its just that i am not able to repair the original server. I tried to just shift the folders to another (my Nagios) Server, but all i get is

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

I guess the database has to be connected?

Malyacko (talkcontribs)

Depends on how you "shift the folders" and which command triggers that error message. Clear steps to reproduce the problem are welcome. :)

AhmadF.Cheema (talkcontribs)

If the only thing you did was just copy-paste the folders to another server then the "A database query error has occurred. This may indicate a bug in the software." error most likely indicates that the MediaWiki files cannot connect to the the database.

Reply to "Saving specific sides from a broken Ubuntu"
Jfoster81747 (talkcontribs)

I have a running mediawiki with no issues 1.27xxx with php7. I have another site that is remote using exactly the same software, with the same database installed. I want to disconnect the mediawiki from the on site database and connect it to the remote database. I have found no instructions for doing that. Are ther einstructions that anyone knows of or can someone provide a way to do this. I am aware that the mediawiki may be set up initially like this, though have not done so. i just think there is something I am not aware of that will make this easier.

Thanks

john

please reply to: jfoster81747@gmail.com

Reply to "Remote database setup"
Zvezdato (talkcontribs)

Здравствуйте есть пару вопросов. Не могли ли бы вы мне помочь?

Reply to "Добрый день."
131.173.196.24 (talkcontribs)

Hello,

I am trying to use the ImageMap feature of the MediaWiki. Overall it is working just fine, but no matter what I try, i got the following problem:

The text after the ImageMap will always be a Link to the Image it self. The Link will go to the next footnote in the Text.

Here is the Code i used for the ImageMap:

==The Event-Driven Process Chain==
<imagemap>
Image:EPC_example.png|alt=Exemplary EPC process model.|Exemplary EPC process model|300px|thumb
circle 355 580 55 [[XOR Operator | XOR Operator]]
rect 240 270 475 425 [[Function | Function]]
rect 240 0 475 165 [[Event | Event]]
rect 0 720 240 880 [[Event | Event]]
rect 470 720 706 880 [[Event | Event]]
</imagemap>
The event-driven process chain (EPC) has been one of the most dominant languages for business process modelling over the last decades and is well established in both research and practice.[1]

Anybody got an Idea why this is? Here is a Link to the given Page: https://www.epc-standard.org/collaborate/Main_Page

Thanks

Ciencia Al Poder (talkcontribs)

Looks like the HarvardReferences extension is conflicting with imagemap. Can you try disabling the HarvardReferences extension and see if that fixes it?

131.173.166.59 (talkcontribs)

Thank you for the answer, but  apparently disabling the HarvardReferences extension made things even worse... Now the text will be linked till the next link in the text. But cause disabling the extension makes a different, it should have to do sth. with some reference configurations? We use the Cite Extension that is already built in in the MediaWiki. I have disabled both of them but with the same result as just disabling the HarvardReferences extension. Any additional idea is welcome!

Thanks!

131.173.166.59 (talkcontribs)

I found another "interesting" facet of the issue.

If i edit the page and go to the quick preview (not the "show preview" at the bottom of the page), everything is working fine? I don't know if that could help...

Reply to "ImageMap"
Zoglun (talkcontribs)

Hi guys,

Just get an old wiki with about 85k spam pages without any backup. I delete all spam with DeleteBatch.php. Then the problem become 85k pages deletion history. How can I remove all those deletion record?

Thank you!

Star Warden (talkcontribs)

Are you trying to hide that you deleted those pages? If so, you will need revision rights, which you need to enable in localsettings.php (see Manual:RevisionDelete). If you're trying to delete archived revisions (but not the history of a page), then Manual:DeleteArchivedRevisions.php. If you're trying to delete page histories, then Manual:DeleteOldRevisions.php.

There's also an extension that lets you delete pages permanently, without any trace (Extension:DeletePagesForGood). You could also delete their data by accessing the database itself and searching them in the tables they belong to (though you're better off trying the previous options).

Hope it helps!

87.123.0.246 (talkcontribs)

The deletions are logged inside the database table logging. Deletions have "delete" as value in column log_type. You can then limit the rows to remove e.g. using the value of log_timestamp and of log_user_text.

Reply to "How to delete deletion history?"

This content can’t be shown in a frame.

2
108.5.251.143 (talkcontribs)

Hi,

I added widgets 1.2.1 to my work mediawiki, edited the LocalSettings.php and added "$IP/extensions/Widgets/Widgets.php"; When I check the version in special pages I can see that is loaded and working fine

When I add "Google forms" I get "This content can’t be shown in a frame. There is supposed to be some content here, but the publisher doesn’t allow it to be displayed in a frame. This is to help protect the security of any information you might enter into this site."

If I used sample google forms pages from anywhere on the net, google or even here in mediawiki my pages load fine but when I make my own google form always het this error.

Using wamp to host our work wiki to our LAN.

Product Version
MediaWiki 1.27.1
PHP 5.6.25 (apache2handler)
MySQL 5.7.14
ICU 57.1

Thank you

87.123.0.246 (talkcontribs)

Does Manual:$wgEditPageFrameOptions help?

Reply to "This content can’t be shown in a frame."

Migrate mediawiki from Ubuntu to Windows?

2
Vjsuarez2002 (talkcontribs)

Hello, I need to migrate mediawiki off an old Ubuntu Server (11.04) and was curious if I could migrate it to a Windows server? This would go to either a Server 2008R2 or 2016 Server if possible

Ubuntu 11.04

Current Mediawiki version 1.16.4

MySQL 5.1.63

PHP 5.3.5

Apache 2.2.17

87.123.0.246 (talkcontribs)

That should be possible, see Manual:Moving a wiki!

Depending on what you have on the new server (PHP and MySQL versions), you will also have to Update MediaWiki to version 1.26 or 1.27.

Reply to "Migrate mediawiki from Ubuntu to Windows?"

How to delete pages according to a pattern with deletebatch.php or else ?

4
Tuxxic (talkcontribs)

Hi,

I need to delete regularly pages with a certain pattern in thename, for instance "Pagename/de" should be deleted, as all pages finishing by "/de".

How can I script it with deletebatch or else ?

Thanks in advance.

Zoglun (talkcontribs)

Try to get all "/de" page title with Extension:Replace Text.

If you have huge amount of "/de" page, export all title name under namespace=0. (You may do this by mysqldump -uroot -p --where="page_title (WHERE page_namespace = 0)" wiki page > page-title.sql) ← Not sure if this work, Try api if you can.

Then write a little regular expressions to match all "/de" (If you can't write script, use notepad++, Press Ctrl+H for replace function. Replace all line not matched to none).

Save results to a DeleteAllGermanSubPage.txt file, with one title one line style.

Run

php /wiki/maintenance/deleteBatch.php DeleteAllGermanSubPage.txt

in ssh terminal.

Hope this help.

87.123.62.243 (talkcontribs)

Something like a SELECT page_title FROM page where page_title LIKE "%/de" AND page_namespace = 0 INTO OUTFILE page-title.sql should do.

Tuxxic (talkcontribs)

Thanks all of you !

I took the query of 87.123.62.243 and the method of @Zoglun and managed to do it :)

Thanks for help again :)

PaleoIsh (talkcontribs)

Hello,

Does anyone know an easier way to find out what the word count of a particular MediaWiki installation?

Thanks for your help!

87.123.32.63 (talkcontribs)

Depends on which way you are currently having...

PaleoIsh (talkcontribs)

I'm ok with a simple word count over all pages.

Reply to "Word Count"