I have exported a section of my site using the zmi export function. When I try to import this site into a fresh installation of zope I get the following error: Error Type:Bad Request Error Value:The id "Catalog" is invalid--it is already in use. I have double and triple checked and there is not an id "Catalog" anywhere to be found. I then tried importing it in a new folder back onto the machine from which it was exported and get the same message. What is does this message mean? Thanks, -- Michael Long <mlong@datalong.com>
Michael Long wrote at 2003-6-14 15:39 -0400:
I have exported a section of my site using the zmi export function. When I try to import this site into a fresh installation of zope I get the following error: Error Type:Bad Request Error Value:The id "Catalog" is invalid--it is already in use.
I have double and triple checked and there is not an id "Catalog" anywhere to be found. I then tried importing it in a new folder back onto the machine from which it was exported and get the same message.
What is does this message mean?
I know this problem when objects are created in "manage_afterAdd". Object creation in "manage_afterAdd" succeeds when the object is created. However, it fails for "copy/import" and potentially for "move" as the object was already created by the "copy". "manage_afterAdd" can not create the object as it is already there. Looking at the traceback should give you enough information to verify whether this is your problem. In the future, please include the traceback (in addition to the "Error Type", "Error Value"). Dieter
That must be the problem. The Catalog object was created in "manage_afterAdd". How do I work around this issue. You will find the traceback below. * Module ZPublisher.Publish, line 98, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 39, in call_object * Module OFS.ObjectManager, line 530, in manage_importObject * Module OFS.ObjectManager, line 551, in _importObjectFromFile * Module OFS.ObjectManager, line 272, in _setObject * Module OFS.ObjectManager, line 280, in manage_afterAdd * Module Products.PRealEstate.PRealEstate, line 95, in manage_afterAdd * Module Products.PRealEstate.PTools, line 25, in setupCatalog * Module Products.ZCatalog.ZCatalog, line 53, in manage_addZCatalog * Module OFS.ObjectManager, line 244, in _setObject * Module OFS.ObjectManager, line 77, in checkValidId Thanks, Mike On Sun, 2003-06-15 at 17:30, Dieter Maurer wrote:
Michael Long wrote at 2003-6-14 15:39 -0400:
I have exported a section of my site using the zmi export function. When I try to import this site into a fresh installation of zope I get the following error: Error Type:Bad Request Error Value:The id "Catalog" is invalid--it is already in use.
I have double and triple checked and there is not an id "Catalog" anywhere to be found. I then tried importing it in a new folder back onto the machine from which it was exported and get the same message.
What is does this message mean?
I know this problem when objects are created in "manage_afterAdd".
Object creation in "manage_afterAdd" succeeds when the object is created. However, it fails for "copy/import" and potentially for "move" as the object was already created by the "copy". "manage_afterAdd" can not create the object as it is already there.
Looking at the traceback should give you enough information to verify whether this is your problem. In the future, please include the traceback (in addition to the "Error Type", "Error Value").
Dieter -- Michael Long <mlong@datalong.com>
Michael Long wrote:
That must be the problem. The Catalog object was created in "manage_afterAdd". How do I work around this issue. You will find the traceback below.
* Module ZPublisher.Publish, line 98, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 39, in call_object * Module OFS.ObjectManager, line 530, in manage_importObject * Module OFS.ObjectManager, line 551, in _importObjectFromFile * Module OFS.ObjectManager, line 272, in _setObject * Module OFS.ObjectManager, line 280, in manage_afterAdd * Module Products.PRealEstate.PRealEstate, line 95, in manage_afterAdd * Module Products.PRealEstate.PTools, line 25, in setupCatalog * Module Products.ZCatalog.ZCatalog, line 53, in manage_addZCatalog * Module OFS.ObjectManager, line 244, in _setObject * Module OFS.ObjectManager, line 77, in checkValidId
I haven't tried this, but I think this should work. Just change the sourcecode of PRealEstate.PRealEstate.manage_afterAdd and add something like if not 'Catalog' in self.ObjectIds(): as a condition before the catalog is added there. Or a try/except clause ... cheers, oliver
Thanks for the suggestion. Using the "try:" method worked. So does this mean that the code is "run" similar to a macro as opposed to just dumping the data into the database? Mike On Mon, 2003-06-16 at 09:29, Oliver Bleutgen wrote:
Michael Long wrote:
That must be the problem. The Catalog object was created in "manage_afterAdd". How do I work around this issue. You will find the traceback below.
* Module ZPublisher.Publish, line 98, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 39, in call_object * Module OFS.ObjectManager, line 530, in manage_importObject * Module OFS.ObjectManager, line 551, in _importObjectFromFile * Module OFS.ObjectManager, line 272, in _setObject * Module OFS.ObjectManager, line 280, in manage_afterAdd * Module Products.PRealEstate.PRealEstate, line 95, in manage_afterAdd * Module Products.PRealEstate.PTools, line 25, in setupCatalog * Module Products.ZCatalog.ZCatalog, line 53, in manage_addZCatalog * Module OFS.ObjectManager, line 244, in _setObject * Module OFS.ObjectManager, line 77, in checkValidId
I haven't tried this, but I think this should work. Just change the sourcecode of PRealEstate.PRealEstate.manage_afterAdd and add something like
if not 'Catalog' in self.ObjectIds():
as a condition before the catalog is added there. Or a try/except clause ...
cheers, oliver
-- Michael Long <mlong@datalong.com>
Michael Long wrote:
Thanks for the suggestion. Using the "try:" method worked. So does this mean that the code is "run" similar to a macro as opposed to just dumping the data into the database?
This is really not my area of expertise, but there are some facts which hint that importing/exporting works like a "macro": Imported instances of products which are not installed are broken, you can change products and import instances which now will see the change (this is what you did). Maybe someone else could comment? cheers, oliver
participants (3)
-
Dieter Maurer -
Michael Long -
Oliver Bleutgen