Hey all,
About one every 5 page views mediawiki throws this error:
Fatal error: Call to a member function selectRow() on a non-object in User.php on line 826
I have not recently upgraded. I have been on version 1.13.3 since it was released. The site was working fine until this morning and rebooting mySQL didn't help. I also get a connection error every couple of loads if I click through my databases in phpmyadmin. Does anyone know what could be wrong? I have shell access.
Thanks
Line 826 (in my code) is this:
$s = $dbr->selectRow( 'user', '*', array( 'user_id' => $this->mId ), __METHOD__ );
it appears to be related to a mySQL query. Usually the error you get in PHP means that some variable, that you try to work with, has not been set or is FALSE, e.g. $dbr.
Reading about the connection error you get in phpMyAdmin, I'd guess that PHP encounters the same, when it tries to connect to your database and fill the variable. So I'd begin looking at your DB, _if_ you are sure that you have not changed anything in your PHP code!
I don't know much about Apache and stuff, but I had a big problem once when due to a listing in some very popular web catalogue I suddenly recieved thousands of hits a day (compared to maybe 100 the day before). The increase in traffic was so intense that it brought my DB down. I solved the problem with making all pages static. This was possible on that website, simply by having a cronjob execute once each night and build all pages from the database. But that website was not a wiki, with user contribution. Anyway ...
... try and find out about the performance of your database. I don't know how, I had someone look at the logs and interpret them for me, and he installed a small script that recorded what happened on the database server etc., so maybe start with calling your provider and ask them about _their_ server and tell them that you see performance problems.
Hope all this bla bla helps you!
~ Manfred
Hey all,
About one every 5 page views mediawiki throws this error:
Fatal error: Call to a member function selectRow() on a non-object in User.php on line 826
I have not recently upgraded. I have been on version 1.13.3 since it was released. The site was working fine until this morning and rebooting mySQL didn't help. I also get a connection error every couple of loads if I click through my databases in phpmyadmin. Does anyone know what could be wrong? I have shell access.
Thanks _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
I haven't changed any php except small changes to LocalSettings.php last week, but it was nothing related to this.
My traffic hat not spiked recently but I do have my host looking at the issue. Thanks for the tips.
Anything else on the issue would be appreciated.
On Thu, Feb 12, 2009 at 11:43 AM, Manfred Kooistra manfred.kooistra@gmx.dewrote:
Line 826 (in my code) is this:
$s = $dbr->selectRow( 'user', '*', array( 'user_id' => $this->mId ), __METHOD__ );
it appears to be related to a mySQL query. Usually the error you get in PHP means that some variable, that you try to work with, has not been set or is FALSE, e.g. $dbr.
Reading about the connection error you get in phpMyAdmin, I'd guess that PHP encounters the same, when it tries to connect to your database and fill the variable. So I'd begin looking at your DB, _if_ you are sure that you have not changed anything in your PHP code!
I don't know much about Apache and stuff, but I had a big problem once when due to a listing in some very popular web catalogue I suddenly recieved thousands of hits a day (compared to maybe 100 the day before). The increase in traffic was so intense that it brought my DB down. I solved the problem with making all pages static. This was possible on that website, simply by having a cronjob execute once each night and build all pages from the database. But that website was not a wiki, with user contribution. Anyway ...
... try and find out about the performance of your database. I don't know how, I had someone look at the logs and interpret them for me, and he installed a small script that recorded what happened on the database server etc., so maybe start with calling your provider and ask them about _their_ server and tell them that you see performance problems.
Hope all this bla bla helps you!
~ Manfred
Hey all,
About one every 5 page views mediawiki throws this error:
Fatal error: Call to a member function selectRow() on a non-object in User.php on line 826
I have not recently upgraded. I have been on version 1.13.3 since it was released. The site was working fine until this morning and rebooting mySQL didn't help. I also get a connection error every couple of loads if I
click
through my databases in phpmyadmin. Does anyone know what could be wrong?
I
have shell access.
Thanks _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
If you are on a shared server, or, as in many hosting situations even when you have your own server, you are on a shared database server, it might well be another website that is bringing that shared database server down.
Anyway, we'll see what your provider comes up with.
I haven't changed any php except small changes to LocalSettings.php last week, but it was nothing related to this.
My traffic hat not spiked recently but I do have my host looking at the issue. Thanks for the tips.
Anything else on the issue would be appreciated.
On Thu, Feb 12, 2009 at 11:43 AM, Manfred Kooistra manfred.kooistra@gmx.dewrote:
Line 826 (in my code) is this:
$s = $dbr->selectRow( 'user', '*', array( 'user_id' => $this->mId ), __METHOD__ );
it appears to be related to a mySQL query. Usually the error you get in PHP means that some variable, that you try to work with, has not been set or is FALSE, e.g. $dbr.
Reading about the connection error you get in phpMyAdmin, I'd guess that PHP encounters the same, when it tries to connect to your database and fill the variable. So I'd begin looking at your DB, _if_ you are sure that you have not changed anything in your PHP code!
I don't know much about Apache and stuff, but I had a big problem once when due to a listing in some very popular web catalogue I suddenly recieved thousands of hits a day (compared to maybe 100 the day before). The increase in traffic was so intense that it brought my DB down. I solved the problem with making all pages static. This was possible on that website, simply by having a cronjob execute once each night and build all pages from the database. But that website was not a wiki, with user contribution. Anyway ...
... try and find out about the performance of your database. I don't know how, I had someone look at the logs and interpret them for me, and he installed a small script that recorded what happened on the database server etc., so maybe start with calling your provider and ask them about _their_ server and tell them that you see performance problems.
Hope all this bla bla helps you!
~ Manfred
Hey all,
About one every 5 page views mediawiki throws this error:
Fatal error: Call to a member function selectRow() on a non-object in User.php on line 826
I have not recently upgraded. I have been on version 1.13.3 since it was released. The site was working fine until this morning and rebooting mySQL didn't help. I also get a connection error every couple of loads if I
click
through my databases in phpmyadmin. Does anyone know what could be wrong?
I
have shell access.
Thanks _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
My host said my tables were corrupted. So I repaired the database and it fixed the issue. Strange?
On Thu, Feb 12, 2009 at 12:05 PM, Manfred Kooistra manfred.kooistra@gmx.dewrote:
If you are on a shared server, or, as in many hosting situations even when you have your own server, you are on a shared database server, it might well be another website that is bringing that shared database server down.
Anyway, we'll see what your provider comes up with.
I haven't changed any php except small changes to LocalSettings.php last week, but it was nothing related to this.
My traffic hat not spiked recently but I do have my host looking at the issue. Thanks for the tips.
Anything else on the issue would be appreciated.
On Thu, Feb 12, 2009 at 11:43 AM, Manfred Kooistra manfred.kooistra@gmx.dewrote:
Line 826 (in my code) is this:
$s = $dbr->selectRow( 'user', '*', array( 'user_id' => $this->mId ), __METHOD__ );
it appears to be related to a mySQL query. Usually the error you get in PHP means that some variable, that you try to work with, has not been set or is FALSE, e.g. $dbr.
Reading about the connection error you get in phpMyAdmin, I'd guess that PHP encounters the same, when it tries to connect to your database and fill the variable. So I'd begin looking at your DB, _if_ you are sure that you have not changed anything in your PHP code!
I don't know much about Apache and stuff, but I had a big problem once when due to a listing in some very popular web catalogue I suddenly recieved thousands of hits a day (compared to maybe 100 the day before). The increase in traffic was so intense that it brought my DB down. I solved the problem with making all pages static. This was possible on that website, simply by having a cronjob execute once each night and build all pages from the database. But that website was not a wiki, with user contribution. Anyway ...
... try and find out about the performance of your database. I don't know how, I had someone look at the logs and interpret them for me, and he installed a small script that recorded what happened on the database server etc., so maybe start with calling your provider and ask them about _their_ server and tell them that you see performance problems.
Hope all this bla bla helps you!
~ Manfred
Hey all,
About one every 5 page views mediawiki throws this error:
Fatal error: Call to a member function selectRow() on a non-object in User.php on line 826
I have not recently upgraded. I have been on version 1.13.3 since it
was
released. The site was working fine until this morning and rebooting
mySQL
didn't help. I also get a connection error every couple of loads if I
click
through my databases in phpmyadmin. Does anyone know what could be
wrong?
I
have shell access.
Thanks _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Basically, think about it this way: There is a reason why mySQL comes with functions to repair tables and databases and why phpMyAdmin (for example) offers an easy way to use them. It is like brushing your teeth. Do it regularly. Errors happen, don't let them add up.
But you might want to try and find out what causes the corruption: Did you get the mySQL error message before you repaired (so you could try and track down what caused the error)? Is there some error log you could now still look at?
The errors can occur because of hardware problems on the database server. Hosters like to run their machines to death before they replace them. It could also be a software bug in the mySQL code. Or you are doint administration on a live table (one that at the same time is being accessed by other users like your web server). etc. If you can find the culprit, you might have an option to avoid future corruption.
If you cannot find the error, consider moving your database to a new server. In a hosting environment, simply "order" a new database through the adminstration panel, copy the data, and point your wiki to the new database. Then see if this works better. But might of course work worse ...
And (first of all): Set up a cronjob to dump your database on a regular basis so whatever happens you won't loose your data. Kind of like this:
* * * * * mysqldump db_name -u username -ppassword > /home/username/backup.sql
or have the cronjob call a script (.php, .sh, whatever) to do different stuff like change the name of the dump etc.
My host said my tables were corrupted. So I repaired the database and it fixed the issue. Strange?
On Thu, Feb 12, 2009 at 12:05 PM, Manfred Kooistra manfred.kooistra@gmx.dewrote:
If you are on a shared server, or, as in many hosting situations even when you have your own server, you are on a shared database server, it might well be another website that is bringing that shared database server down.
Anyway, we'll see what your provider comes up with.
I haven't changed any php except small changes to LocalSettings.php last week, but it was nothing related to this.
My traffic hat not spiked recently but I do have my host looking at the issue. Thanks for the tips.
Anything else on the issue would be appreciated.
On Thu, Feb 12, 2009 at 11:43 AM, Manfred Kooistra manfred.kooistra@gmx.dewrote:
Line 826 (in my code) is this:
$s = $dbr->selectRow( 'user', '*', array( 'user_id' => $this->mId ), __METHOD__ );
it appears to be related to a mySQL query. Usually the error you get in PHP means that some variable, that you try to work with, has not been set or is FALSE, e.g. $dbr.
Reading about the connection error you get in phpMyAdmin, I'd guess that PHP encounters the same, when it tries to connect to your database and fill the variable. So I'd begin looking at your DB, _if_ you are sure that you have not changed anything in your PHP code!
I don't know much about Apache and stuff, but I had a big problem once when due to a listing in some very popular web catalogue I suddenly recieved thousands of hits a day (compared to maybe 100 the day before). The increase in traffic was so intense that it brought my DB down. I solved the problem with making all pages static. This was possible on that website, simply by having a cronjob execute once each night and build all pages from the database. But that website was not a wiki, with user contribution. Anyway ...
... try and find out about the performance of your database. I don't know how, I had someone look at the logs and interpret them for me, and he installed a small script that recorded what happened on the database server etc., so maybe start with calling your provider and ask them about _their_ server and tell them that you see performance problems.
Hope all this bla bla helps you!
~ Manfred
Hey all,
About one every 5 page views mediawiki throws this error:
Fatal error: Call to a member function selectRow() on a non-object in User.php on line 826
I have not recently upgraded. I have been on version 1.13.3 since it
was
released. The site was working fine until this morning and rebooting
mySQL
didn't help. I also get a connection error every couple of loads if I
click
through my databases in phpmyadmin. Does anyone know what could be
wrong?
I
have shell access.
Thanks _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Manfred Kooistra wrote:
And (first of all): Set up a cronjob to dump your database on a regular basis so whatever happens you won't loose your data. Kind of like this:
- mysqldump db_name -u username -ppassword > /home/username/backup.sql
Shouldn't at least one of those * be different? As it is, it would be started every minute...
Ha, yeah, sure, I was just giving the structure and did not want to specify a time. You would of course need to replace this like you would need to replace everything else (e.g. "username"). I just wanted to give an idea for research, not a finished solution (which I cannot give, not knowing the specifics). I would dump once every day, but on a site with very little traffic once a week may be enough, while a site with very heavy traffic or a large database might want to dump individual tables separately (so as not to have huge dumps or exceed execution time limits) ...
I, personally, would have the cronjob call an .sh script that gives a unique name based on the date to each dump and deletes old dumps after a certain time (maybe 90 days).
Manfred Kooistra wrote:
And (first of all): Set up a cronjob to dump your database on a regular basis so whatever happens you won't loose your data. Kind of like this:
- mysqldump db_name -u username -ppassword > /home/username/
backup.sql
Shouldn't at least one of those * be different? As it is, it would be started every minute...
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Actually there are programs which do that.
But that's beside the point. There are also programs out there which optimize databases server wide. Don't know anymore where I found them, but I have them installed on my servers.
At 12:32 AM 2/14/2009, you wrote:
Ha, yeah, sure, I was just giving the structure and did not want to specify a time. You would of course need to replace this like you would need to replace everything else (e.g. "username"). I just wanted to give an idea for research, not a finished solution (which I cannot give, not knowing the specifics). I would dump once every day, but on a site with very little traffic once a week may be enough, while a site with very heavy traffic or a large database might want to dump individual tables separately (so as not to have huge dumps or exceed execution time limits) ...
I, personally, would have the cronjob call an .sh script that gives a unique name based on the date to each dump and deletes old dumps after a certain time (maybe 90 days).
Manfred Kooistra wrote:
And (first of all): Set up a cronjob to dump your database on a regular basis so whatever happens you won't loose your data. Kind of like this:
- mysqldump db_name -u username -ppassword > /home/username/
backup.sql
Shouldn't at least one of those * be different? As it is, it would be started every minute...
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_ _ (o) (o) oOOO----(_)----OOOo--- Henny (Lee Hae Kang) ----------------------------- http://www.henny-savenije.pe.kr Portal to all my sites http://www.hendrick-hamel.henny-savenije.pe.kr (in English) Feel free to discover Korea with Hendrick Hamel (1653-1666) http://www.hendrick-hamel.henny-savenije.pe.kr/indexk2.htm In Korean http://www.hendrick-hamel.henny-savenije.pe.kr/Dutch In Dutch http://www.vos.henny-savenije.pe.kr Frits Vos Article about Witsen and Eibokken and his first Korean-Dutch dictionary http://www.cartography.henny-savenije.pe.kr (in English) Korea through Western Cartographic eyes http://www.hwasong.henny-savenije.pe.kr Hwasong the fortress in Suwon http://www.oldKorea.henny-savenije.pe.kr Old Korea in pictures http://www.british.henny-savenije.pe.kr A British encounter in Pusan (1797) http://www.genealogy.henny-savenije.pe.kr/ Genealogy http://www.henny-savenije.pe.kr/phorum Bulletin board for Korean studies
Okay, me again. I don't want to be secretive, so here's my solution for my situation. You may find this useful.
My cronjobs: (I have a lot of cronjobs and have used comments to visually structure the crontab file. What you see is only a part.)
############################################ # delete # all backups older than 30 days # each night at 3:00 # 0 3 * * * find /path/to/your/webspace/website_folder/protected_folder/ backups -ctime +30 -exec rm -f {} ; # ############################################ # write # a database backup # each night at 3:20 # 20 3 * * * /path/to/your/webspace/website_folder/protected_folder/ cronjob_subfolder/dailydump.sh ############################################
The file "dailydump.sh":
#!/bin/sh DATENAME=`date +%Y%m%d` BASENAME="/path/to/your/webspace/website_folder/protected_folder/backups/ db_${DATENAME}.sql" /usr/bin/mysqldump -hdatabaseserver -udatabaseuser -pdatabasepassword databasename > ${BASENAME}
I hope the mail program does not break the lines. Each of the two cron instruction is one line, and the .sh file consists of four lines. And please note "-h" (for "host"), "-u" and "-p" in front of the host address, username and password _without_ space!
Adapt and enjoy!
mediawiki-l@lists.wikimedia.org