Technical Assistance Required

by Kieran Healy on February 27, 2004

Ah, crap. My Movable Type installation has decided to “stop working”:http://www.movabletype.org/support/index.php?act=ST&f=10&t=36622&s=4fd53020f9a6073951da6e25ae637b67, and refuses to accept my username or even recognise the existence of my “blog”:http://www.kieranhealy.org/blog. A more detailed description follows below. Suggestions gratefully received.

I’m running MT 2.661 (with a Berkeley DB) on a blog that’s been quite happy for a year. In the last two days, MT stopped recognizing my username and password. The symptoms are:

* I can’t log on.
* Choosing the ‘forgot your password?’ route gives “No such user”.
* Clicking on comment or trackback links gives ‘Invalid Entry ID’ errors.
* It seemed to start with MT complaining it couldn’t find its tmpl director (or error.tmpl), which hadn’t happened before.

Support forum posts suggested that there might be a database error. I have a recent backup of the whole site, but I’m not sure whether it was made before or after the problem happened.

* I tried replacing the database folder with the backup, to no avail.
* I upgraded the Berkeley DB files. Didn’t work.
* I tried mt-medic, which showed the configuration was OK but — like MT — refused to recognise any Authors or Blogs (ie, none are listed on the relevant medic pages). It won’t create a new user, either, saying “Invalid author id ‘0’ at […]mt-medic.cgi line 746.”
* I tried to use mt-db2mysql.cgi to get the data into an SQL database I created. The script reports that it ran successfully and the right tables are created in the database, but it’s not populated with any records.
* I took a look at the Berkeley DB files using “this guy’s”:http://www.howardism.org/thoughts/000919.html helpful perl script. The entries seem fine. The data is all there. It doesn’t seem to be corrupt. The author files look fine.
* I re-installed MT, recreated my username and blogs, then tried to use the new author and permission files with the old database files.

So now I’m at a loss. Does anyone have any suggestions about how to get access to my blog back, or at least get access to my entries so I can recreate the content? On the one hand it looks like something is wrong with the database; on the other I can’t see what it is, so maybe my host provider (“Dreamhost”:http://www.dreamhost.com) changed something I don’t know about and that triggered the problem. If I can get this fixed, I promise never to use the Berkeley DB again.

{ 9 comments }

1

coder 02.27.04 at 2:30 pm

OK, so you can see all your data using his script? In that case you should be fine. All we need to do is get the script to generate SQL directly, or munge the output into SQL, whichever is easier. As I don’t have a MT DB database here to test on, could you post or email a representative sample of the output the script produces?

2

paul 02.27.04 at 2:51 pm

If you make the old db directory (all of it) available for download, it should be trivial for someone (I’ll do it, if you like) to set up and MT instance, swap in your db files, and then export it for you to reuse in a MySQL based instance.

3

chiggins 02.27.04 at 3:18 pm

I’m not tremendously experienced with sleepycats, but i imagine there’s a dump utility that will dump all your tables into SQL, ya might try that as far as getting your data out into a readable file (suitable for importing into MySQL as well). Also, I’d open up whatever log BDB is using and tail it while trying to do an operation in MT to see if you can find any “permission denied” type messages (as it could be something as simple as write perms).

4

Adam Rice 02.27.04 at 3:57 pm

As he said in the original post, they’re not using SQL. They’re using Berkeley DB.

5

dsquared 02.27.04 at 4:06 pm

to be honest, I think your only way out is to change your name, move to a different state and start up a new blog. It’ll be easier.

6

bandiera 02.27.04 at 4:38 pm

This sounds fer-miliar.

Have you recently created another blog, or logged on as a user to another blog?

If you ever let MT save your details as a cookie, you can get behaviour similar to this. It happened to me, and I did a lot of the troubleshooting you indicated above before I realised what the problem was.

It was easy to solve – just delete the MT cookie and you can log in again.

7

Curtiss Leung 02.27.04 at 7:24 pm

Try MT-Medic. I had a similar problem with a group weblog where NO ONE could log in; this lill’ feller fixed it right good.

8

John Quiggin 02.28.04 at 5:27 am

It was a Berkeley DB disaster that led me to shift over to Brad Choate’s hosting. He’s still offering space and if anyone can rescue you, I’m sure he can.

9

Kieran Healy 02.28.04 at 5:52 am

OK, I figured out what was wrong. And thanks to the several people here (and more via email) who offered suggestions and help.

It was a tricky problem because while all the symptoms were that the DB was corrupted, this wasn’t the problem after all. It seems that, perhaps due to a machine upgrade at Dreamhost (though I’m still not sure), I was no longer able to run cgi as an Apache module. The cgi daemon had started running as ‘dhapache’ rather than as my userid, and so began generating permissions errors when it tried to access the database and other things. This presented symptoms of database corruption.

Changing the cgi setup from the apache module to a straightup PHP-CGI arrangement fixed the problem — Dreamhost runs scripts with suexec and this meant the daemon was under my userid again. A few further fixes to the permissions (to keep suexec happy) and lo the database errors disappeared.

I was tearing my hair out for 24 hours before I figured this out, however.

Comments on this entry are closed.