Ubuntu Jaunty Jackalope on Berlin metro system

Again I am happy to announce, that Berliner Fenster, the company behind the Berlin metro tv advertisement system, viewed by approx. 1.5 million people a day, was so kind of providing Ubuntu and Ubuntu Berlin with a spot for the release of Ubuntu Jaunty Jackalope and the release party hosted by Ubuntu Berlin at c-base:

If you cannot see the embedded spot, click on this link.

The spot runs for three days, showing Ubuntu to a remarkable amount of passengers.

Please note: The background image is from Marvin Kubiak, you can find it among other interesting Jaunty background images on:

https://wiki.ubuntu.com/Artwork/Incoming/Jaunty/AlphaBackgrounds

Happy release!

What do director Tom Tykwer and Ubuntu have in common?

What do director Tom Tykwer (“The International“) and Ubuntu have in common? Well, they seem to share the same passion for commitment in developing countries by focusing on media. This similarity came up when I read the schedule for the one day conference “Jour Fixe – media and development“.

While the first talk, held by Andrea Goetzke und Geraldine de Bastion from newthinking communications, titled “Ubuntu and the free toaster“, deals with free software and digital culture in Africa, the second talk, held by director Tom Tykwer and titled “The Making of Soulboy. A movie production in the slums of Nairobi“, deals with a movie project in Nairobi (and Tom Tykwers engagement in artistic education for youngsters in Africa with the ngo “one fine day”).

The “Jour Fixe” is scheduled for this Friday, the 24th of April, and takes place at “Hamburger Bahnhof” in Berlin/Germany. As I’m going to attend the conference, I’ll try to report back a short resume. Please note that there are more interesting talks besides Ubuntu/Tykwer – I just wanted to point out the interesting coincidence.

possibly scrambled qt4 apps in Ubuntu Jaunty Jackalope while using VRGB and LCD

In less than 48 hours Ubuntu Jaunty Jackalope will be released officially! While using Jaunty for more than a month I am pleased to see this great new release getting it’s way to a huge usership. While preparing my small “new features in Ubuntu Jaunty Jackalope” talk for the “Ubuntu Berlin” release party at c-base, I’d like to point out one open bug, that will make it into the release and might get some users into strange trouble:

When you have – for whatever reason (either by chance, clicking around or due to having a rotated display) – changed the display mode of Ubuntu to VRGB or VBGR (you can easily do this in the “System>Preferences>Appearance>Fonts” menu) and additionaly turned on the lcd/subpixel mode, probably all of your qt4 applications – even qtconfig – will be totatlly scrambled and unreadable. The bug might hit you under Ubuntu (without a blue “K” in the beginning) as you probably run something like VirtualBox, Skype or even Amarok in your Gnome environment. It will probably look like this:

Screenshot showing the scrambled qt application
Screenshot showing the scrambled qt application

But: Don’t panic! This bug only occurs when you changed some defaults in the Appearance/Fonts settings to rather uncommon or often maybe useless settings and switching back is fairly easy. But as I ran into this and put some effort into the corresponding bug on launchpad Subpixel/Lcd mode with VRGB/VBGR makes qt4 applications on Jaunty unreadable, I noticed, that a remarkable bunch of users posted duplicate bug reports or commented the report.

So if you are running into this error, all you have to do, is:

  1. exit all qt applications,
  2. go into “System>Preferences>Appearance>Fonts”,
  3. change VRGB/BGR to RGB/BGR.

That’s all. If you want to examine the bug, do the following (don’t do this at home):

  1. exit all qt applications,
  2. go into “System>Preferences>Appearance>Fonts”,
  3. change RGB/BGR to VRGB/BGR,
  4. switch to lcd/subpixel mode.

Afterwards your qt applications will look scrambled. If you don’t know, which one to run for a test, you probably have “qtconfig” installed.

(I had a little chat with some developers about the severity of this bug. Though I think it’d would be definitely better not having it in a release, I understand the point, that the environment must be set up in a rather special way to run into this and it popped up quite late. Therefore it did not make it into the release critical bugs, but I am quite sure, it will be fixed soon.)

That’s all about this. I wish you a smooth upgrade to Jaunty – see you there :)

[update 2009-04-03]

As you can read on https://bugs.launchpad.net/ubuntu/+source/qt4-x11/+bug/334657, a patch has been committed to the Ubuntu repositories, that has been found here:

http://cvs.fedoraproject.org/viewvc/rpms/qt/devel/qt-x11-opensource-src-4.5.0-disable_ft_lcdfilter.patch?revision=1.1&view=markup

So the fix as an update is coming closer…

A quick note on MySQL troubleshooting and MySQL replication

PLEASE NOTE: I am currently reviewing and extending this document.

While caring for a remarkable amount of MySQL server instances, troubleshooting becomes a common task. It might of interest for you which

Recovering a crashed MySQL server

After a server crash (meaning the system itself or just the MySQL daemon) corrupted table files are quite common. You’ll see this when checking the /var/log/syslog, as the MySQL daemon checks tables during its startup.

Apr 17 13:54:44 live1 mysqld[2613]: 090417 13:54:44 [ERROR]
  /usr/sbin/mysqld: Table './database1/table1' is marked as
  crashed and should be repaired

The MySQL daemon just told you that it found a broken MyISAM table. Now it’s up to you fixing it. You might already know, that there is the “REPAIR” statement. So a lot of people enter their PhpMyAdmin afterwards, select database and table(s) and run the REPAIR statements. The problem with this is that in most cases your system is already in production – for instance is up again and the MySQL server already serves a bunch of requests. Therefore a REPAIR request gets slowed down dramatically. Consider taking your website down for the REPAIR – it will be faster and it’s definitely smarter not to deliver web pages based on corrupted tables.

The other disadvantage of the above method is, that you probably just shut down your web server and your PhpMyAdmin is down either or you have dozens of databases and tables and therefore it’s just a hard task to cycle through them. The better choice is the command line in this case.

If you only have a small number of corrupted tables, you can use the “mysql” client utility doing something like:

$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.0.75-0ubuntu10 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> REPAIR TABLE database1.table1;
+--------------------+--------+----------+----------+
| Table              | Op     | Msg_type | Msg_text |
+--------------------+--------+----------+----------+
| database1.table1   | repair | status   | OK       |
+--------------------+--------+----------+----------+
1 row in set (2.10 sec)

This works, but there is a better way: First, using OPTIMIZE in combination with REPAIR is suggested and there is a command line tool only for REPAIR jobs. Consider this call:

$ mysqlcheck -u root -p --auto-repair --check --optimize database1
Enter password:
database1.table1      OK
database1.table2      Table is already up to date

As you see, MySQL just checked the whole database and tried to repair and optimize it.

The great deal about using “mysqlcheck” is, that it can also be run against all databases in one run without the need of getting a list of them in advance:

$ mysqlcheck -u root -p --auto-repair --check --optimize \
  --all-databases

Of course you need to consider if an optimize of all your databases and tables might just take too long if you have huge tables. On the other hand a complete run prevents of thinking about a probably missed table.

[update]

nobse pointed out in the comments, that it’s worth having a look at the automatic MyIsam repair options in MySQL. So have a look at them if you want to automate recovery:

option_mysqld_myisam-recover

Recovering a broken replication

MySQL replication is an easy method of load balancing database queries to multiple servers or just continuously backing up data. Though it is not hard to setup, troubleshooting it might be a hard task. A common reason for a broken replication is a server crash – the replication partner notices that there are broken queries – or even worse: the MySQL slave just guesses there is an error though there is none. I just ran into the latter one as a developer executed a “DROP VIEW” on a non-existing VIEW on the master. The master justs returns an error and ignores. But as this query got replicated to the MySQL SLAVE, the slave thinks it cannot enroll a query and immediately stopped replication. This is just an example of a possible error (and a hint on using “IF EXISTS” as often as possible).

Actually all you want to do now, is telling the slave to ignore just one query. All you need to do for this is stopping the slave, telling it to skip one query and starting the slave again:

$ mysql -u root -p
mysql> STOP SLAVE;
mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
mysql> START SLAVE;

That’s all about this.

Recreating databases and tables the right way

In the next topic you’ll recreate databases. A common mistake when dropping and recreating tables and databases is forgetting about all the settings it had – especially charsets which can run you into trouble later on (“Why do all these umlauts show up scrambled?”). The best way of recreating tables and databases or creating them on other systems therefore is using the “SHOW CREATE” statement. You can use “SHOW CREATE DATABASE database1″ or “SHOW CREATE TABLE database1.table1″ providing you with a CREATE statement with all current settings applied.

mysql> show create database database1;
+-----------+--------------------------------------------------------------------+
| Database  | Create Database                                                    |
+-----------+--------------------------------------------------------------------+
| database1 | CREATE DATABASE `database1` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+-----------+--------------------------------------------------------------------+
1 row in set (0.00 sec)

The important part in this case is the “comment” after the actual create statement. It is executed only on compatible MySQL server versions and makes sure, your are running utf8 on the database.

Keep this in mind and it might save you a lot of trouble.

Fixing replication when master binlog is broken

When your MySQL master crashes there is a slight chance that your master binlog gets corrupted. This means that the slaves won’t receive updates anymore stating:

[ERROR] Slave: Could not parse relay log event entry. The possible reasons are: the master’s binary log is corrupted (you can check this by running ‘mysqlbinlog’ on the binary log), the slave’s relay log is corrupted (you can check this by running ‘mysqlbinlog’ on the relay log), a network problem, or a bug in the master’s or slave’s MySQL code. If you want to check the master’s binary log or slave’s relay log, you will be able to know their names by issuing ‘SHOW SLAVE STATUS’ on this slave. Error_code: 0

You might have luck when only the slave’s relay log is corrupted as you can fix this with the steps mentioned above. But a corrupted binlog on the master might not be fixable though the databases itself can be fixed. Depending on your time you try to use the “SQL_SLAVE_SKIP_COUNTER” from above but actually the only way is to setup

Setting up replication from scratch

There are circumstances forcing you to start replication from scratch. For instance you have a server going live for the first time and actually all those test imports don’t need to be replicated to the slave anymore as this might last hours. My quick note for this (consider backing up your master database before!)

slave: STOP SLAVE;
slave: RESET SLAVE;
slave: SHOW CREATE DATABASE datenbank;
slave: DROP DATABASE datenbank;
slave: CREATE DATABASE datenbank;

master: DROP DATABASE datenbak;
master: SHOW CREATE DATABASE datenbank;
master: CREATE DATABASE datenbank;
master: RESET MASTER

slave: CHANGE MASTER TO MASTER_USER="slave-user", \
MASTER_PASSWORD="slave-password", MASTER_HOST="master.host";
slave: START SLAVE

You just started replication from scratch, check “SHOW SLAVE STATUS” on the slave and “SHOW MASTER STATUS” on the master.

Deleting unneeded binlog files

Replication needs binlog files – a mysql file format for storing database changes in a binary format. Sometimes it is hard to decide how many of the binlog files you want to keep on the server possibly getting you into disk space trouble. Therefore deleting binlog files that have already been transferred to the client might be a smart idea when running low on space.

First you need to know which binlog files the slave already fetched. You can do this by having a look on “SHOW SLAVE STATUS;” on the slave. Now log into the MySQL master and run something like:

mysql> PURGE BINARY LOGS TO 'mysql-bin.010';

You can even do this on a date format level:

mysql> PURGE BINARY LOGS BEFORE '2008-04-02 22:46:26';

Conclusion

The above hints might save you same time when recovering or troubleshooting a MySQL server. Please note, that these are hints and you have – at any time – make sure, that your data has an up to date backup. Nothing will help you more.

And your favorite new feature in Jaunty Jackalope is … ?

Again I’ll present a short new features from the next Ubuntu release (this time “Jaunty Jackalope”) to an audience of about 150 to 200 visitors at the upcoming traditional “Ubuntu release party” at c-base organized by “Ubuntu Berlin”. While it’s worth noting that this event will happen on Saturday, the 25th of April, so when the release is still a hot topic, and the very friendly guys from “Berliner Fenster“, the local metro television system, are going to support release and release party by sponsoring spots, I am curious about the new features in Jaunty Jackalope that you like emphazise – be it a litte eye candy or, a command line tool or a major innovation.

After using Jaunty for about a month now I think the graphical changes really please my eyes. I like the new notification scheme (though it feels still young and there is a lot to do like implementing it to common applications like Thunderbird), introduced by Mark Shuttleworth some months ago. Moreover while not currently using Evolution myself I am impressed about reading about “evolution-mapi“, enabling Evolution to access Exchange 2000, 2003 and 2007 servers by talking the native Exchange mapi protocol and and not using the neat but slow owa (web) wrapper. Yes, that seems to be a techie feature but it might improve acceptance of Ubuntu/Gnome/Evolution in enterprise setups dramatically.

Your turn now. What is your new killer feature or just tiny improvement you like most? Let me know, and I promise, I’ll try to include it into my presentation.