Opened 8 years ago

Closed 8 years ago

#1053 closed defect (fixed)

ImportError: cannot import name log_config_update

Reported by: jreed Owned by: UnAssigned
Priority: very high Milestone: Sprint-20110712
Component: logging Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: Very High
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 3.0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

Traceback (most recent call last):
  File "/home/reed/opt/bind10/sbin/bind10", line 65, in <module>
    import isc.cc
  File "/home/reed/opt/bind10/lib/python3.1/site-packages/isc/__init__.py", line 3, in <module>
    import isc.config
  File "/home/reed/opt/bind10/lib/python3.1/site-packages/isc/config/__init__.py", line 1, in <module>
    from isc.config.ccsession import *
  File "/home/reed/opt/bind10/lib/python3.1/site-packages/isc/config/ccsession.py", line 44, in <module>
    from isc.log import log_config_update
ImportError: cannot import name log_config_update

bind10 and bindctl do not work for me.

Subtickets

Attachments (1)

makefile.diff (743 bytes) - added by jinmei 8 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 8 years ago by jreed

It works for me from source tree (run_bind10.sh) just not installed version.

This is on NetBSD.

comment:2 Changed 8 years ago by jreed

My workarounds:

mv -i /home/reed/opt/bind10/lib/python3.1/site-packages/isc/log.* /home/reed/opt/bind10/lib/python3.1/site-packages/

and manually edit /home/reed/opt/bind10/lib/python3.1/site-packages/isc/config/ccsession.py so it does import log instead of import isc.log.

Note that I have old install of /home/reed/opt/bind10/lib/python3.1/site-packages/isc/log/ directory with its python files there.

comment:3 Changed 8 years ago by jreed

As other workaround:

I edited the /home/reed/opt/bind10/lib/python3.1/site-packages/isc/config/ccsession.py so it does import isc.log instead of import log (so back to original).

Move old python:

mv /home/reed/opt/bind10/lib/python3.1/site-packages/isc/log /home/reed/opt/bind10/lib/python3.1/site-packages/isc/log-MOVED

And put my libraries back in place again:

mv -i /home/reed/opt/bind10/lib/python3.1/site-packages/log.* /home/reed/opt/bind10/lib/python3.1/site-packages/isc/

comment:4 Changed 8 years ago by jreed

Maybe use a new name for this?

Maybe tell all users to move old isc/log/ directory out of the way? This may be wrong since we shouldn't reuse same name for different technology.

comment:5 follow-up: Changed 8 years ago by vorner

I'm getting slightly lost. Do you have two parallel installs of two versions and one is using files of the other, or you have just one install where the old version was overwritten with newer one?

If it is the second, I agree that is bad. But using a different name looks more wrong than these small problems, the name is to keep consistency with C++ library and is staying forever, the problems are temporary and just for the few brave people using it at this stage. But we could find a workaround (like making sure the log directory doesn't exist during install or putting something similar like the init.py used for testing there).

comment:6 in reply to: ↑ 5 Changed 8 years ago by jreed

Replying to vorner:

I'm getting slightly lost. Do you have two parallel installs of two versions and one is using files of the other, or you have just one install where the old version was overwritten with newer one?

Same installation directory. New overwriting old.

If it is the second, I agree that is bad. But using a different name looks more wrong than these small problems, the name is to keep consistency with C++ library and is staying forever, the problems are temporary and just for the few brave people using it at this stage. But we could find a workaround (like making sure the log directory doesn't exist during install or putting something similar like the init.py used for testing there).

We should not get into a habit of asking end-users to manually clean up.

(On a related note, I plan to make an automated builder that installs to same prefix everytime and then attempts to run some from there.)

comment:7 Changed 8 years ago by jinmei

How about the attached patch?

It will draw an explicit attention for early adopters to the pitfall
when they first try to upgrade to an incomatible version (and will tell
them what is wrong and what should be done).

This is a hack, and considering we are still in a very early stage of
deployment (so keeping the source clean and simpler could be preferred
over ensuring complete backward compatibility), I think we can/should
remove this rule in a 2-3 releases later (we'll need a ticket not to
forget it).

Changed 8 years ago by jinmei

comment:8 Changed 8 years ago by jinmei

  • Milestone changed from New Tasks to Next-Sprint-Proposed
  • Owner set to jreed
  • Status changed from new to reviewing

comment:9 Changed 8 years ago by stephen

  • Milestone changed from Next-Sprint-Proposed to Sprint-20110712

comment:10 Changed 8 years ago by jreed

  • Owner changed from jreed to jinmei

The patch is fine. It works for me. It is a little late since much is already installed so install tree may be destroyed. But at least it is a reminder to fix then. Please add to master and I will pull to my branch.

comment:11 follow-up: Changed 8 years ago by jreed

  • Owner changed from jinmei to UnAssigned

I put the patch into master. I am not closing this ticket.

comment:12 in reply to: ↑ 11 Changed 8 years ago by jinmei

Replying to jreed:

I put the patch into master. I am not closing this ticket.

I suggest we close this one and create a new ticket for the cleanup task
for the benefit of task planning.

At the very least we should remove it from the current sprint and from
the review queue.

comment:13 Changed 8 years ago by stephen

  • Estimated Difficulty changed from 0.0 to 3

comment:14 Changed 8 years ago by jinmei

New ticket created (#1099). Closing this one.

comment:15 Changed 8 years ago by jinmei

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.