News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

geoIP (IP to Location)

Started by Spuds, November 06, 2011, 02:26:09 PM

Previous topic - Next topic

cyberjunkie

I have 3 errors

The Database is not installed
Last Update Status: The MaxMind download site did not respond

This was voor de country and city csv


The Database is not installed
Last Update Status: Error during the downloading of the zip file from MaxMind

This was for the Country only


The Database is not installed
Last Update Status: Unable to find unzipped files

And this one was for the manual install.

The csv file.s are in the directory  Sources/geoIP/



koop

I just installed geoip, installed the full database option and then enabled the options.  I'm now getting the following error on my site and have lost all functionality. 

The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
File: /hermes/waloraweb082/b2083/moo.thebigtenhangoutcom/forum/Sources/geoIP.php
Line: 586

Any ideas?  I cannot find "Max_join_size" in my php.ini file. 

Arantor

You won't find it in php.ini, because it's not a PHP option. It's an SQL configuration option in MySQL - and on shared hosting you're just not going to be able to change that.

I'd love to know what's on lines 576-586 of geoIP.php.

Leo2

I have same MAX_JOIN_SIZE error after my hoster made some 'upgrade' in their database.

My forum didn't work until I removed older Geoip version ( I had to comment call to it in subs.php because admin pages didn't work either). After installing the newer version, the forum works, but shows same error in user profile.

Lines 568-586 are:

if (strpos($ip,'.'))
$ip = geo_dot2long($ip);

$request = $smcFunc['db_query']('', '
SELECT ip.start, ip.end,
bl.city, bl.latitude, bl.longitude,
gc.cc, gc.cn as country,
gr.rn as region
FROM {db_prefix}geoip_ip as ip
LEFT JOIN {db_prefix}geoip_blocks AS bl ON (ip.locid = bl.locid)
LEFT JOIN {db_prefix}geoip_countries AS gc ON (gc.cc = bl.country)
LEFT JOIN {db_prefix}geoip_regions AS gr ON (gr.rc = bl.region && gr.cc = bl.country)
WHERE ip.end >= {int:ip}
ORDER BY ip.end ASC
LIMIT 1',
array(
'ip' => (int) $ip
)
);

Joker™

Quote from: Leo2 on October 22, 2012, 03:33:16 AM
I have same MAX_JOIN_SIZE error after my hoster made some 'upgrade' in their database.

My forum didn't work until I removed older Geoip version ( I had to comment call to it in subs.php because admin pages didn't work either). After installing the newer version, the forum works, but shows same error in user profile.
A user has faced similar issue. Try reading out the topic.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Leo2

Quote from: Joker™ on October 22, 2012, 08:25:41 AM
A user has faced similar issue. Try reading out the topic.
Thank you! That helped me too.
However, I face another problem with online users counter, making geoip useless. May be you know the fix for that too?

Ice_Drake

Hi, I am having trouble installing the MaxMind CountryLite database. I tried installing it with the script, but it said Database Import Error. Then I tried installing it manually, but it always fails with the following error for two of the five tables:

Invalid column count in CSV input on line 1.

For those who has success installing the database, may you attach the mySQL file for those tables?

musicus

I think I can report a new bug.
The addon has worked for about 6 months without any problems. Then I realized that at once is no new user more signed up. I've tried I then times as a new user to log on again. Then came the message: "error: registration disabled".
After I the addon was uninstalled, the registry went again.
Since our Forum has an international audience, I found very handy to see it, where the users are coming
Sorry, for my bad English

bgandy

Is this mod still supported?

I installed on my site, but no one can see it. Not even the admin account. I have the mod enabled in settings and I have added permission for the groups allowed access.

Qayyom Ashraf

I tried to search Coutry & City database menually but did't find from the mentioned site.

Please give me the complete URL of downloadable database

Regards,
Qayyom Ashraf  |  Karachi-PK |::.www.JangForum.Com.::|

Hristo

If you mean the MaxMind databases, here they are (the free ones):
http://dev.maxmind.com/geoip/geolite

cyberjunkie

Quote from: cyberjunkie on June 18, 2012, 03:12:28 PM
I have 3 errors

The Database is not installed
Last Update Status: The MaxMind download site did not respond

This was voor de country and city csv


The Database is not installed
Last Update Status: Error during the downloading of the zip file from MaxMind

This was for the Country only


The Database is not installed
Last Update Status: Unable to find unzipped files

And this one was for the manual install.

The csv file.s are in the directory  Sources/geoIP/

Is here any support?

SD-X

I'm getting similar issues. Due to my crappy free host for this site I'm developing on, I can't download via the Country/City option successfully. Country partially works, as it grabs the file and begins to unzip, but it never finishes, so the file is corrupt. If I try to import the unzipped files manually from MaxMind's site, it just gives me the usual "Database Import Error". I'm completely out of ideas here.

Spuds

I made a couple of minor updates on the github repo here: https://github.com/Spuds/GeoIP

Maxmind had moved the location of the larger country/city files and a tweak that will help with some instances of mysql during the import (I think it was just the .js and two .php files that changed, so you can just copy those over the ones in your current installation)

But here is the deal, these are very large files that will fail for a lot of reasons.  The Zip file likes to timeout during the download on slow hosts, or ones that don't allow a long enough connection.  Then there is the memory issue during unzip, mostly on hosts that don't have the zip library installed, then there is the sql import, and if your host does not have the csv import capability enabled then you are SOL.  There is not much I can do about that in the mod to work around those host issues.

SD-X

#74
Quote from: Spuds on May 28, 2013, 11:40:25 AM
I made a couple of minor updates on the github repo here: https://github.com/Spuds/GeoIP
Aren't those already applied to the latest download hosted on SMF? I checked the version numbers of some modified pages and they matched, plus your changelog on the download page says you updated it last month. :P

Edit: Updated them to try anyway. Accessing the geoIP admin page is causing it to display "Fatal error: Call to undefined function geoIPEntry() in /<Board Host Root Location>/Sources/Admin.php on line 638".

Edit #2: Ignore the previous edit. That was a bad download of the files. Redownloaded them and it's working fine again. I'll reply back when I figure out what's going on with the manual update. :)

Edit #3: Ya, it unfortunately didn't solve the issue with grabbing them through any method. Is there a separate script included in the mod that can manually import them to the database when I download the files, or does it have to be run through the admin page only? I'm thinking that if I can run it outside the forum itself, it might tell me where it's breaking in more detail.

Edit #4: I also noticed a small bug in the error log when running the scheduled task for updating. Not sure if it's caused by my situation or not, but I figured it would be worth noting:

<Board Host Root Location>/index.php?action=admin;area=scheduledtasks
8: Undefined variable: result
File: /<Board Host Root Location>/Sources/ScheduledTasks.php
Line: 1659

<Board Host Root Location>/index.php?action=admin;area=scheduledtasks
8: Undefined index: geoIP_db
File: /<Board Host Root Location>/Sources/ScheduledTasks.php
Line: 1656

<Board Host Root Location>/index.php?action=admin;area=scheduledtasks
8: Undefined index: geoIP_db
File: /<Board Host Root Location>/Sources/ScheduledTasks.php
Line: 1654

geogeo.gr


Manu.G

Quote from: Spuds on May 28, 2013, 11:40:25 AM
I made a couple of minor updates on the github repo here: https://github.com/Spuds/GeoIP

Maxmind had moved the location of the larger country/city files and a tweak that will help with some instances of mysql during the import (I think it was just the .js and two .php files that changed, so you can just copy those over the ones in your current installation)

But here is the deal, these are very large files that will fail for a lot of reasons.  The Zip file likes to timeout during the download on slow hosts, or ones that don't allow a long enough connection.  Then there is the memory issue during unzip, mostly on hosts that don't have the zip library installed, then there is the sql import, and if your host does not have the csv import capability enabled then you are SOL.  There is not much I can do about that in the mod to work around those host issues.

I exchanged the updated files but I still get this error
QuoteThe Database is not installed
Last Update Status: Database Import Error


What exactly have I to do to get it work again :(
Version SMF 2.0.8
SimplePortal 2.3.5

hall

Dear developer team,

how to install as "database choice - Manual" ? Which files have to be uploaded to <forum>/sources/geoIP. Manual installation seems to be better way to avoid connections failures.
Please reply and greetings,
Miro M.

Ice_Drake

Well, I am back after a very long period of figuring out how to import the database correctly. I am back to partially guide those who are still having trouble getting this mod to work. Below is a brief overview of what you have to do in order to get this mod to work:

1. Install the mod as normal.

2. Attempt the database installation, which have been failing for me and probably among many others.

3. Create the database tables to match the schema of the downloaded CSV files in phpMyAdmin. Depending of whether you want Country only or with City, you should have different amount of tables. For Country and City, you should have five tables: geoip_blocks, geoip_countries, geoip_ip, geoip_ip_temp, and geoip_regions.

4. Import the contents of those CSV files downloaded from MaxMind to the correct tables. Do the import with the following configuration:

- Fields terminated by ','
- Enclosed by ' " '
- Lines terminated by '\n'
- Ignore 2 lines (only for certain CSV files)

Note that you can run into PHP timeout (of 300 seconds) when attempting to import a large CSV file. If that is the case, you must upload the file first to your server before proceeding with the import using LOAD DATA INFILE query. Depending on which file you are importing, there are two CSV files where you have to ignore the first two lines since they include the copyright and table schema.

5. If you run into import issue where you get an "access denied" message, address the issue with your web hosting provider. For me, my web hosting provider weren't able to locate the issue, so I have to do the import to a private server and export it as sql file and then import to the server via SSH since phpMyAdmin has been giving me lot of problems.

6. After successfully import the contents, change two records in smf_settings table: geoIP_status and geoIP_status_details. Change geoIP_status to 100 and geoIP_status_details to Success.

7. Insert a new record to that table and name it geoIP_db. Set it to 1.

8. Don't bother updating the database afterward. I figure that it will break something.

You should have a working geoIP mod installed.

Advertisement: