eldy / AWStats

AWStats Log Analyzer project (official sources)
https://www.awstats.org
369 stars 120 forks source link

Bad arg length for Socket::inet_ntoa #120

Closed Rehtael closed 5 years ago

Rehtael commented 5 years ago

Hmmm....was using @neilgierman 's fork before, but just updated to current eldy commit 0dd9142 and now getting:

AH01215: Bad arg length for Socket::inet_ntoa, length is 0, should be 4 at /usr/local/awstats/wwwroot/cgi-bin/plugins/geoip2.pm line 200.

Rehtael commented 5 years ago

Fixed by #115

Rehtael commented 5 years ago

@neilgierman - am getting "Undefined subroutine &main::TmpLookup_geoip called at /usr/local/awstats/wwwroot/cgi-bin/plugins/geoip2.pm line 121, line 13483"

That position in the log was when I'd buggered up logging and the IP was coming back as "-"...so not sure why that should cause problems

site.name - - - [18/Jan/2019:11:28:56 +1100] "GET /css/ HTTP/1.1" 200 6209 "https://site.name/" "Mozilla/5.0 (Android 8.0.0; Mobile; rev:65.0) Gecko/65.0 Firefox/65.0"

neilgierman commented 5 years ago

That was a find and replace error. That should be TmpLookup_geoip2. I didn't see it because I still had the original GeoIP plugin enabled which defines that function. I assume you have the original GeoIP disabled so you don't have that function. I'll update my branch and make sure it is still good.

Rehtael commented 5 years ago

Thanks :)

Manual edit, now back to Socket problem (line 124 in this case now)

Rehtael commented 5 years ago

@neilgierman Line 120: if ((! $param)||($param eq "-")) { return ''; }

Rehtael commented 5 years ago

Actually, I think this is better:

if ($param !~ m/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/) { return ''; }