Posts Tagged ‘plone’

The Case of The Phantom Data.fs

Tom Blockley - January 27th, 2011

It’s rare that I’m moved to write a blog post about something that happens to me while I’m at work. This is mostly because I assume everybody in the world who uses Plone has had the same problems before. Once in a while though you come across something that it seems like you really should be sharing with the world.

Zeoserver will continue to ‘function’ normally even without a Data.fs and regardless of zeoclient restarts.

This happened to us recently. Now I’m sure that this is not something that you will come across very frequently, if at all. However, if you do have this happen to you, the consequences could be disastrous.

So how did you find that out and what triggered it?

Here’s a hypothetical situation for you – let’s imagine that you are developing on a site and you have made some changes to some of the products that you use in that site. It comes time to try installing these new products, so you make a backup of your Data.fs (sensible, well done!) and then you re-buildout, and restart your zeoclient instances one by one, to avoid downtime.

You reinstall your products and add some data into the site, looking out for problems. UH-OH! Something unexpected has happened and you need to roll back!

You roll-back your buildout, replace your Data.fs with that backup you cleverly made earlier, and restart your zeoclient instances. JOY! Your site is back to how it was before, nothing is broken and everything is totally fine. Phew! That was close.

So you carry on working, data gets entered into your site and life goes on. Now at some point in the future, you hit a situation which requires you to restart your ENTIRE site. Zeoclients and Zeoserver. You do so, and when you restart your instances, suddenly you have been flung back in time! All the information you entered into your site since that rollback has disappeared! WTF?!

There were no clues in the system that this was going to happen:

  1. Your transaction log / undo history were all running fine and recording what had happened
  2. You weren’t getting any errors whenever you saved data to the system
  3. You zeoclients were restarting fine

Maybe. Maybe, if you were running backups using repozo you might have noticed that the diffs were not as you might expect, but that system works, it’s just there in case of emergency right? Well all that time, your repozo has been backing up the restored backup of the database, but your zeoserver has been storing everything to a patch of hard drive which was being held by the now non-existent Data.fs that you replaced when rolling back.

What can I do?

Nothing. Unless you get very lucky, scraping your hard drive, you wont recover that information. You’ll have to put it all in again.

The Lesson?

If you ever have to replace your Data.fs, restart your zeoserver as soon as you do so.

Here’s a picture we drew:

2011 01 27 18.40.22 The Case of The Phantom Data.fs

A diagram of a disappearing Data.fs


Just a bunch of buildout changes

Matt Wilkes - July 15th, 2008

You may have noticed that version 0.2 of Malthe Borch’s truly excellent JBOT came out last night.  We use this in some of our themes, and hence has found its way in as a dependency for a good deal of our recent projects.

I ran development buildout last night and suddenly saw a lot of zope 3 components being downloaded, which if you’ve done it before you know is a recipe for disaster.

It seems one of the new features in version 0.2 (aside from the long-anticipated browser layer support) is it now correctly defines its dependencies.  This is a Good Thing™ but it does mean that JBOT now requires you to use fake-zope-eggs in your buildout.

Your zope2install section now needs to look like this:

[zope2]
recipe = plone.recipe.zope2install
fake-zope-eggs=true
url = ${plone:zope2-url}

Not a big change, but it will cause Zope to advertise the packages it provides properly.  Incidentally, you also need to do this to try out plone.app.batch, a summer of code project that’s looking for comments for its demo.