Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Geo::IP Error

by sreenu (Initiate)
on May 20, 2007 at 16:10 UTC ( #616455=perlquestion: print w/replies, xml ) Need Help??

sreenu has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I written a application, which gives geo information(like Country, Region, City) for the given IP address. I am getting this Error: "Error Traversing Database for ipnum = 1124711478 - Perhaps database is corrupt?". I am using MAX MIND GEOCITY Database and Geo::IP perl module. In my application multiple process simultaneously querying that database. But when I tested with same IP with the test program, I am not getting that ERROR. I am unable to find the BUG, In which case the error is occuring ? How can I resolve that BUG. Please help....

Replies are listed 'Best First'.
Re: Geo::IP Error
by liverpole (Monsignor) on May 20, 2007 at 18:00 UTC
    Yes, it's because on line 42 of your program, you're opening the database twice, and then on line 77, trying to write back different data to it from each of the 3 threads at once, without locking the tables.

    That's what's causing your database corruption.


    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
Re: Geo::IP Error
by Joost (Canon) on May 20, 2007 at 18:26 UTC
      Joost's guess of a dotted four address is not a legal IP address. To convert 1124711478 to a dotted four, I think that's 67.9.188.54. (Did I get my endian-ness right?) I would guess the library actually supports 32bit uint format, but who knows? Hm, I suppose the documentation might: Geo::IP

      Both of the replies so far are pointing to your lack of real information, so how can you get really useful help? Reduce the problem to something small that doesn't use anything but the required components, and build up from there.

      --
      [ e d @ h a l l e y . c c ]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://616455]
Approved by ysth
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2021-10-22 00:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?