Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: shads on September 16, 2006, 11:57:01 PM

Title: "Invalid query name 1" apache error log
Post by: shads on September 16, 2006, 11:57:01 PM
Hello,

  When I enable the "hostname lookups"  at the feature options of SMF 1.1rc3
I'm having an error log "Invalid query name 1"  at my apache error logs.

Any idea  how to fix this?

thanks.
Title: Re: "Invalid query name 1" apache error log
Post by: jerm on September 17, 2006, 12:20:34 AM
Is there anything in your SMF log errors?
Title: Re: "Invalid query name 1" apache error log
Post by: shads on September 17, 2006, 12:32:03 AM
no error logs at SMF ... 
Title: Re: "Invalid query name 1" apache error log
Post by: altern on December 17, 2006, 12:18:10 PM
Quote from: shads on September 17, 2006, 12:32:03 AM
no error logs at SMF ... 

I have the same problem  :-\

No more information ... strange ! Someone have an idea?
Title: Re: "Invalid query name 1" apache error log
Post by: IchBin™ on January 06, 2007, 04:11:18 PM
Which version are you running of SMF?
Title: Re: "Invalid query name 1" apache error log
Post by: altern on January 07, 2007, 04:42:42 AM
Quote from: IchBin™ on January 06, 2007, 04:11:18 PM
Which version are you running of SMF?

Always the last one.

For information my installation is a migration from IPB v1.3 to SMF 1.1 ;)
Title: Re: "Invalid query name 1" apache error log
Post by: SleePy on January 07, 2007, 03:25:23 PM
SMF uses a function called host_from_ip in the Subs.php which should hopefully correctly handle this.

you can tweak this yourself possible to get it to work.
Since I think you are using a linux server you would only need to change the first part..

I believe if you add at the top just after the global line this:
$modSettings['host_to_dis'] = 1;

It should make it work.
Title: Re: "Invalid query name 1" apache error log
Post by: altern on January 08, 2007, 03:39:53 AM
It doesn't work. Instead of "invalid query" I have with this :

"XX.XX.XX.XX  does not exist, try again"

But If I comment all and juste use :

        // This is the last try :/.
        if (!isset($host) || $host === false)
                $host = @gethostbyaddr($ip);


It's work !

But why 'resolv' ? it's for what?
In my log or "WhoIs" all adresses displayed is numerical....
Title: Re: "Invalid query name 1" apache error log
Post by: SleePy on January 08, 2007, 10:53:07 AM
altern,

Glad it is working one way for you

Can you tell me your version of php and apache? as well if you are using linux or not and what os and version of it.
Title: Re: "Invalid query name 1" apache error log
Post by: altern on January 08, 2007, 10:59:07 AM
Of course.
I'm running on Linux Debian Sarge, so :

apache:  Apache/1.3.33 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.10-18 mod_ssl/2.8.22 OpenSSL/0.9.7e
php:     PHP Version 4.3.10-18
Title: Re: "Invalid query name 1" apache error log
Post by: Smurfbutcher Bob on January 11, 2007, 12:09:08 AM
Perfect timing for this thread... I upped to 1.1.1 over the newyear, and guess what I spend the afternoon pulling out my hair over today? rickin frickin I screwed up a reference to a nonexistent query when a new session is instantiated somewhere... no, wait, it occurs on an interval even with an existing session, and it's in a global function. whytf can't I trap this, lol...

SleePy nailed the cause. Fix was as Altern did. And like I said... perfect timing :)

PHP 4.4.0, Apache/2.0.54 (Debian)

The resolution WAS working, btw... so this was the last thing I'd ever consider.
Title: Re: "Invalid query name 1" apache error log
Post by: zepfms on February 25, 2007, 05:33:21 AM
Quote from: altern on January 08, 2007, 03:39:53 AM
But If I comment all and juste use :

        // This is the last try :/.
        if (!isset($host) || $host === false)
                $host = @gethostbyaddr($ip);


It's work !


What do you mean you "comment all"?

Tnx !!!
Title: Re: "Invalid query name 1" apache error log
Post by: altern on February 25, 2007, 06:05:24 AM
Quote from: zepfms on February 25, 2007, 05:33:21 AM
Quote from: altern on January 08, 2007, 03:39:53 AM
But If I comment all and juste use :

        // This is the last try :/.
        if (!isset($host) || $host === false)
                $host = @gethostbyaddr($ip);


It's work !


What do you mean you "comment all"?

Tnx !!!

Just leave this two line, and it's fine.

So since laster upgrade, I have not the problem. So  no comment at all.
Title: Re: "Invalid query name 1" apache error log
Post by: zepfms on February 25, 2007, 06:16:28 AM
Thanks altern  !!!
Title: Re: "Invalid query name 1" apache error log
Post by: Daniel15 on February 26, 2007, 05:56:19 AM
This error is being caused by the "host" command. I don't believe that the original host command works as expected.

Installing the BIND9 version of this utility should solve this issue

apt-get remove host
apt-get install bind9-host


The code in "host" that is causing this error is in main.c, line 1379:

/*
* Check for incompatible options.
*/
/* cannot have dotted quad in listmode */
if (listmode && (queryaddr != NOT_DOTTED_QUAD))
{
errmsg("Invalid query name %s", queryname);
return(EX_USAGE);
}

/* must have regular name or dotted quad in addrmode */
if (!listmode && addrmode && reverse)
{
errmsg("Invalid query name %s", queryname);
return(EX_USAGE);



I can definately duplicate it, though...
Using the BIND9 host command:

daniel@daniel-laptop:/usr/local/src/host-20000331$ host -W 1 60.241.80.44
44.80.241.60.in-addr.arpa domain name pointer server.daniel15.com.


Using the old one:

daniel@daniel-laptop:/usr/local/src/host-20000331$ ./host -W 1 60.241.80.44
Invalid query name 1
Title: Re: "Invalid query name 1" apache error log
Post by: viulian on December 02, 2007, 04:05:05 AM
Thanks Daniel,

I was using the old host command it seems the error is fixed now.
Removing the older host package also removes dnsutils (nslookup, dig, etc) so they need to be reinstalled with

apt-get install dnsutils
Title: Re: "Invalid query name 1" apache error log
Post by: Owdy on December 06, 2009, 10:21:10 AM
Thank you Google and Daniel15, i got exact same issue in Debian server. Fixed :D
Title: Re: "Invalid query name 1" apache error log
Post by: Daniel15 on December 06, 2009, 07:27:01 PM
You're welcome :)
I didn't know it was still an issue :P
Title: Re: "Invalid query name 1" apache error log
Post by: ʟink on December 13, 2009, 03:01:56 PM
Yepp, still is an issue. Fixed it with a quick Google search that brought me here. ^.^ Thanks!