[Zope-dev] Re: data migration from zope 2.6.1 to zope 2.7.0-b2

2004-02-07 Thread AltKey
Paul Winkler wrote:
On Fri, Feb 06, 2004 at 03:12:39PM -0600, J Cameron Cooper wrote:

altkey wrote:


I am fairly new to zope  python but I am working to migrate some 
data/objects from zope 2.6.1 to zope 2.7.0-b2 (and eventually 2.7.0 
final.

What I am doing is this.
  (1) get Dublin core metadata + some Dublin core extensions for the 
objects
  (2) get pure text representation of object content - I can't use  
a simple import/export in zexp format because the classes in the 
receiving zope instance differ significantly from the classes in the 
sending zope instance.

I am able to collect all the data mentioned above and pass it across 
to the new 2.7.0-b2 zope instance but i am having trouble getting my 
objects to live where they need to live; specifically their path is 
not being accepted properly when i recreate the objects.
Before trying to deal with the problem you state, I'll make two possibly 
simplifying observations:

1. There should be no need to do any migration when upgrading Zope. The 
ZODB has not changed, and you may simply copy it over or upgrade Zope in 
place.

2. ZSyncer is the best magic for copying objects from one instance to 
another.


I doubt it will help. ZSyncer is a shortcut for export - import,
and altkey wants to convert between two different classes.
Also zsyncer currently enforces (stupidly) that the two
zopes must have the same folder hierarchy - you can't
sync /foo/bar/baz to /bat/bar/baz.
altkey, maybe you should break this into multiple steps, some
of which are apparently done already;
something like:
1) write code that extracts data from an old class.

2) write code that creates an instance of the new class
from this data.
note that this is on one server so the classes must have
different names or live in different modules.
i think you're ok here already.
3) write a script that upgrades a single object in place by
doing #1, deleting the object, then doing #2
4) write a script that walks a folder tree and does #3
on all instances of the old class.
5) use zsyncer or export / import to copy the objects
from the old zope to the new zope.

What I am doing is transferring data (not full objects) from one 
Zope/CMF instance to another. The change of Zope version isn't the issue 
for me. The issue is the classes present in the two instances. the first 
instance zope 2.6.1 has a number of products that were written by the 
group i work with (DF 2.0) and the receiving instance zope 2.7.0-b2 has 
different classes (DF 3.0) which naturally could not accept the objects 
from zodb because the supporting classes are not present in their 
intended new home.

What I am having trouble is the path that 
myObject.invokeFactory(type,id) uses. I try to set up a specific path 
for myObject but the invokeFactory puts the new object into the DF root 
rather than into the path for myObject.

I do  not understand zope well enough to sort out the problem for myself 
yet, so i posted a question here and in the CMF news group.

If you or anybody else can help I'd appreciate it very much.

Cheers
AlyKey (aka Phil)
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-07 Thread Dieter Maurer
Christian Heimes wrote at 2004-2-6 23:01 +0100:
And the next one:

Python2.3.3/Zope2.70rc2/Plone2rc5.

Exception Type
AttributeError
Exception Value
'str' object has no attribute 'RESPONSE'

[...]
Module Products.CMFPhoto.Photo, line 510, in clearCache
AttributeError: 'str' object has no attribute 'RESPONSE'

The relevant code line is self.REQUEST.RESPONSE.setHeader(). The error
occured at object creation.

Something really bad is going on!

This may indeed be a memory corruption problem where
the same object is released/freed twice.

A long time ago, I used purify to analyse such problems.
It may no longer be feasible as Python now uses its own
memory management on top of the standard one.

It may be possible to compile Python in a way that it checks
for badly used memory management functions.

-- 
Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-07 Thread Leonardo Rochael Almeida
On Fri, 2004-02-06 at 20:01, Christian Heimes wrote:
 Christian Heimes wrote:
 [...]
 
 And the next one:
 
 Python2.3.3/Zope2.70rc2/Plone2rc5.
 
 Exception Type
 AttributeError
 Exception Value
 'str' object has no attribute 'RESPONSE'
 
 [...]
 Module Products.CMFPhoto.Photo, line 510, in clearCache
 AttributeError: 'str' object has no attribute 'RESPONSE'

METOO!

I just got this error. I commented out line 510 and the code worked.

I was about to uncomment the code again to try and debug it. It happened
when I tried to upload a .jpg thru webdav (konqueror webdav support) to
a CMFPhotoAlbum (0.4final) inside a plone2rc5 instance (Zope 2.6.4rc2,
Python 2.3.3).

I'm curious to at least know what kind of string 'self.REQUEST' is :-)

Want to coordinate? I'm happy to be the guinnea pig for this bug.


-- 
Leonardo Rochael Almeida [EMAIL PROTECTED]

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-07 Thread Chris McDonough
FWIW, this often happens when self isn't ultimately wrapped in a
RequestContainer (as it always should be when dealing with TTW code or
code that depends on REQUEST).  The string is likely something like
Special Object Used To Force Acqusition, which is the string that
represents something when it is declared as Acquisition.Acquired in a
class definition.

The trick is finding out where the thing loses its context.  No clue in
this case.

On Sat, 2004-02-07 at 18:51, Leonardo Rochael Almeida wrote:
 On Fri, 2004-02-06 at 20:01, Christian Heimes wrote:
  Christian Heimes wrote:
  [...]
  
  And the next one:
  
  Python2.3.3/Zope2.70rc2/Plone2rc5.
  
  Exception Type
  AttributeError
  Exception Value
  'str' object has no attribute 'RESPONSE'
  
  [...]
  Module Products.CMFPhoto.Photo, line 510, in clearCache
  AttributeError: 'str' object has no attribute 'RESPONSE'
 
 METOO!
 
 I just got this error. I commented out line 510 and the code worked.
 
 I was about to uncomment the code again to try and debug it. It happened
 when I tried to upload a .jpg thru webdav (konqueror webdav support) to
 a CMFPhotoAlbum (0.4final) inside a plone2rc5 instance (Zope 2.6.4rc2,
 Python 2.3.3).
 
 I'm curious to at least know what kind of string 'self.REQUEST' is :-)
 
 Want to coordinate? I'm happy to be the guinnea pig for this bug.
 


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-07 Thread Christian Heimes
Chris McDonough wrote:
 FWIW, this often happens when self isn't ultimately wrapped in a
 RequestContainer (as it always should be when dealing with TTW code or
 code that depends on REQUEST).  The string is likely something like
 Special Object Used To Force Acqusition, which is the string that
 represents something when it is declared as Acquisition.Acquired in a
 class definition.

 The trick is finding out where the thing loses its context.  No clue in
 this case.
If it's Special Object Used To Force Acqusition then it's (maybe) 
partly my fault. type(self.REQUEST) is Special Object Used To Force 
Acqusition when the object hasn't a real acquisition context. That's 
for example when we are still in the __init__() part of object creation.

I was pretty shure that upload_data is called in an acquisition context. 
It seems that it isn't called in a context under *every* circumstances.

Chris - was tricked again - ti(r)an

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-07 Thread Leonardo Rochael Almeida
On Sat, 2004-02-07 at 22:47, Christian Heimes wrote:
 Chris McDonough wrote:
   FWIW, this often happens when self isn't ultimately wrapped in a
   RequestContainer (as it always should be when dealing with TTW code or
   code that depends on REQUEST).  The string is likely something like
   Special Object Used To Force Acqusition, which is the string that
   represents something when it is declared as Acquisition.Acquired in a
   class definition.
  
   The trick is finding out where the thing loses its context.  No clue in
   this case.
 
 If it's Special Object Used To Force Acqusition then it's (maybe) 
 partly my fault.

That's it alright,

 type(self.REQUEST) is Special Object Used To Force 
 Acqusition when the object hasn't a real acquisition context. That's 
 for example when we are still in the __init__() part of object creation.

That's it alright :-)

 I was pretty shure that upload_data is called in an acquisition context. 
 It seems that it isn't called in a context under *every* circumstances.

In this case it's being callet by Photo.__init__ - OFS.Image.__init__ - 
Photo.update_data

Here's the traceback:

Traceback (innermost last):
  File /opt/zope/sw/Zope-264rc2/lib/python/ZPublisher/Publish.py, line 98, in publish
  File /opt/zope/sw/Zope-264rc2/lib/python/ZPublisher/mapply.py, line 88, in mapply
(Object: PUT)
  File /opt/zope/sw/Zope-264rc2/lib/python/ZPublisher/Publish.py, line 39, in 
call_object
(Object: PUT)
  File /opt/zope/sw/Zope-264rc2/lib/python/webdav/NullResource.py, line 108, in PUT
(Object: dcp_0996.jpg)
  File /home/leo/zopes/lra.com.br/Products/CMFPhotoAlbum/PhotoAlbum.py, line 69, in 
PUT_factory
(Object: unisa-congresso-brooklin)
  File /home/leo/zopes/lra.com.br/Products/CMFCore/PortalFolder.py, line 361, in 
invokeFactory
(Object: unisa-congresso-brooklin)
  File /home/leo/zopes/lra.com.br/Products/CMFCore/TypesTool.py, line 709, in 
constructContent
(Object: portal_types)
  File /home/leo/zopes/lra.com.br/Products/CMFCore/TypesTool.py, line 398, in 
constructInstance
(Object: Photo)
  File /home/leo/zopes/lra.com.br/Products/CMFPhoto/Photo.py, line 110, in addPhoto
(Object: unisa-congresso-brooklin)
  File /home/leo/zopes/lra.com.br/Products/CMFPhoto/Photo.py, line 174, in __init__
(Object: dcp_0996.jpg)
  File /home/leo/zopes/lra.com.br/Products/CMFDefault/Image.py, line 147, in __init__
(Object: dcp_0996.jpg)
  File /opt/zope/sw/Zope-264rc2/lib/python/OFS/Image.py, line 124, in __init__
(Object: dcp_0996.jpg)
  File /home/leo/zopes/lra.com.br/Products/CMFPhoto/Photo.py, line 400, in update_data
(Object: dcp_0996.jpg)
  File /home/leo/zopes/lra.com.br/Products/CMFPhoto/Photo.py, line 510, in clearCache
(Object: dcp_0996.jpg)
AttributeError: 'str' object has no attribute 'RESPONSE'


Cheers, Leo


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )