Duplicate log output when installing dependencies

Bug #321178 reported by Alec Munro
4
Affects Status Importance Assigned to Milestone
grok
Fix Released
Low
Uli Fouquet

Bug Description

When running "grokproject Sample" from the tutorial, I get some lines duplicated in the output, as follows:

> Installing eggbasket.
> Getting distribution for 'zope.app.securitypolicy==3.4.6'.
> eggbasket: Distributions are not installed. A tarball will be downloaded.
> eggbasket: Distributions are not installed. A tarball will be downloaded.
> eggbasket: Downloading http://grok.zope.org/releaseinfo/grok-eggs-1.0a1.tgz ...
> eggbasket: Downloading http://grok.zope.org/releaseinfo/grok-eggs-1.0a1.tgz ...
> eggbasket: Finished downloading.
> eggbasket: Finished downloading.
> eggbasket: Extracting tarball contents...
> eggbasket: Extracting tarball contents...
> eggbasket: No correct tarball found at http://grok.zope.org/releaseinfo/grok-egg
> s-1.0a1.tgz.
> eggbasket: No correct tarball found at http://grok.zope.org/releaseinfo/grok-egg
> s-1.0a1.tgz.
> eggbasket: The error was: bad checksum
> eggbasket: The error was: bad checksum

It seems to be just the "eggbasket" lines. If anyone could direct me to where these lines come from, I might be able to create a patch.

Oh, and I'm on Windows XP with Python 2.6.

Alec Munro (alecmunro)
description: updated
Revision history for this message
Uli Fouquet (uli-gnufix) wrote :

This bug is independent from the used OS. It is already described here:

   https://bugs.launchpad.net/zc.buildout/+bug/125729

where Jim Fulton says, that he won't fix the bug in zc.buildout.

There is, however, the possibility to work around by tearing down the already created loggers before creating new ones. This is for example done in grokproject (before that we had doubles for every line of grokproject output and eggbasket output was displayed even three times!).

The fix could look like this (here taken from grokproject/utils.py)::

  def remove_old_logger_handlers():
      # zc.buildout installs a new log stream on every call of
      # main(). We remove any leftover handlers to avoid multiple output
      # of same content (doubled lines etc.)
      root_logger = logging.getLogger()
      if 'zc.buildout' in root_logger.manager.loggerDict.keys():
          logger = logging.getLogger('zc.buildout')
          for handler in logger.handlers:
              logger.removeHandler(handler)
      return

but had to be done at the appropriate places in z3c.recipe.eggbasket.

Alex, please tell, if you want to fix this, otherwise I'll do it.

Changed in grok:
assignee: nobody → uli-gnufix
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Uli Fouquet (uli-gnufix) wrote :

Looks like when running eggbasket another package installs logger-handlers: this time it seems to be ``easy_install``.
I added a checker for this in ``z3c.recipe.eggbasket``, which removes any doubled logger handlers. Hope this fixes the duplicate-lines problem finally.

Changed in grok:
status: Confirmed → Fix Committed
Revision history for this message
Michael Haubenwallner (d2m) wrote :

Hmm, that part still shows duplicate lines for me
...
eggbasket: Distributions are not installed. A tarball will be downloaded.
eggbasket: Distributions are not installed. A tarball will be downloaded.
eggbasket: Downloading http://grok.zope.org/releaseinfo/grok-eggs-...
eggbasket: Downloading http://grok.zope.org/releaseinfo/grok-eggs-...
eggbasket: Finished downloading.
eggbasket: Finished downloading.
eggbasket: Extracting tarball contents...
eggbasket: Extracting tarball contents...
eggbasket: Installing eggs to /tmp/grokexample-eggs which will take a while...
eggbasket: Installing eggs to /tmp/grokexample-eggs which will take a while...
Getting distribution for ...

Can you confirm?

Revision history for this message
Uli Fouquet (uli-gnufix) wrote :

This should have been gone with z3c.recipe.eggbasket 0.4.2 (released today).

I checked and it works for me: no duplicate lines any more :-)

Revision history for this message
Uli Fouquet (uli-gnufix) wrote :

Looks like the problem has gone with z3c.recipe.eggbasket 0.4.2.

Changed in grok:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.