New Message: Obscure Mail-to-Weblog debugging

webmaster at userland.com webmaster at userland.com
Sat Apr 23 12:29:46 PDT 2005


A new message was posted:

Address: http://manila.userland.com/discuss/msgReader$941

By: Matt Deatherage (frontier at gcsf.com)

Oy. We enabled the Mail-to-Weblog feature for one of our sites several months ago, but the person for whom it was intended didn't try to use it until Friday night - and it didn't work. Frontier appeared to be checking mail, but nothing was happening. I got it working, and hope the debugging tips might help someone else.

First, I checked to make sure that the addresses were stored right in site's table, and they were. Then I set out to find the script that's checking the mail - and when I found the thread script, I found a breakpoint in it. Ugh. Probably my fault from last fall trying to get David's support for encrypted authentication to work. Removing it didn't solve the problem.

This led me to manilaSuite.mailToWeblog.checkMail. No breakpoints there, so I changed the test address at the bottom of the script form Jake's test site to the one I'm trying to work on, uncommented the code, and started debugging it. I hit an error on tcp.getMail, and that dropped me to the bottom "else" block commented "// log the error".

No error got logged. It took me a few minutes of poking around to figure that out:

try
 local(t); new (tableType, @t)
 t.error = tryerror
 manilaSuite.log.addEvent("mailtoWeblogError", startticks, @t, adrsite)

My server, running a fully-updated and initialized copy of Frontier 9.0.1 (as far as I knew), does not have manilaSuite.log! Not at all! I had no place to go to look to see what the error was. So, I commented out that last line, and added instead:

msg(tryerror)

..to at least display it in the About window. When I tried debugging the script again, I got something very much like this (not verbatim, I didn't get it copied before I fixed it):

tcp.getMail got an error in "load" because the library "regexclassic" could not be loaded.

This didn't make much sense to me either, as I knew that RegEx [1] has been bundled with Frontier for some time now. I downloaded a new copy, and when I saw that it's supposed to go in system.extension.regex, I took a look at that table. Sure enough, it's there - version 2.0.2b3, the same one I just downloaded.

On a /hunch/, I opened and ran the "init" script at "system.extensions.regex.init", and tried running manilaSuite.mailToWeblog.checkMail again.

It worked! The problem, unbelievably, was that RegEx had /never been initialized/. I don't know how that managed to happen, or how come my system doesn't have the "manilaSuite.log" suite that the scripts seem to expect, but at least for now, the feature is working.

Hopefully it will save someone else an hour somewhere, or help UserLand figure out why it didn't work in the first place - I have no clue. It's very odd.

[1] http://old.scriptmeridian.org/projects/regex/download.html

This is a Manila site.. http://manila.userland.com/.




More information about the Frontier-Users mailing list