Drupal and searching

I ran into a problem this week where the Drupal cron job wasn't running to completion. The cause of this appeared to be in the search module - disable it and cron ran; turn it back on and cron failed. Since people probably do want to search for stuff on the site this meant digging into the Drupal 6.1.5 source.

The first port of call was the search_cron() routine in search.module. Adding an echo statement at the start and end showed that only the former was being displayed. This implied that somewhere further down the chain was causing the process to exit. I then added an echo statement to show which hook_update_index routine was causing the problem. It turned out to be the one in node.module. From there it was a case of finding the node id with the issue. Running domainname/?=node/nodeid for one of the IDs showed a blank page where a picture node was expected to be. I tried removing this node in the Administer content section but it refused to go away.

This meant removing that record from the node and node_revisions table using phpMyAdmin. The cron job then ran perfectly with the re-enabled search module.

I have no idea how the problem node became corrupted. I'm a little worried how it terminated the generation of the search index with no obvious warning (and I couldn't see anything in error_log) but I'm now aware of the impact bad nodes can have.

Aiming For The Good Life

I'm currently a member at my local Fitness First gym. I've suffered the usual problems this brings (pushy sales assistants and the priority the chain places on money which sees it commonly referred to as Finance First) but I get good value for money from it given the number of classes I attend each week. A few days ago I scored a free pass to a nearby Goodlife gym through a PT I know who works there so I thought I'd take a look.

It didn't start too well as those in reception decided I was a potential member and immediately sent out a 'membership consultant'. I've been around a while and so can deal with the hard sell (the phrase "no, thank you" is incredibly powerful) but played along with it at first until rescued by the PT (tip for gyms: be less rapacious in this situation and you'll get a better reputation - and probably more sign-ups). I did ask for a tour around the place and found the facility to be far better than my current gym. Cleaner and brighter were the first two words that sprang to mind. Having windows on to the outside world brings in natural light which provides a very different feel from my current one which is in a former cinema. The layout seemed a lot better with the free weights section being placed upstairs at the far end of the space. That keeps the noise down - a big problem at my current gym which has the free weights right in the middle. It appears that almost every participant will be able to lift a weight but not get it back down closer than three feet to the floor before deciding that gravity can do the rest. The noise hits every other room in the place. This is especially annoying if you're in the meditation track of a BodyBalance class and have to suffer the sound of a random crump caused by people who are too bloody inconsiderate (and weak) to place a weight gently on the floor.

I did a couple of classes while there. The Pump one had the regular instructor missing and so had in a cover - who is my usual instructor at my current gym. Same good workout but in a much larger studio than I'm used to working in. Interestingly there were far fewer people in the class than turn up for my gym. I then did the class afterwards, reunited with my former boxing partner who had swapped to that gym a while back. It was as if we'd never been away as we spent more time laughing and piss-taking than actually punching. The instructor had previously taught at my current gym - as had the following one (although I didn't stay for that class). Overall I found the Goodlife gym to feel a happier and more social place. It's the vibe of the thing, your Honour.

Despite all this (and it being a couple of dollars cheaper a week) I decided to stick with Finance First for now. The main issue was the range and frequency of classes. These are the predominant reason I attend the gym (I'm a bit of a Les Mills junkie) and Goodlife was missing some of the strands I enjoy and had others on at times that I couldn't make. There are also some excellent instructors at my current gym and they are what make the classes worthwhile. When you get a really good one you don't want to risk going somewhere else if there's a chance they may not reach those heights. That's not to say they won't; it's just that you never know until you get there.

Next day I got a call from the membership consultant. I told him I was impressed with the place but that the issue with the classes was the reason I wouldn't switch - for the time being at least. I can see how they would be a great choice for people joining a gym for the first time. The advantage for all is that they provide competition for my current gym - and the consumer can only benefit when that happens.

The Go-Slow G5

I have an iMac G5 bought back in the day. It currently sits in my living room and is used mainly for the basics of email, RSS newsreader, newsgroups (yes, they still exist), browsing and remote speakers (using Airfoil). I used to use it for iTunes and iPhoto but moved them to the more powerful office machine when they started to become very frustrating to use as they became glacially slow. Despite removing them the G5 kept getting slower while the fans kept getting louder. Recently the dreaded random sleep appeared.

The first release of the G5 was not Apple's finest hour in manufacturing quality. The capacitor issue affected many makers and mine ended up with a new motherboard thanks to that. The people doing the work then managed to break the DVD drive (requiring yet another replacement) but let's not dwell on their stupidity. Earlier this week I was reading email and the machine went to sleep. Moving the mouse caused it to wake up. A minute later it went to sleep again. I checked to ensure that I didn't have any sleep corners defined in System Preferences (it went to sleep while I was doing so). A quick Google (involving three machine sleeps) indicated it was either a power supply issue but one suggested it might be related to ventilation.

I unplugged the machine, laid a towel on the bench and placed the G5 face-down on it. There are three captured screws at the bottom which allows the entire back to be removed as soon as they are unlocked. There was a small bit of dust spread around but the noticeable item was the huge furball of lint that sat near the bottom. On the G5 there is a small air vent just below where the power cord plugs in that is where a lot of the air required for cooling comes in. The mass of lint was blocking the space between the vent and the motherboard. Removing that and giving the rest a quick going over with the vacuum provided a working machine again. Using the iStat widget I can see that fans are running thousands of RPM below their previous levels and the internal temperatures are 15-20 degrees lower. The machine is responsive and usable once again.

As someone who writes software for a living this merely supports my belief that the only computer problems are hardware ones.

Syndicate content