Search

Search this site:

mod_perl2 API madness

Yesterday was hellish. Apache might be the Free Software most notorious project. mod_perl is one of the best things that could happen both to the Perl and Apache communities. Apache2 is the largest Apache milestone, a major rewrite, and was declared golden almost three years ago. mod_perl, as it wraps the Apache C API and offers it to Perl, was expected to take some time to adapt to the new API and idiosincracy of this major version… Anyway, on to my life. I had some work to do on two systems I developed using mod_perl - the Comas one for Debconf and an internal project for the institute. Both stopped working on my development machine. Shit. Go to the logs - What do I find? [Wed May 11 12:04:03 2005] [error] [client 132.248.72.73] Can’t locate object method “dir_config” via package “Apache2::RequestRec” at /usr/share/perl5/Apache/Reload.pm line 51 Ok, this is clearly a mod_perl2 thingy… Things like this one had bitten me before, when I had to comment (and later uncomment) Apache::Upload. Oh, of course, then again some months ago, when I migrated from Apache 1.3 to Apache 2.0, when the nice mod_perl Apache2 migration wasn’t really in sync with the reality… There have been a couple of episodes. After some stumbling, I came across the changelog. In my Sid system, it read:

(...) =item 1.999_22 - April 14, 2005 ******************** IMPORTANT ******************** this version of mod_perl is completely incompatible with prior versions of mod_perl, both 1.XX and 1.99_XX. Please read the below changes carefully. ***************************************************

Ok, that explains it… Although a big API change is not what I’d expect between version 1.999_21 and 1.999_22, right? The most upsetting thing is that my main development box is running Sid - And the servers I deploy on run Sarge… So I guess this means I’ll have to set up a chroot environment so I can develop on my own workstation :-/ Ok, do some changes. It works on my Sarge machine, frozen at 1.999.21-1 - Everything looks fine. Send the module over to the Debconf server. Notify Apache of the changes. Reload, and… SHIT. Internal server error. I am not the machine’s admin - Spend a couple of hours trying to locate the good folks in Finland, asking them to give me read access to the Apache logs. Meanwhile, try to blindly fix the problem. Of course, once I saw the log, it was obvious I couldn’t have found it by myself:

(...) Can't locate object method "remote_ip" via package "Apache::Connection" at /home/gwolf/cvs/comas/perl/Apache2/Comas.pm line 279

WTF?! Now, both machines are running Sarge, but Murphy couldn’t just forgive me - At my machine I am running 1.999.21-1, but at Debconf’s server we have 1.999.20-1 - And I couldn’t get remote_ip to work. And no change regarding it is documented. Ok, fortunately I did not really depend on it save for a feature I had just implemented, and was able to work around it… Anyway, it was a lost day, due to unexpected, practically not documented API changes, in what really seemed like a very minor update. For ${THAT}’s sake, a version bump of 0.000.01 for a completely incompatible version?!

Comments

DaTa 2005-05-24 05:37:38

RE: mod_perl2 API madness

mod_perl < 2 was marked as "in development"


leonel 2005-05-13 09:17:59

RE: mod_perl2 API madness

and prepare yourself when mod_perl 2 is finally released more changes to come :)


Mauricio 2005-05-12 23:17:12

RE: mod_perl2 API madness

Welcome to the world of Free Software! ;-)

Categories