What can cause an InvalidObjectReference?
When a product I have was stuck on a windows server this seems to happen a lot. On the unix servers I have been running the product on normally this seems to happen about once/week under pretty heavy usage. This is the error message Error Type: InvalidObjectReference Error Value: Attempt to store an object from a foreign database connection This is the traceback for it Traceback (innermost last): File D:\ZOPE1\lib\python\ZPublisher\Publish.py, line 223, in publish_module File D:\ZOPE1\lib\python\ZPublisher\Publish.py, line 187, in publish File D:\ZOPE1\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook File D:\ZOPE1\lib\python\ZPublisher\Publish.py, line 175, in publish File D:\ZOPE1\lib\python\Zope\__init__.py, line 235, in commit File D:\ZOPE1\lib\python\ZODB\Transaction.py, line 300, in commit File D:\ZOPE1\lib\python\ZODB\Connection.py, line 375, in commit (Info: (('Products.CompoundDoc.inputtext', 'InputText'), '\000\000\000\000\000\000-t', '')) InvalidObjectReference: (see above) I am mostly wondering what kinds of things in my code could cause this problem. Mostly I need a place to start to try and debug this. The "fix" I have normally used is that if I hit refresh the problem will go away until it happens again. It just allows you to keep working with it again until whatever it is that causes it causes it again. I hope that helps some also. Thanks Kosh
This will happen if yoiu've got a mounted ZODB database, and you attempt to store an object in the mounted database which has references to other objects in the "main" database (or vice versa). For more info, read the docs that ship with CoreSessionTracking. - C kosh wrote:
When a product I have was stuck on a windows server this seems to happen a lot. On the unix servers I have been running the product on normally this seems to happen about once/week under pretty heavy usage.
This is the error message Error Type: InvalidObjectReference Error Value: Attempt to store an object from a foreign database connection
This is the traceback for it Traceback (innermost last): File D:\ZOPE1\lib\python\ZPublisher\Publish.py, line 223, in publish_module File D:\ZOPE1\lib\python\ZPublisher\Publish.py, line 187, in publish File D:\ZOPE1\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook File D:\ZOPE1\lib\python\ZPublisher\Publish.py, line 175, in publish File D:\ZOPE1\lib\python\Zope\__init__.py, line 235, in commit File D:\ZOPE1\lib\python\ZODB\Transaction.py, line 300, in commit File D:\ZOPE1\lib\python\ZODB\Connection.py, line 375, in commit (Info: (('Products.CompoundDoc.inputtext', 'InputText'), '\000\000\000\000\000\000-t', '')) InvalidObjectReference: (see above)
I am mostly wondering what kinds of things in my code could cause this problem. Mostly I need a place to start to try and debug this.
The "fix" I have normally used is that if I hit refresh the problem will go away until it happens again. It just allows you to keep working with it again until whatever it is that causes it causes it again. I hope that helps some also.
Thanks Kosh
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
-- Chris McDonough Zope Corporation http://www.zope.org http://www.zope.com "Killing hundreds of birds with thousands of stones"
On Friday 24 August 2001 06:38 am, Chris McDonough wrote:
This will happen if yoiu've got a mounted ZODB database, and you attempt to store an object in the mounted database which has references to other objects in the "main" database (or vice versa).
For more info, read the docs that ship with CoreSessionTracking.
- C
Interesting to know but unfortunately it doesn't cover this situation as far as I can tell. I have only one ZODB and the objects are stored directly in there. There are no other databases being used with it either (ie an SQL DB). The objects are CatalogAware though and do catalog themselves in the catalog. On the windows server this operation will cause the InvalidObjectReference nearly every time an object is created and much of the time when an object is changed. To make matters worse on the unix boxes the items create and catalog themselves just fine most of the time. On them the error seems to occur about once per week or so. When I look in the Catalog though everything looks normal. It has a PrincipiaSearchSource that has the keywords I would expect along with the date it was changed etc. It is a default Catalog without any custom indexes etc added to it at this point. PrincipiaSearchSource for my object returns a string of all the words it wants cataloged. Thanks again
kosh wrote:
When a product I have was stuck on a windows server this seems to happen a lot. On the unix servers I have been running the product on normally this seems to happen about once/week under pretty heavy usage.
This is the error message Error Type: InvalidObjectReference Error Value: Attempt to store an object from a foreign database connection
This is the traceback for it Traceback (innermost last): File D:\ZOPE1\lib\python\ZPublisher\Publish.py, line 223, in publish_module File D:\ZOPE1\lib\python\ZPublisher\Publish.py, line 187, in publish File D:\ZOPE1\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook File D:\ZOPE1\lib\python\ZPublisher\Publish.py, line 175, in publish File D:\ZOPE1\lib\python\Zope\__init__.py, line 235, in commit File D:\ZOPE1\lib\python\ZODB\Transaction.py, line 300, in commit File D:\ZOPE1\lib\python\ZODB\Connection.py, line 375, in commit (Info: (('Products.CompoundDoc.inputtext', 'InputText'), '\000\000\000\000\000\000-t', '')) InvalidObjectReference: (see above)
I am mostly wondering what kinds of things in my code could cause this problem. Mostly I need a place to start to try and debug this.
The "fix" I have normally used is that if I hit refresh the problem will go away until it happens again. It just allows you to keep working with it again until whatever it is that causes it causes it again. I hope that helps some also.
Thanks Kosh
Hmm.. of course this is one of those problems that we can't fix without replicating it and it doesn't sound terribly replicable at the moment. - C kosh wrote:
On Friday 24 August 2001 06:38 am, Chris McDonough wrote:
This will happen if yoiu've got a mounted ZODB database, and you attempt to store an object in the mounted database which has references to other objects in the "main" database (or vice versa).
For more info, read the docs that ship with CoreSessionTracking.
- C
Interesting to know but unfortunately it doesn't cover this situation as far as I can tell. I have only one ZODB and the objects are stored directly in there. There are no other databases being used with it either (ie an SQL DB). The objects are CatalogAware though and do catalog themselves in the catalog. On the windows server this operation will cause the InvalidObjectReference nearly every time an object is created and much of the time when an object is changed. To make matters worse on the unix boxes the items create and catalog themselves just fine most of the time. On them the error seems to occur about once per week or so.
When I look in the Catalog though everything looks normal. It has a PrincipiaSearchSource that has the keywords I would expect along with the date it was changed etc. It is a default Catalog without any custom indexes etc added to it at this point. PrincipiaSearchSource for my object returns a string of all the words it wants cataloged.
Thanks again
kosh wrote:
When a product I have was stuck on a windows server this seems to happen a lot. On the unix servers I have been running the product on normally this seems to happen about once/week under pretty heavy usage.
This is the error message Error Type: InvalidObjectReference Error Value: Attempt to store an object from a foreign database connection
This is the traceback for it Traceback (innermost last): File D:\ZOPE1\lib\python\ZPublisher\Publish.py, line 223, in publish_module File D:\ZOPE1\lib\python\ZPublisher\Publish.py, line 187, in publish File D:\ZOPE1\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook File D:\ZOPE1\lib\python\ZPublisher\Publish.py, line 175, in publish File D:\ZOPE1\lib\python\Zope\__init__.py, line 235, in commit File D:\ZOPE1\lib\python\ZODB\Transaction.py, line 300, in commit File D:\ZOPE1\lib\python\ZODB\Connection.py, line 375, in commit (Info: (('Products.CompoundDoc.inputtext', 'InputText'), '\000\000\000\000\000\000-t', '')) InvalidObjectReference: (see above)
I am mostly wondering what kinds of things in my code could cause this problem. Mostly I need a place to start to try and debug this.
The "fix" I have normally used is that if I hit refresh the problem will go away until it happens again. It just allows you to keep working with it again until whatever it is that causes it causes it again. I hope that helps some also.
Thanks Kosh
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
-- Chris McDonough Zope Corporation http://www.zope.org http://www.zope.com """ Killing hundreds of birds with thousands of stones """
On Friday 24 August 2001 11:37 am, Chris McDonough wrote:
Hmm.. of course this is one of those problems that we can't fix without replicating it and it doesn't sound terribly replicable at the moment.
Yeah this is the part about the whole thing that pretty much bites. It is hard to debug since I haven't found a way to cause it every time. What I was hoping for what some ideas on what kinds of things could possibly cause something like this and I could examine my code for them and thus try to narrow it down until I could get a good test case. Overall this is very annoying since it only has minor problems on a unix box and the problem has gotten rarer as I have rewritten some things, however on windows it seems to be happening about 80% or more of the time now. It is certainly a very strange thing to have happen.
- C
kosh wrote:
On Friday 24 August 2001 06:38 am, Chris McDonough wrote:
This will happen if yoiu've got a mounted ZODB database, and you attempt to store an object in the mounted database which has references to other objects in the "main" database (or vice versa).
For more info, read the docs that ship with CoreSessionTracking.
- C
<snip>
kosh writes:
When a product I have was stuck on a windows server this seems to happen a lot. On the unix servers I have been running the product on normally this seems to happen about once/week under pretty heavy usage.
This is the error message Error Type: InvalidObjectReference Error Value: Attempt to store an object from a foreign database connection Interesting!
Do you store persistent objects in a (thread-global) cache of some kind? Do you create your own threads and do they access the ZODB? Dieter
participants (4)
-
Chris McDonough -
Chris McDonough -
Dieter Maurer -
kosh