[ZCM] [ZC] 1507/11 Comment "127.0.0.1 not picked up when no ip-address specified."

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Fri Oct 15 09:51:23 EDT 2004


Issue #1507 Update (Comment) "127.0.0.1 not picked up when no ip-address specified."
 Status Accepted, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/1507

==============================================================
= Comment - Entry #11 by tim_one on Oct 15, 2004 9:51 am

FYI, on WinXP, Zope 2.8 appears to use localhost no matter what ip-address is set to in zope.conf.  For example, after setting the nonsensical

ip-address 100.100.100.100

then starting Zope still displays

2004-10-15 10:18:44 INFO ZServer HTTP server started at Fri Oct 15 10:18:44 2004
        Hostname: localhost
        Port: 8080
2004-10-15 10:18:44 INFO ZServer FTP server started at Fri Oct 15 10:18:44 2004
        Hostname: localhost
        Port: 8021
2004-10-15 10:18:46 INFO Zope Ready to handle requests

In current 2.7 branch, the default looks very different:

2004-10-15T10:27:19 INFO(0) ZServer HTTP server started at Fri Oct 15 10:27:19 2004
        Hostname: FATLAP.reston01.va.comcast.net
        Port: 8080
------
2004-10-15T10:27:19 INFO(0) ZServer FTP server started at Fri Oct 15 10:27:19 2004
        Hostname: FATLAP
        Port: 8021

and setting

ip-address 100.100.100.100

in 2.7 branch yields an error:

"""
ZConfig.ConfigurationError: There was a problem starting a server of type "HTTPServer". This may mean that your
user does not have permission to bind to the port which the server is trying to use or the port may already be
in use by another application. (Can't assign requested address)
"""
________________________________________
= Comment - Entry #10 by tim_one on Oct 15, 2004 9:23 am

Alas, the same two tests still fail on WinXP, in the same way, after your changes (at revision 28199).

Sorry, I'm not a network guy, and am not even sure what "Does Zope 2.8 use all IP addresses by default on Windows?" means.  I just dropped in here to report that some tests broke <wink>.
________________________________________
= Comment - Entry #9 by ajung on Oct 15, 2004 12:38 am

Don't know about Windows :-)
I added a check for sys.platform != 'win32'. Does Zope 2.8
use all IP addresses by default on Windows?


________________________________________
= Assign - Entry #8 by tim_one on Oct 14, 2004 4:05 pm

 Supporters added: ajung

Don't know about Linux, but two tests fail on WinXP now:

FAIL: test_http_factory (ZServer.tests.test_config.ZServerConfigurationTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Code\Zope\lib\python\ZServer\tests\test_config.py", line 110, in test_http_factory
    self.assertEqual(server.ip, '127.0.0.1')
  File "C:\Python23\lib\unittest.py", line 302, in failUnlessEqual
    raise self.failureException, \
AssertionError: 'localhost' != '127.0.0.1'

======================================================================
FAIL: test_webdav_source_factory (ZServer.tests.test_config.ZServerConfigurationTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Code\Zope\lib\python\ZServer\tests\test_config.py", line 128, in test_webdav_source_factory
    self.assertEqual(server.ip, '127.0.0.1')
  File "C:\Python23\lib\unittest.py", line 302, in failUnlessEqual
    raise self.failureException, \
AssertionError: 'localhost' != '127.0.0.1'
________________________________________
= Comment - Entry #7 by ajung on Oct 14, 2004 2:43 pm

I commited a workaround for the problem. Not a total clean
solution...at least no longer a stopper for the Zope 2.8 release.
________________________________________
= Comment - Entry #6 by ajung on Oct 14, 2004 2:14 pm

I tracked this down to the bind() call in medusa.
bind(('localhost', 8080)) binds only to 127.0.0.1:8080.
If you pass '' as hostname then it binds to all interfaces.
I assume we must change the default hostname from
'localhost' to '' somewhere (I assume in lib/python/ZServer/datatypes.py)
________________________________________
= Comment - Entry #5 by ajung on Oct 13, 2004 12:16 pm

Fred. Could you please look at that issue. This is the last
remaining showstopper for 2.8a1.
I did my own investigations but got stuck at some point.
________________________________________
= Assign - Entry #4 by tseaver on Sep 29, 2004 10:05 am

 Status: Pending => Accepted

 Supporters added: fdrake


Uploaded:  "z27_z28_zconfig.patch"
 - http://collector.zope.org/Zope/1507/z27_z28_zconfig.patch/view
Attaching a diff of the Zope.Startup.handlers and ZServer.datatypes code between the 2.7 branch and the HEAD.

I *think* that the change to 'preparep to use the new
'get_default_host_info' function is the culprit here.

Fred's checkin message for the transaction which added that change says:

 r24547 | fdrake | 2004-04-26 15:44:45 -0400 (Mon, 26 Apr 2004) | 4 lines

 Medusa wants the IP number, not the actual hostname, so give it that
 way.  We do more work up front, but this makes the pieces go together
 more cleanly in the end since expectations aren't fudged.

Fred, can you figure out why we don't bind to all interfaces anymore?
________________________________________
= Comment - Entry #3 by regebro on Sep 29, 2004 9:04 am

It seems like you have the same problem, but it just decides to connect only to 127.0.0.1, while in my case it decides to connect to another address. 

Just tested 2.7.3b1 and that works, so it's only only on the trunk.
________________________________________
= Comment - Entry #2 by ajung on Sep 29, 2004 12:49 am

Where there some changes lately on the SVN trunk?
The current checkout only binds to 127.0.0.1 but not to all
other IP addresses.
________________________________________
= Request - Entry #1 by regebro on Sep 24, 2004 10:35 am

When no ip-address is specified in zope.conf, 127.0.0.1 seems not to be picked up. I can access Zope through the other IP-adress but not 127.0.0.1 or localhost. This worked with Zope 2.7.2.

If I set up an ip-address in zope.conf:
   ip-address 127.0.0.1
then 127.0.0.1 works, but of course not the other one.


==============================================================



More information about the Zope-Collector-Monitor mailing list