[Zope-dev] Five registerPackage results in unresolved ConflictError

2008-05-16 Thread Sasha Vincic
Hi
On a server we have a ZEO server with 6 clients. When we start/restart the
server we often get on random instance an AttributeError @@plone and all
other browser pages. I have tracked it down to a ConflictError when
installing Five on startup. See traceback bellow. To solve this I tried to
set enable-product-installation = off to all except one instance but I still
got errors.
For now we restart the broken instances until they work, I have tried to set
sleeping times up to couple seconds between the instances but it didn't make
any difference.

Five fails when it tries to execute the registerPackage in zcml files. Not
the same product every time.
First I thought it didn't respect the enable-product-instalation but that is
checked in App.Product.initializeProduct method.
So I played in fiveconfigure.py with transaction.savepoint() but no success
but if I manually check App.Product.doInstall like in the diff below

Now my question is if this is correct solution for the problem or will it
have other side effects that I am not aware of? How do I write tests for an
ConflicError during startup?

/Sasha

Index: fiveconfigure.py


===


--- fiveconfigure.py(revision 86781)


+++ fiveconfigure.py(working copy)


@@ -23,7 +23,7 @@


 import warnings





 import App.config


-from App.Product import initializeProduct


+from App.Product import initializeProduct, doInstall


 from App.ProductContext import ProductContext


 import Products


 from zLOG import LOG, ERROR


@@ -265,6 +265,8 @@


 if not hasattr(module_, '__path__'):


 raise ValueError(Must be a package and the  \


  package must be filesystem based)


+if not doInstall():


+return





 app = Zope2.app()


 try:




2008-05-16 11:48:17 ERROR Zope Couldn't install Five
Traceback (most recent call last):
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py,
line 783, in install_product
initmethod(context)
  File
/Users/sasha/Development/eea-buildout-clean/products/Five/__init__.py,
line 31, in initialize
zcml.load_site()
  File /Users/sasha/Development/eea-buildout-clean/products/Five/zcml.py,
line 41, in load_site
_context = xmlconfig.file(file)
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/zope/configuration/xmlconfig.py,
line 560, in file
context.execute_actions()
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/zope/configuration/config.py,
line 612, in execute_actions
callable(*args, **kw)
  File
/Users/sasha/Development/eea-buildout-clean/products/Five/fiveconfigure.py,
line 285, in _registerPackage
transaction.commit()
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_manager.py,
line 96, in commit
return self.get().commit(sub, deprecation_wng=False)
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py,
line 380, in commit
self._saveCommitishError() # This raises!
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py,
line 378, in commit
self._commitResources()
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/transaction/_transaction.py,
line 433, in _commitResources
rm.commit(self)
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/ZODB/Connection.py,
line 484, in commit
self._commit(transaction)
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/ZODB/Connection.py,
line 518, in _commit
raise ConflictError(object=obj)
ConfigurationExecutionError: ZODB.POSException.ConflictError: database
conflict error (oid 0x28f61f, class App.Product.Product)
  in:
  File
/Users/sasha/Development/eea-buildout-clean/src/plone.session/plone/session/configure.zcml,
line 5.4-5.65
  five:registerPackage package=. initialize=.initialize /

Traceback (most recent call last):
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/Startup/run.py,
line 56, in ?
run()
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/Startup/run.py,
line 21, in run
starter.prepare()
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/Startup/__init__.py,
line 98, in prepare
self.startZope()
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/Startup/__init__.py,
line 257, in startZope
Zope2.startup()
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/__init__.py,
line 47, in startup
_startup()
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/Zope2/App/startup.py,
line 103, in startup
OFS.Application.initialize(application)
  File
/Users/sasha/Development/eea-buildout-clean/parts/zope2/lib/python/OFS/Application.py,
line 304, in 

[Zope-dev] Zope Tests: 5 OK

2008-05-16 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Thu May 15 11:00:00 2008 UTC to Fri May 16 11:00:00 2008 UTC.
There were 5 messages: 5 from Zope Tests.


Tests passed OK
---

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Tests
Date: Thu May 15 21:00:28 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009555.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Tests
Date: Thu May 15 21:02:01 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009556.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Tests
Date: Thu May 15 21:03:32 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009557.html

Subject: OK : Zope-2.11 Python-2.4.4 : Linux
From: Zope Tests
Date: Thu May 15 21:05:02 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009558.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Tests
Date: Thu May 15 21:06:32 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009559.html

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] zope.testing console script

2008-05-16 Thread Christian Theune
On Thu, May 15, 2008 at 08:32:28AM -0400, Benji York wrote:
 On Thu, May 15, 2008 at 7:43 AM, Wichert Akkerman [EMAIL PROTECTED] wrote:
  Is there a reason to advocate zope.testing over the others? Would it
  perhaps make more sense to use one of the more widely used tools instead
  of maintaing our own testing toolkit?
 
 I'd also like for us to adopt one of the more widely used test
 runners, but as mentioned in replies, there are some features in
 zope.testing that we depend on.  If someone were adequately motivated
 and had sufficient time (neither of which I have, so I suspect no one
 else does either), it would be interesting to attempt to endue another
 test runner with the features we need (layers, etc.).

I like our test runner and spent time refactoring it so we can actually start
making changes again. I looked at other test runners (nose, py.test) and
didn't find anything compelling (to me) that we didn't already have.

Christian

-- 
Christian Theune · [EMAIL PROTECTED]
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] ZODB reverts to older state after ZEO restart

2008-05-16 Thread dvs

Recently we restarted our zeo server and immediately noticed 
that we are missing good bit of recently added content. We seemed 
to have reverted back to a specific date in the past. All content 
updates since have disappeared.

Restoring the Data.fs from a recent backup still had the same effect, the 
content all reverted back to one specific date.  In the logs it does show 
that we restored the Data.fs from a backup, restarted, and migrated to 
a newer version of Zope/Plone (Zope 2.9.4 - 2.9.5, Plone 2.5.4 - 2.5.5). 
After the update, the site was fine and was running along smoothly. 

A few days later this came up in the event.log:

2008-01-24T19:05:44 ERROR ZServer uncaptured python exception, closing
channel ZServer.HTTPServer.zhttp_channel connected 72.249.81.93:56139 at 0x
1598d92c channel#: 45214 requests: (socket.error:(54, 'Connection reset by
peer') [/usr/local/lib/python2.4/asynchat.py|initiate_send|219] [/usr/l
ocal/zope/295/lib/python/ZServer/medusa/http_server.py|send|417]
[/usr/local/lib/python2.4/asyncore.py|send|332])
--
2008-01-24T19:05:45 ERROR ZEO.zrpc (27931) can't decode message:
'(M\x06\xdcK\x00U\x06.reply(TC\x00\x01\x00(cOFS.Image\nP...'
--
2008-01-24T19:05:45 ERROR ZEO.zrpc.Connection(C) (127.0.0.1:) Error
caught in asyncore
Traceback (most recent call last):
  File /usr/local/lib/python2.4/asyncore.py, line 69, in read
obj.handle_read_event()
  File /usr/local/lib/python2.4/asyncore.py, line 391, in
handle_read_event
self.handle_read()
  File /usr/local/zope/295/lib/python/ZEO/zrpc/smac.py, line 219, in
handle_read
self.message_input(msg)
  File /usr/local/zope/295/lib/python/ZEO/zrpc/connection.py, line 387, in
message_input
msgid, flags, name, args = self.marshal.decode(message)
  File /usr/local/zope/295/lib/python/ZEO/zrpc/marshal.py, line 50, in
decode
return unpickler.load() # msgid, flags, name, args
MemoryError
--
2008-01-24T19:05:45 INFO ZEO.ClientStorage (27931) Disconnected from
storage: ('x.com', )
--
2008-01-24T19:05:45 INFO ZEO.ClientStorage (27931) Testing connection
ManagedClientConnection ('72.249.81.93', )
--
2008-01-24T19:05:45 INFO ZEO.zrpc.Connection(C) (127.0.0.1:) received
handshake 'Z303'

--
2008-01-24T19:05:45 ERROR ZODB.Connection Couldn't load state for 0x01868c
Traceback (most recent call last):
  File /usr/local/zope/295/lib/python/ZODB/Connection.py, line 732, in
setstate
self._setstate(obj)
  File /usr/local/zope/295/lib/python/ZODB/Connection.py, line 786, in
_setstate
self._reader.setGhostState(obj, p)
  File /usr/local/zope/295/lib/python/ZODB/serialize.py, line 604, in
setGhostState
state = self.getState(pickle)
  File /usr/local/zope/295/lib/python/ZODB/serialize.py, line 597, in
getState
return unpickler.load()
  File /usr/local/zope/295/lib/python/ZODB/serialize.py, line 471, in
_persistent_load
return self.load_oid(reference)
  File /usr/local/zope/295/lib/python/ZODB/serialize.py, line 537, in
load_oid
return self._conn.get(oid)
  File /usr/local/zope/295/lib/python/ZODB/Connection.py, line 201, in get
p, serial = self._storage.load(oid, self._version)
  File /usr/local/zope/295/lib/python/ZEO/ClientStorage.py, line 746, in
load
return self.loadEx(oid, version)[:2]
  File /usr/local/zope/295/lib/python/ZEO/ClientStorage.py, line 769, in
loadEx
data, tid, ver = self._server.loadEx(oid, version)
  File /usr/local/zope/295/lib/python/ZEO/ServerStub.py, line 192, in
loadEx
return self.rpc.call(loadEx, oid, version)
  File /usr/local/zope/295/lib/python/ZEO/zrpc/connection.py, line 531, in
call
r_flags, r_args = self.wait(msgid)
  File /usr/local/zope/295/lib/python/ZEO/zrpc/connection.py, line 621, in
wait
raise DisconnectedError()
DisconnectedError
--

The persistent cache file has been saved, but looking at the archive it
seems that 
you can't restore a Data.fs from the persistent cache (please correct me on
this). Looking at 
the logs we can find what content was edited in this time frame and we can
see that it did exist at one time, but the data itself is not in any of the
backup Data.fs files we have.

This is a bit perplexing in that when we restore from any of the backups it
still reverts, what could 
cause this situation and if the data was in fact being saved, where could it
have been saved? We 
were backing up the correct Data.fs (at least, it was the Data.fs that the
zeo server was connected to)

If the zeo server was read only this would make sense but then we wouldn't
be able to make any 
content updates and it would be immediately evident.

Any suggestions or ideas on how we could recover any of this data and the
reasoning behind this happening is much appreciated. 

-- 
View this message in context: 
http://www.nabble.com/ZODB-reverts-to-older-state-after-ZEO-restart-tp17264827p17264827.html
Sent from the Zope - General mailing list archive at Nabble.com.

___
Zope 

Re: [Zope] ZODB reverts to older state after ZEO restart

2008-05-16 Thread Dieter Maurer
dvs wrote at 2008-5-16 07:36 -0700:

Recently we restarted our zeo server and immediately noticed 
that we are missing good bit of recently added content. We seemed 
to have reverted back to a specific date in the past. All content 
updates since have disappeared.

This usually means that you moved or deleted your storage file
while ZEO was running.

Under *nix, processes that have a file open when it is moved or deleted
continue to operate on this file and not a potentially new file
at the original place.
However, a newly started process will the the new state and use
such a new file.


If you are lucky, the storage file was moved and you still
know the moved to location. Then, you find all your current state
in this file. Otherwise, your chances are bad



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Confused about permissions

2008-05-16 Thread Dieter Maurer
Brenda Bell wrote at 2008-5-13 13:27 +:
In article [EMAIL PROTECTED],
 Brenda Bell [EMAIL PROTECTED] 
 wrote:

 What I can't seem to do is get the permissions right such that a user in 
 the Editor role can add new External Files.
 
 I've checked every box on the Security tab for the Editor role.  Users 
 in the Editor role can view and modify existing ExternalFile's but still 
 cannot add new ones.
 

I enabled VerboseSecurity and I see this in my console window when I try 
to add an ExternalFile when logged in as a user who is assigned the 
Editor role:

2008-05-13 13:12:55 ERROR Zope.SiteErrorLog 
http://localhost:8090/foo/manage_addProduct/ExternalFile/manage_addObject
ViaGui
Traceback (innermost last):
  Module ZPublisher.Publish, line 110, in publish
  Module ZPublisher.BaseRequest, line 596, in traverse
  Module ZPublisher.HTTPResponse, line 713, in unauthorized
Unauthorized: strongYou are not authorized to access this 
resource./strongp
No Authorization header found./p 

The manage_addObject requires roles for which no user folder
in context could identify an appropriate user.

You could try to find out in an interactive interpreter
(started with bin/zopectl debug under *nix) which
roles are required.

  
app.unrestrictedTraverse('foo/manage_addProduct/ExternalFile').manage_addObject__roles__



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Weird SQL Relay conversion error in Zope

2008-05-16 Thread Dieter Maurer
Mike Driscoll wrote at 2008-5-9 08:31 -0500:
 ...
I am working on a web app that interfaces with Microsoft SQL Server from 
Ubuntu through SQL Relay. I will be getting data from multiple databases. The 
issue seems to be that either Zope or SQL Relay cannot handle the Decimal type 
if the value is a null. If I do a query like this:
 ...
* Module Products.ZSQLRelayDA.db, line 86, in query
* Module decimal, line 571, in __new__
* Module decimal, line 2267, in _raise_error

InvalidOperation: (Also, the following error occurred while attempting to 
render the standard error message, please see the event log for full details: 
'@@plone')

Looks like a bug in ZSQLRelayDA.db.

  Apparently, it passes SQL decimal values to Python's decimal module --
  even if the SQL value is Null (almost surely mapped to Python's None).
  For obvious reasons, decimal does not like to convert None
  into a decimal value.

  ZSQLRelayDA.db should test for None and call the decimal
  constructor only for non None values.



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Weird SQL Relay conversion error in Zope

2008-05-16 Thread Mike Driscoll

Dieter,

Mike Driscoll wrote at 2008-5-9 08:31 -0500:
  

...
I am working on a web app that interfaces with Microsoft SQL Server from Ubuntu 
through SQL Relay. I will be getting data from multiple databases. The issue 
seems to be that either Zope or SQL Relay cannot handle the Decimal type if the 
value is a null. If I do a query like this:
...
   * Module Products.ZSQLRelayDA.db, line 86, in query
   * Module decimal, line 571, in __new__
   * Module decimal, line 2267, in _raise_error

InvalidOperation: (Also, the following error occurred while attempting to 
render the standard error message, please see the event log for full details: 
'@@plone')



Looks like a bug in ZSQLRelayDA.db.

  Apparently, it passes SQL decimal values to Python's decimal module --
  even if the SQL value is Null (almost surely mapped to Python's None).
  For obvious reasons, decimal does not like to convert None
  into a decimal value.

  ZSQLRelayDA.db should test for None and call the decimal
  constructor only for non None values.


  


I suspected as much. I mentioned trying SQLAlchemy to my boss and he 
tried it to see if it could handle this issue and it does. So we'll 
probably stick with that, but thanks for the clarification.


Mike



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZODB reverts to older state after ZEO restart

2008-05-16 Thread dvs

I believe this is the case, I found another thread with a similar problem: 

http://www.nabble.com/Missing-Content-td4174116.html


Dieter Maurer wrote:
 
 dvs wrote at 2008-5-16 07:36 -0700:

Recently we restarted our zeo server and immediately noticed 
that we are missing good bit of recently added content. We seemed 
to have reverted back to a specific date in the past. All content 
updates since have disappeared.
 
 This usually means that you moved or deleted your storage file
 while ZEO was running.
 
 Under *nix, processes that have a file open when it is moved or deleted
 continue to operate on this file and not a potentially new file
 at the original place.
 However, a newly started process will the the new state and use
 such a new file.
 
 
 If you are lucky, the storage file was moved and you still
 know the moved to location. Then, you find all your current state
 in this file. Otherwise, your chances are bad
 
 
 
 -- 
 Dieter
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )
 
 

-- 
View this message in context: 
http://www.nabble.com/ZODB-reverts-to-older-state-after-ZEO-restart-tp17264827p17284454.html
Sent from the Zope - General mailing list archive at Nabble.com.

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