Ticket #9991 (closed Bug: fixed)

Opened 2 years ago

Last modified 2 years ago

Plone 4 cannot be started on Windows

Reported by: kleist Owned by: hannosch
Priority: blocker Milestone: 4.0
Component: Infrastructure Keywords:
Cc:

Description

Plone 4 coredev ver. 32754 / Windows 7

Before X-mas everything was fine. Now Plone cannot be started, neither in normal nor in debug mode:

> .\bin\instance.exe console
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "e:\buildout\plone4coredev\eggs\zope2-2.12.2-py2.6-win32.egg\Zope2\Startup\run.py", line 56, in <module>
    run()
  File "e:\buildout\plone4coredev\eggs\zope2-2.12.2-py2.6-win32.egg\Zope2\Startup\run.py", line 17, in run
    import Zope2.Startup
ImportError: No module named Zope2.Startup
> .\bin\instance.exe fg
D:\local-x86\Python26\python.exe e:\buildout\plone4coredev\eggs\zope2-2.12.2-py2.6-win32.egg\Zope2\Startup\run.py -C E:\buildout\plone4coredev\parts\instance\et
c\zope.conf -X debug-mode=on
Traceback (most recent call last):
  File "E:\buildout\plone4coredev\bin\instance-script.py", line 205, in <module>
    + sys.argv[1:])
  File "e:\buildout\plone4coredev\src\plone.recipe.zope2instance\src\plone\recipe\zope2instance\ctl.py", line 248, in main
    c.onecmd(" ".join(options.args))
  File "D:\local-x86\Python26\lib\cmd.py", line 219, in onecmd
    return func(arg)
  File "e:\buildout\plone4coredev\eggs\zdaemon-2.0.4-py2.6.egg\zdaemon\zdctl.py", line 559, in do_fg
    self.do_foreground(arg)
  File "e:\buildout\plone4coredev\src\plone.recipe.zope2instance\src\plone\recipe\zope2instance\ctl.py", line 201, in do_foreground
    return subprocess.call(command, env=env)
  File "D:\local-x86\Python26\lib\subprocess.py", line 470, in call
    return Popen(*popenargs, **kwargs).wait()
  File "D:\local-x86\Python26\lib\subprocess.py", line 621, in __init__
    errread, errwrite)
  File "D:\local-x86\Python26\lib\subprocess.py", line 830, in _execute_child
    startupinfo)
WindowsError: [Error 87] The parameter is incorrect

I did delete src/, parts/, .installed-cfg, and .mr.developer.cfg before refreshing the buildout.

Change History

comment:1 Changed 2 years ago by kleist

I have added this statement just before the call of subprocess.call() on line 201 in "src\plone.recipe.zope2instance\src\plone\recipe\zope2instance\ctl.py"...

print('command: <%s>' % command)

... and got this output:

command: <""D:\local-x86\Python26\python.exe" "e:\buildout\plone4coredev\eggs\zope2-2.12.2-py2.6-win32.egg\Zope2\Startup\run.py" "-C" "E:\buildout\plone4coredev\parts\instance\etc\zope.conf" "-X" "debug-mode=on"">

Aren't there very many double quotes?

comment:2 Changed 2 years ago by kleist

An interesting observation:

If I hardcode the following before the call of subprocess.call() on line 201 in "src\plone.recipe.zope2instance\src\plone\recipe\zope2instance\ctl.py"...

command = r'D:\local-x86\Python26\python.exe e:\buildout\plone4coredev\eggs\Zope2-2.12.2-py2.6-win32.egg\Zope2\Startup\run.py -C E:\buildout\plone4coredev\parts\instance\etc\zope.conf -X debug-mode=on'

... and run "bin/instance fg", the error "WindowsError: [Error 87] The parameter is incorrect" disappears. (None of the directory names in the command contains a space, or this would not have worked.)

Instead, the same error as with "bin/instance console" is issued: "ImportError: No module named Zope2.Startup".

comment:3 Changed 2 years ago by kleist

Yet an interesting observation: If I dump the dict "env" before the call of subprocess.call() on line 201 in "src\plone.recipe.zope2instance\src\plone\recipe\zope2instance\ctl.py", the components of PYTHONPATH are separated by ':' (colon). On Windows, that should be ';' (semicolon).

comment:4 Changed 2 years ago by kleist

The error "ImportError: No module named Zope2.Startup" is now fixed by un-hardcoding ':' as path separator in PYTHONPATH:

 https://dev.plone.org/collective/changeset/107848/buildout/plone.recipe.zope2instance/trunk/src

comment:5 Changed 2 years ago by hannosch

  • Owner set to hannosch

Uhm, this is my doing. I refactored the zope2instance recipe and broke Windows support on current trunk. It's on my list to get this working again in the next days.

At least I have both a Windows 7 32bit and 64bit environment now to test things in :)

comment:6 Changed 2 years ago by kleist

  • Status changed from new to closed
  • Resolution set to fixed

Fixed by http://dev.plone.org/collective/changeset/107867/buildout/plone.recipe.zope2instance/trunk/src/plone/recipe/zope2instance/ctl.py

Arguably, Zope2.Startup.zopectl.quote_command() should be fixed instead of being bypassed like this.

Note: See TracTickets for help on using tickets.