Reaching out to others! Contact for Consulting on Infrastructure Management, Solutioning, Cloud Support etc..

Fix: MediaWiki Internal error

We were (myself and hpn) hit by a strange error (atleast for us ;) ) while we started putting up sampada media wiki onboard from backup. Wiki didn’t load for which we were using MySQL InnoDB tables. Dumping some other old database backup also didn’t help.

Here is what we were greeted with on the browser:

MediaWiki internal error.
Original exception: exception ‘DBQueryError’ with message ‘A database error has occurred Query: SELECT value,exptime FROM `wiki_objectcache` WHERE keyname=’techfizn_wiki1-wiki_:messages-hash’ Function: MediaWikiBagOStuff::_doquery Error: 1146 Table ‘techfizn_wiki1.wiki_objectcache’ doesn’t exist (localhost) ‘ in /home/techfizn/public_html/projects/wiki/includes/Database.php:824 Stack trace:
0 /home/techfizn/public_html/projects/wiki/includes/Database.php(779): Database->reportQueryError(‘Table ‘techfizn…’, 1146, ‘SELECT value,ex…’, ‘MediaWikiBagOSt…’, false)
1 /home/techfizn/public_html/projects/wiki/includes/BagOStuff.php(405): Database->query(‘SELECT value,ex…’, ‘MediaWikiBagOSt…’)
2 /home/techfizn/public_html/projects/wiki/includes/BagOStuff.php(300): MediaWikiBagOStuff->_doquery(‘SELECT value,ex…’)
3 /home/techfizn/public_html/projects/wiki/includes/BagOStuff.php(234): SqlBagOStuff->_query(‘SELECT value,ex…’, ‘techfizn_wiki1-…’)
4 /home/techfizn/public_html/projects/wiki/includes/MessageCache.php(205): SqlBagOStuff->get(‘techfizn_wiki1-…’)
5 /home/techfizn/public_html/projects/wiki/includes/MessageCache.php(441): MessageCache->load()
6 /home/techfizn/public_html/projects/wiki/includes/GlobalFunctions.php(467): MessageCache->get(‘mainpage’, true, true)
7 /home/techfizn/public_html/projects/wiki/includes/GlobalFunctions.php(421): wfMsgGetKey(‘mainpage’, true, true, true)
8 /home/techfizn/public_html/projects/wiki/includes/GlobalFunctions.php(368): wfMsgReal(‘mainpage’, Array, true, true)
9 /home/techfizn/public_html/projects/wiki/includes/Title.php(268): wfMsgForContent(‘mainpage’)
10 /home/techfizn/public_html/projects/wiki/includes/Wiki.php(92): Title::newMainPage()
11 /home/techfizn/public_html/projects/wiki/index.php(58): MediaWiki->checkInitialQueries(NULL, ‘view’, Object(StubObject), Object(WebRequest), Object(StubContLang))
12 {main}
Exception caught inside exception handler: exception ‘DBUnexpectedError’ with message ‘Error in fetchObject(): Table ‘techfizn_wiki1.wiki_page’ doesn’t exist (localhost)’ in /home/techfizn/public_html/projects/wiki/includes/Database.php:953 Stack trace:
0 /home/techfizn/public_html/projects/wiki/includes/MessageCache.php(314): Database->fetchObject(false)
1 /home/techfizn/public_html/projects/wiki/includes/MessageCache.php(251): MessageCache->loadFromDB()
2 /home/techfizn/public_html/projects/wiki/includes/MessageCache.php(441): MessageCache->load()
3 /home/techfizn/public_html/projects/wiki/includes/GlobalFunctions.php(467): MessageCache->get(‘databaseerror’, true, false)
4 /home/techfizn/public_html/projects/wiki/includes/GlobalFunctions.php(421): wfMsgGetKey(‘databaseerror’, true, false, true)
5 /home/techfizn/public_html/projects/wiki/includes/Exception.php(23): wfMsgReal(‘databaseerror’, Array)
6 /home/techfizn/public_html/projects/wiki/includes/Database.php(276): MWException->msg(‘databaseerror’, ‘Database error’)
7 /home/techfizn/public_html/projects/wiki/includes/Exception.php(125): DBQueryError->getPageTitle()
8 /home/techfizn/public_html/projects/wiki/includes/Exception.php(88): MWException->htmlHeader()
9 /home/techfizn/public_html/projects/wiki/includes/Exception.php(111): MWException->reportHTML()
10 /home/techfizn/public_html/projects/wiki/includes/Exception.php(191): MWException->report()
11 /home/techfizn/public_html/projects/wiki/includes/Exception.php(225): wfReportException(Object(DBQueryError))
12 [internal function]: wfExceptionHandler(Object(DBQueryError))
13 {main}

Fix: InnoDB engine works with 3 files in mysql data folder. ib_logfile0 and ib_logfile1 for logs and for data storage it uses ibdata1.

-rw-rw—- 1 mysql mysql 5242880 Oct 27 21:52 ib_logfile0
-rw-rw—- 1 mysql mysql 5242880 Oct 27 21:52 ib_logfile1
-rw-rw—- 1 mysql mysql 44040192 Oct 27 21:52 ibdata1

To resolve the above issue we removed the log files and restarted the MySQL to get going quickly with our mediawiki installation. Hope this saves few hours for others facing the same problem.


My debian days…



I had dedicated few days of past few weeks for Debian in search of stable, secure and reliable solutions.  With Debian, I ended up finding robust solutions for lots of questions which we had while setting up LAN resources.

Debian net install CD which weighed around 160MB was more than enough to get started. I could setup RAID1 for disks to ensure quick and easy data recovery incase of disk failures. Installed Apache, PHP, Mysql for Intranet, NIS for centralized network authentication, NFS for network mounts and centralized home directories for users, Quota to ensure we don’t run out of disk space etc. It was fast and yet stable. I could find the solutions for various issues which I faced during the installation very quickly (there were very few issues though). Extensive documentation found on the internet made it easy for me and my collegues to get on with complex configurations. We could easily integrate debian into our heterogenious OS environment and network.

I will be adding articles related to Debian to my blog in coming days. That  should make it much more easier for you all to find solutions for your questions. Do comment and let me know if you have any unanswered questions with debian. I would be happy to dig deep into those issues and update you.

Debian – apt-on to get it

It’s all about FREEDOM


Tune and Optimize MySQL performance

While working with live servers, its very important to ensure that the services which are running on them are tweaked and tuned for optimized performance. Same thing applies to MySQL, which is the back bone of many websites. One of the tools which I have been using for quite a some time to understand and optimize MySQL servers which I have been managing is MySQLTuner. This helps me quite a lot in database optimization by cross checking the mysql resource usage, server hardware information etc.

MySQLTuner is a high-performance MySQL tuning script written in perl that will provide you with a snapshot of a MySQL server’s health. Based on the statistics gathered, specific recommendations will be provided that will increase a MySQL server’s efficiency and performance. The script gives you automated MySQL tuning that is on the level of what you would receive from a MySQL DBA.

Installation and Requirements:
The script is a basic Perl script that has no additional requirements. At this time, MySQLTuner is compatible with Linux/Unix based operating systems with Perl 5.6 or later. MySQL versions 3.23 and later are supported by the script.

To get started, simply download MySQLTuner and make it executable:

# wget
# chmod +x
# ./

MySQLTuner is offered completely free, and is distributed under the GPL.


  • NEW! Remote server checks: Connects to remote servers to perform tests.
  • NEW! Convenient MySQL logins: MySQLTuner will automatically log in to MySQL on servers running Plesk, servers with ~/.my.cnf files, and server without MySQL root passwords. If you need to authenticate manually, you can pass the username and password on the command line or provide the credentials interactively.
  • NEW! Manually set memory sizes: Users on virtual environments can now specify how much RAM and swap memory are present so that the script’s calculations will be accurate.
  • Memory Usage: Calculates MySQL memory usage at max load and makes recommendations for increasing or decreasing the MySQL memory footprint. Per-thread and server-wide buffer data is calculated separately for an accurate snapshot of the server’s configuration.
  • Slow Queries: Reviews the amount of slow queries relative to the total queries. Slow query time limits are also analyzed and recommendations are made.
  • Connections: Current and historical connection counts are reviewed.
  • Key Buffer: Takes configuration data and compares it to the actual indexes found in MyISAM tables. Key cache hit rates are calculated and variable adjustments are suggested.
  • Query Cache: Query cache hit rates and usage percentages are used to make recommendations for the query cache configuration variables.
  • Sorting & Joins: Per-thread buffers that affect sorts and joins are reviewed along with the statistics from the queries run against the server.
  • Temporary Tables: Variable recommendations are made to reduce temporary tables that are written to the disk.
  • Table Cache: Compares total tables opened to the currently open tables. Calculates the table cache hit rate in order to make suggestions.
  • Open Files: Determines if the server will approach or run into the open file limit set by the operating system or the MySQL server itself.
  • Table Locks: Finds table locking that forces queries to wait and makes suggestions for reducing locks that require a wait.
  • Thread Cache: Calculates how many times MySQL must create a new thread to respond to a query.
  • Aborted Connections: Finds applications that are not closing connections to MySQL properly.
  • Read/Write Ratios: Calculates the percentage of read and write operations on your MySQL installation.

Try it out today! If you think you have done this all I have one more last bit of information.

Optimizing the database regularly will also help you run the server fast! Put the following line in cron.

mysqlcheck -o --all-databases

OpenSource India Week

I was able to peep into this event on 11th and 12th here in IISc Bangalore. I was wondering what Microsoft has got to say about its OpenSource initiatives. Also it Sundip Menon from Novel made it clear why Novell really joined its hands with Microsoft in CTOSummit. “OSIW-2008″ its just awesome! I got to learn whats really happening out there in the world of OpenSource in India.

OSIW is just a new name adopted by “LinuxAsia” – India’s biggest OpenSource Event. I think it really made lot more sense. Its being held across three cities New Delhi, Mumbai and Bangalore till 15th FEB. It was really needed to show off what Indians are contributing to OpenSource community and how Indians can do lot more with it.

Read this Deccan Herald News which updates you on “OpenSource Breaking Barriers“. Two business models coming up together to bring in new innovations ;) lol, yes OpenSource has got lot in it. You will explore it when you read through this news. Co-existence of Microsoft’s Proprietary model and OpenSource model have brought healthy competition in the world.

WorkShops, CTOSummit, Talks about technopreneurship, Expo, IT Admin and IT Developer tracks did help people from different streams to explore new advancements and event was really very interesting. It would have been better if it was conducted during the weekends.

I got benefited by Mysql session conducted by David Axmer (Co-Founder Mysql) and Brian Arker and Panel talk on Virtualization at CTOSummit. Collabnet, Mysql, Knoppix founders really brought in their real stories to tell us what made them “billion dollar babies

Cheers… World will see us growing big every day, Come on India you too can make more money with OpenSource ;)

OSIWeek Website