#3 — plone startup error with "plone3_buildout" template when you accidentally enter a http port number > 65k!

by Armin Stross-Radschinski last modified Jun 14, 2010 10:17 PM
State Tested and confirmed closed
Version:
Area General
Issue type Bug
Severity Low
Submitted by Armin Stross-Radschinski
Submitted on Feb 27, 2008
Responsible Cris Ewing
Target release: 2.16
Symptom:
When you enter a HTTP port number greater than 65536 when running the "plone3_bildout" template with paster you get an error "TypeError: an integer is required" when starting Zope in foreground.

Reason:
only integer HTTP port numbers below or equal 65536 are usually possible.

Solution:
Use lower port numbers by editing the buildout.cfg file manually and run bin/buildout -o again.

Optional To do:
Add a validator to the ZopeSkel code that is responsible for checking input values and give a feedback and maybe a chance to reenter the value again. If higher port numbers are possible in the future (I do not know!) give a warning instead.

Notes:
Keep this info online even when do not solve this, because it is useful if someone googles for this issue!
Thank you for ZopeSkel! I love it!

Armin
Steps to reproduce:
with ZopeSkel 1.6 installed create a plone3_buildout with paster:

paster create -t plone3_buildout

...
Enter http_port (HTTP port) [8080]: 500000 # Enter a port number greater than 65536
...

After you run
% python bootstrap.py
and
% bin/buildout
and try to start the server the first time with "bin/instance fg" in foreground mode you get something similar to the following error:

% bin/instance fg
"/home/youcan/instances/youcan/parts/instance/bin/runzope" -X "debug-mode=on"
Traceback (most recent call last):
  File "/home/youcan/instances/youcan/parts/zope2/lib/python/Zope2/Startup/run.py", line 56, in ?
    run()
  File "/home/youcan/instances/youcan/parts/zope2/lib/python/Zope2/Startup/run.py", line 21, in run
    starter.prepare()
  File "/home/youcan/instances/youcan/parts/zope2/lib/python/Zope2/Startup/__init__.py", line 96, in prepare
    self.setupServers()
  File "/home/youcan/instances/youcan/parts/zope2/lib/python/Zope2/Startup/__init__.py", line 227, in setupServers
    servers.append(server.create())
  File "/home/youcan/instances/youcan/parts/zope2/lib/python/ZServer/datatypes.py", line 84, in create
    logger_object=access_logger)
  File "/home/youcan/instances/youcan/parts/zope2/lib/python/ZServer/HTTPServer.py", line 433, in __init__
    http_server.__init__(self, ip, port, resolver, logger_object)
  File "/home/youcan/instances/youcan/parts/zope2/lib/python/ZServer/medusa/http_server.py", line 573, in __init__
    self.bind ((ip, port))
  File "/home/youcan/python/Python-2.4.4/lib/python2.4/asyncore.py", line 304, in bind
    return self.socket.bind(addr)
  File "<string>", line 1, in bind
TypeError: an integer is required


Added by Cris Ewing on Jan 22, 2010 01:52 AM
Issue state: UnconfirmedConfirmed
Severity: MediumLow
With the new var classes added to trunk as of r108795 (http://dev.plone.org/collective/changeset/108795/ZopeSkel), fixing this should be relatively easy. We can subclass the IntVar class currently used for the http_port variable with something like a 'BoundedIntVar' which has a minimum and maximum allowable value. Then we can validate that the chose port number isn't too low, and thus restricted, or too high.

Anyone want to take this on?
Added by Cris Ewing on Mar 04, 2010 12:06 AM
Issue state: ConfirmedResolved
Responsible manager: (UNASSIGNED)cewing
all set. committed in r:112257 (http://dev.plone.org/collective/changeset/112257/ZopeSkel)

c
Added by Cris Ewing on Jun 14, 2010 10:17 PM
Issue state: ResolvedTested and confirmed closed
Target release: None2.16

No responses can be added.