aMule Forum

English => Multiplatform => Mac OSX => Topic started by: Gomaaz on October 04, 2005, 02:35:42 PM

Title: "cannot find hostname"
Post by: Gomaaz on October 04, 2005, 02:35:42 PM
hi guys,

I just receive 2 errormessages from amule every startup

looks like this:

(http://www.grunge.dedicated-media.de/amule.png)

(http://www.grunge.dedicated-media.de/amule2.png)

I just talked to Ken and his statement was to give the machine a hostname....just one prob....the machine already got a hostname (I guess...so how can I checkit?)

so I don't know how to continue solvin the prob ?! Any Ideas :/

Im now running a CVS version recommed by lionel and before it was the official 2.0.3 release...both the same prob
Title: Re: "cannot find hostname"
Post by: ken on October 05, 2005, 05:53:00 AM
Hmm.  I get my hostname from the DHCP server on the LAN.  I'm not sure what your options are if you don't (if, for instance, your DHCP server belongs to your ISP and they aren't giving your host a name).

There's the "hostname" command, so you could do "sudo hostname yourhostnamehere" in the Terminal, but I don't know if that's permanent or not.  I also think it won't work well because, if I remember the wx code involved correctly, wx really wants it to be fully-qualified like yourhost.yourdomain.co.de or whatever.  And, that won't work to get your local IP (aMule's ultimate goal) because it's not really a registered DNS name.

Frankly, I think it's a bug in our aMule code that we're using the wx functions that we are.

P.S.  Oooooh, shiny!  ;)
Title: Re: "cannot find hostname"
Post by: Gomaaz on October 23, 2005, 02:08:27 PM
hey ken....many thanks...:P

your answer wasn't quite understandable but I think I just know what you're meaning

from my provider I got a dns-server which I just entered in the network settings of mac os x

after that I found the domain NAME for the SERVER which I entered in network settings

so there wasn't any solving effect so I got your typ with "sudo hostname yourhostnamehere"

I entered in Terminal : "sudo hostname mydnsdomain"

and now Amule keeps quite :D

many thx
Title: Re: "cannot find hostname"
Post by: ken on October 23, 2005, 09:23:23 PM
I'm glad that helped.  :)

Is it permanent across reboots?
Title: Re: "cannot find hostname"
Post by: Gomaaz on October 24, 2005, 07:24:35 AM
no it's not permanent...I have to reenter :/

how can I make it permanent?
Title: Re: "cannot find hostname"
Post by: ken on October 24, 2005, 11:33:42 PM
I don't know.  I'm sure there's a standard Unix startup file which can run the hostname command automatically on startup.  Or, you can create a Startup Item to do it, too.  However, it feels like we're getting pretty far from The Mac Way of doing things.  I find that when I start getting away from The Mac Way and getting into The Unix Way of doing things like this under Mac OS X, it means I've gone astray.

Who assigned you your DNS name?  Your ISP?  You should ask them if their DHCP server should be telling your computer about its assigned DNS name.  I think it should.  I don't know all that much about DHCP, but I do know that in my company's network that's how it works.
Title: Re: "cannot find hostname"
Post by: Gomaaz on October 27, 2005, 11:59:14 PM
and finally I found out how to make this permanent :P :

1. Open Terminal.app
2. cd /etc
3. sudo cp hostconfig hostconfig.old
4. sudo pico hostconfig
5. Change the line "HOSTNAME=-AUTOMATIC-" to "HOSTNAME=yourdns"
6. Save the file (^O) and exit (^X)
7. Open NetInfo Manager.app
8. Click machines
9. Click localhost
10. Make sure that the lock is unlocked - if not, click on it to unlock it
11. Hit -D to duplicate the localhost entry
12. Click on the 'localhost copy' entry
13. Double-click the value for the 'name' field in the lowerbox
14. Type in the same name as your hostconfig file (i.e. youdns)
15. Reboot

I'm sooo glad now :D
Title: Re: "cannot find hostname"
Post by: ken on October 28, 2005, 03:43:34 AM
Well, congratulations.  I'm still a bit uncomfortable doing stuff like this behind the OS's back (sort of).  Is this change reflected anywhere in the System Preferences?  If so, you know how to make the change The Mac Way(tm) for the future.
Title: Re: "cannot find hostname"
Post by: Gomaaz on October 28, 2005, 05:15:30 AM
no I couldn't change it by the easy way (in system preferences). so in the config files wasn't the "HOSTNAME=" entry available at all  8o so I had to create it first.

maybe other guys got easierways....but this worked for me now :P and that's what I wanted   :baby:
Title: Re: "cannot find hostname"
Post by: Mace Windu on January 05, 2006, 10:44:28 AM
Hi!

I'm getting the same error:

"Cannot get the official hostname (error 22: Invalid argument)" ?(

only since I've changed from 2.0.3  to 2.1.0.
I can connect to servers and Kad, and furthermore I can get the server list.

All needed ports are forwarded (I think). :]
Connection thru Wi-Fi to an ADSL from Telefónica in Spain.

The error window appear every time I double click at the aMule icon to open it, but never appeared when I was using aMule 2.0.3. Since it never happened before... it isn't a bug?
How could I fix it without the "(ugly) way" ken :baby: links (http://forum.amule.org/thread.php?threadid=8583&sid=) here?

Thanks.
Title: Re: "cannot find hostname"
Post by: Kry on January 05, 2006, 07:15:45 PM
Is not a bug. aMule is requesting the hostname from the O.S. If you ahve none set, is not aMule's fault ;)
Title: Re: "cannot find hostname"
Post by: lionel77 on January 05, 2006, 09:17:48 PM
I am confused about where this problem is coming from. I am currently (temporarily) using the same ISP as Gomaaz and without any special measures aMule is not complaining about the hostname. This (and the fact that this ISP is the largest one in Germany and noone else seems affected) makes it somewhat unlikely that it is an ISP related issue.

I'm also a bit puzzled by Mace Windu's statement that he only gets the error with 2.1.0 but not with 2.0.3 because Gomaaz initially said that he gets the error both with 2.0.3 and the CVS versions.
Title: Re: "cannot find hostname"
Post by: Kry on January 05, 2006, 09:35:55 PM
I think my wxGetHostname implementation did not get on 2.0.3
Title: Re: "cannot find hostname"
Post by: ken on January 05, 2006, 11:20:25 PM
Quote
Originally posted by Kry
Is not a bug. aMule is requesting the hostname from the O.S. If you ahve none set, is not aMule's fault ;)

But the point is, aMule shouldn't need the hostname and shouldn't use it for the purpose that it is.
Title: Re: "cannot find hostname"
Post by: Kry on January 06, 2006, 12:30:53 AM
Why not? It's ok. That's the way we get the ip. Better ideas? :P
Title: Re: "cannot find hostname"
Post by: ken on January 07, 2006, 05:21:54 AM
First of all, a computer doesn't have a single IP.  It may have many.  Second, as demonstrated by this thread, a computer can have one or more IP addresses without having a hostname.  There's no good reason to expect or require a computer to have a hostname in order to use aMule.

Lastly, of the various methods for discovering (one of) the computer's IP address(es), looking up the hostname is a pretty poor choice.  Usually, the only recommended one is to look up the local socket address from a connection with another computer.  That gives you the IP address most appropriate for that peer.  Unfortunately, that gets all screwed up by NAT.

And that brings us to this fact: the only reliable way to tell somebody your IP address is not to.  It is never necessary to transmit your IP address over an IP protocol.  It's redundant.  All such communication already carries your IP address, and it's much more reliable than any mechanism we can use to try to figure out our own.  The peer should just get our IP address from the socket on which they received our message(s).
Title: Re: "cannot find hostname"
Post by: Kry on January 07, 2006, 07:43:44 AM
Wow, you're *so* going to rewrite the ed2k protocol... not.

There are checks to know our ip later than that, but I suggest you check the USAGE of the wxGetHostname. Which, btw, does fail NOWHERE but MacOS X, and then just some boxes.
Title: Re: "cannot find hostname"
Post by: lionel77 on January 08, 2006, 07:23:21 PM
Here (http://forum.amule.org/thread.php?sid=&postid=48127#post48127) is another person affected.

If we cant figure out a quick fix for this issue, would it be an option to temporarily go back to "the 2.0.3 way of determining the IP"? Or would this just cause more headaches?
Title: Re: "cannot find hostname"
Post by: Mace Windu on January 10, 2006, 08:10:34 AM
I'm a little bit confused.?(

Early this morning I didn't get the error message, without any (intentionally made) change on my system, just reboot.

Thanks!
Title: Re: "cannot find hostname"
Post by: Gerd78 on January 10, 2006, 08:26:45 AM
http://forum.amule.org/thread.php?postid=48237&sid=#post48237

The message is now hidden.

EDIT: Maybe I should think before posting... You didn't upgrade to today's CVS, did you? If so, the message is hidden in today's CVS. If not, I don't know the reason.
Title: Re: "cannot find hostname"
Post by: Mace Windu on January 10, 2006, 02:08:38 PM
;) No I didn't upgrade, but I will.

thanks
Title: Re: "cannot find hostname"
Post by: ken on January 11, 2006, 02:59:18 AM
Rebooting might have made a difference because your Mac will have reacquired its network configuration information from your ISP (or local network) via DHCP.  It might now have a valid hostname.
Title: Re: "cannot find hostname"
Post by: jochen on October 16, 2006, 08:18:59 AM
Quote
Originally posted by Kry
Wow, you're *so* going to rewrite the ed2k protocol... not.

There are checks to know our ip later than that, but I suggest you check the USAGE of the wxGetHostname. Which, btw, does fail NOWHERE but MacOS X, and then just some boxes.
How do you explain that Edonkey2000 works with no problems on the same machine with the same configuration while amule fails? ?(
Title: Re: "cannot find hostname"
Post by: jochen on October 17, 2006, 10:56:01 AM
Quote
Originally posted by Kry
Why not? It's ok. That's the way we get the ip. Better ideas? :P
For which purpose do you need this IP? If the Mac sits behind a NAT router (which is the normal case at home) you will only get it's internal IP on the LAN. This will help you nothing if you are communicating with the outside.