Re: [Zope] ZEO troubles on RedHat EL4 Linux

2005-08-18 Thread Jens Vagelpohl


On 18 Aug 2005, at 07:50, Andreas Krasa // WUW wrote:

Is that worth submitting a bug to RedHat? Or is ist more like a
"feature"? ;)


Why would RedHat care? They will just throw it back at you and say  
"sorry, Zope is not one of our supported packages".


By the way, I hope you are not running Zope on the system-installed  
Python? If you do, then change your setups to build and install your  
own Python just for Zope and test again.


jens




smime.p7s
Description: S/MIME cryptographic signature
___
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] ZEO troubles on RedHat EL4 Linux

2005-08-18 Thread Andreas Krasa // WUW
Jens Vagelpohl schrieb:

> On 18 Aug 2005, at 07:50, Andreas Krasa // WUW wrote:
> 
>> Is that worth submitting a bug to RedHat? Or is ist more like a
>> "feature"? ;)
> 
> 
> Why would RedHat care? They will just throw it back at you and say 
> "sorry, Zope is not one of our supported packages".
> 
> By the way, I hope you are not running Zope on the system-installed 
> Python? If you do, then change your setups to build and install your 
> own Python just for Zope and test again.
> 
> jens

Hi Jens,

no, we've rebuilt python (2.3.5) from sources, and, as our main Zope
product Silva requires this, also libxml2 and libxslt (of course with
pointing to our own python). This stuff all resides in /usr/local. We've
compiled Zope pointing to /usr/local/bin/python23, so I guess that
RedHat's own python RPM does not interfere with Zope, at least I hope so.

As I understood Dieter's mail, this strange behavior is caused by the
way RedHat Enterprise Linux 4 system libraries handle SIG_IGN/SIGCHLD.

If this problem was due to some improper Zope methods, most people would
have this sort of problems. Which is not the case. That makes me believe
that the failure of ZEO tests actually is caused by some uncommon or
improper implementation of those two handles - which, in my opinion,
makes it something RedHat should take a look at.

Anyway - how severe are those testing failures for actually USING a ZEO
client/server on that particular OS as a production system?

Cheers,
Andreas
___
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] ZEO troubles on RedHat EL4 Linux

2005-08-18 Thread Jens Vagelpohl


On 18 Aug 2005, at 11:00, Andreas Krasa // WUW wrote:

As I understood Dieter's mail, this strange behavior is caused by the
way RedHat Enterprise Linux 4 system libraries handle SIG_IGN/SIGCHLD.


That makes me wonder why it does not happen on my CentOS 4 box.  
CentOS 4 is compiled from RHEL4 SRPMs with only very minor changes,  
mostly to remove copyrighted RedHat logos and names.



Anyway - how severe are those testing failures for actually USING a  
ZEO

client/server on that particular OS as a production system?


I personally would not trust a system for production where the unit  
tests don't run until it's proven that the unit tests themselves are  
dodgy, or whatever else caused it is fixed.


jens

___
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] Zope 2.8.1 on Mac OS X tiger Server

2005-08-18 Thread Garito

Bernd Dorn escribió:



On 17.08.2005, at 20:22, Garito wrote:


Bernd Dorn escribió:



the following 3 problems

this line must be in /etc/hostconfig
ZOPESERVER=-YES-



On 17.08.2005, at 13:03, Garito wrote:



Hi all!

Yesterday I install Zope 2.8.1 on a Mac OS X tiger Server and  all  
goes ok


The only question I can't configure is the automatic boot up

I read some how-to's but they don't work

At /System/Library/StartupItems I create a folder called Zope  
with  2 files:


Zope with these contents:




the 'Zope'  file must be executable in order to work

chmod +x Zope





#!/bin/sh

##
# Zope Web Application Server
##

. /etc/rc.common

StartService ()
{
   if [ "${ZOPESERVER=-NO-}" = "-YES-" ]; then
   ConsoleMessage "Starting Zope"
   /var/zope/sistes/bin/zopectl start




typo? sistes == sites



   fi
}

StopService ()
{
   ConsoleMessage "Stopping Zope"
   /var/zope/sistes/bin/zopectl stop
}

RestartService ()
{
   if [ "${ZOPESERVER=-NO-}" = "-YES-" ]; then
   ConsoleMessage "Restarting Zope"
   /var/zope/sistes/bin/zopectl restart
   fi
}

RunService "$1"

and StartupParameters.plist with these content:


http://www.apple.com/DTDs/PropertyList-1.0.dtd";>


Description
Zope web application server
OrderPreference
None
Provides

Zope Server

Requires

Web Server




With these 2 files zope doesn't start at boot time. For that   
question I try another StartupParameters.plist:


{
 Description = "Zope WebServer";
 Provides= ("Zope WebServer");
 Requires= ("Web Server");
 OrderPreference = "None";
 Messages =
 {
   start = "Starting Zope WebServer Service";
   stop  = "Stopping Zope WebServer Service";
 };
}

but It doesn't work too

Can anyone help me?

Thanks a lot!

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
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 )




___
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 )



Hi again!
Sorry but Zope is executable, perhaps another thing?
Any idea?

hm, have you set the effective user in zope.conf? you need this if  
you run zopectl as root


as root try to execute

/System/Library/StartupItems/Zope/Zope

from the commandline

and have a look what if something is looged into your event.log

without any messages i have no clue






Thanks

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
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 )



___
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 )


Sorry but my Mac OS X skill are null

I try:

sudo /System/Library/StartupItems/Zope/Zope

but raises line 31: $1: unbound variable

now I supouse $1 will be StartService/StopService/RestarService

then I try:

sudo /System/Library/StartupItems/Zope/Zope StartService

but raises unknown argument: StartService

I another hand at Console there aren't any message about Zope on it

Sorry for my inexperience and thanks a lot!!!

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
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] Zope 2.8.1 on Mac OS X tiger Server

2005-08-18 Thread Andrew Langmead

On Aug 18, 2005, at 1:19 PM, Garito wrote:


Sorry but my Mac OS X skill are null


I think you are in the unfortunate spot of of OS X where you are  
confronted with the ease of use of Unix and the ubiquity of the  
Macintosh.




I try:

sudo /System/Library/StartupItems/Zope/Zope

but raises line 31: $1: unbound variable

now I supouse $1 will be StartService/StopService/RestarService





You might want to take a look at some of Apple's documentation for  
creating its startup items, since it is significantly different than  
either the traditional Unix styles (both BSD and SysV)





Also, I would recommend against putting your startup items in /System/ 
Library/StartupItems, and suggest to use /Library/StartupItems  
instead. Everything in /System can be overwritten by OS upgrades, / 
Library is for a machine's local customizations.


What I believe you want in order to test your script is:

sudo /Library/StartupItems/Zope/Zope start


the RunService function will take the argument "start" , "stop", or  
"restart", and based on that, run either the function "StartService",  
"StopService", or "RestartService". All three functions need to  
exist, whether they are used or not.




Once you get that to succeed, you might want to try to see if this  
succeeeds:


sudo /sbin/SystemStarter  restart "Zope WebServer"

(or maybe "Zope Server", you seem to have changed it between plist  
revisions.)


___
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] URL0 returns index_html not index.html

2005-08-18 Thread John Eikenberry
Mark Barratt wrote:

> Zope 2.7.4 on Debian
> 
> DTML method index_html in the root says 
> 
> A link in a page template to
> 
> tal:attributes="href string:${context/REQUEST/URL0}/source.html

URL0 always(?) includes the ending published object (eg. index_html).
Normally if you don't want this you just use URL1.

> where the page is addressed by [path]/ and is actually at [path]/index.html
> 
> returns [path]/index_html/source.html

Using URL1 you should get [path]/source.html which would seem to me to be
what you want.
 
> I can vaguely see why this is happening. My question: is there a 
> straightforward way of making the links (and error reports) return the 
> actual page address?

By actual page address you want the URL with index.html instead of
index_html? Given your current setup as described, redirecting would work.



Though this would cause every hit on a page's index to tranverse twice. If
the site isn't super high traffic it wouldn't be noticable.

If you were working with zope projects there are other tricks you could
pull, but it doesn't sound like you are doing this.

> (I think I understand that 'actual' 'page' and 'address' are all 
> metaphors which may be leading me into error... )

In zope there is the URL which represents the object traversal and there is
the returned content (html, images, etc). The returned content (maybe what
you mean by actual page) can feasibly come from some other part of the
site, a database, or just about anything else. The URL or address is just
what method/object gets run to get said content.

> Thanks for any help/enlightenment.
 
Not sure if I'm making this much clearer. But there it is anyways.
 

-- 

John Eikenberry [EMAIL PROTECTED]
__
"A society that will trade a little liberty for a little order
 will deserve neither and lose both."
  --B. Franklin
___
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] Help need for a Zope presentation to java lovers...

2005-08-18 Thread Fernando Lujan
On 8/17/05, Chris McDonough <[EMAIL PROTECTED]> wrote:
> > I only meant that it would get dynamic data using XML-RPC queries, but I
> > already have an efficient product for this, so it's not an issue.
> >
> > So what they want is a Web Management Framework and CMS system.
> > And they wonder if Zope is better than a JSP/Struts/Velocity solution.


Please, give us a feedback about your presentation. ;) It's a very
interesting topic to discuss.

Fernando Lujan
___
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] Workflow question - sort of solved

2005-08-18 Thread David Pratt
I guess what I have learned so far is that the data of an object in an 
automatic workflow transition
from a PUT is not there until it completes - but the good thing is that 
the data is in the request body variable.


So I can check the request method and if a PUT, use the request's body 
variable and the transaction
completes on PUT and no more 426 Error. Yay!  I am not sure if there is 
any other way to go but interested

if there is a better solution.

Regards,
David

On Wednesday, August 17, 2005, at 06:08 PM, David Pratt wrote:

Hi Dieter. Many thanks for your reply. The place in my workflow that 
it failed was opening the image.


IOError: cannot identify image file

for image_data in image_data_list:

# Get original image data into string object
original_file = StringIO(str(image_obj.data))
image_size_px = image_data['size']

# Create an image instance
error here -->   image = PIL.Image.open(original_file)

This had me puzzled since my workflow works in all other cases in the 
portal including cutting an image from one folder and pasting into the 
folder the workflow acts on (just not FTP case). So I wrote a very 
simple workflow script that will only cut and paste an image back in 
same folder to see what would happen:


# Get the object and its id
image_obj = state_change.object
id = image_obj.getId()

# This is the folder we are starting from
upload_dir = image_obj.aq_parent

# Do cut and paste
objs = upload_dir.manage_cutObjects([id])
upload_dir.manage_pasteObjects(objs)

return

I discovered that it does not appear possible to have a workflow act 
on content immediately after being FTP'd to a site without generating 
the 'FTP 426 Error creating file' error.  If I FTP an image to the 
folder as Manager with copy or move permission, it will trigger 426 
Error creating file and the following traceback.  The workflow will 
work for regular operations within the portal, just not FTP.


*  Module OFS.CopySupport, line 92, in manage_cutObjects

Copy Error:   Not Supported  BGCOLOR="#FF">  BORDER="0" WIDTH="100%" CELLPADDING="10">
!  
   The action against the 
A084.JPG object could not be carried out. One of the 
following constraints caused the problem: The object does not 
support this operation.-- OR --The currently logged-in 
user does not have the Copy or Move permission respective to 
the object.   VALIGN="TOP">



The body of the image appears in my traceback as well

My folders work fine with FTP without the workflow - no errors.  Only 
generates errors when workflow is attached to type it acts on and then 
426 error appears.


Regards,
David



On Wednesday, August 17, 2005, at 05:07 PM, Dieter Maurer wrote:


David Pratt wrote at 2005-8-17 00:13 -0300:

...
but when I FTP
my images to this directory it fails giving me a 426 Error creating
file.


Look at your "error_log" object to find out the real reason
(and get the traceback).


--
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 )


___
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] Zope and double-byte locales

2005-08-18 Thread Dieter Maurer
Pascal Peregrina wrote at 2005-8-17 21:39 +0100:
> ...
>I would like to know if Zope supports locales like Japanese for example ?

Unlikely, but:

  As I understood, Toby Dickenson promoted (and implemented large parts of)
  Unicode support in Zope in order to support Asian websites.

If you need Asian websites, I would go for Unicode.


Zope's Unicode support is not yet complete.
For example, HTML Page Templates do not yet have a way
to specify the encoding. However, with XML (or XHTML) Page Templates,
Unicode is possible.

-- 
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] URL0 returns index_html not index.html

2005-08-18 Thread Dieter Maurer
Mark Barratt wrote at 2005-8-17 17:41 +0100:
>Zope 2.7.4 on Debian
>
>DTML method index_html in the root says 

Do you know, that this is equivalent to the simpler ""?

>A link in a page template to
>
>tal:attributes="href string:${context/REQUEST/URL0}/source.html
>
>where the page is addressed by [path]/ and is actually at [path]/index.html
>
>returns [path]/index_html/source.html

Of course:

  The object located by URL traversal is "index_html" and not
  "index.html".

  When rendered, "index_html" happens to return the same text as
  "index,html", but this does not change "URL0".

>I can vaguely see why this is happening. My question: is there a 
>straightforward way of making the links (and error reports) return the 
>actual page address?

The most straight forward way would be to perform
a redirect to "index.html" in your "index_html" -- not the most
efficient way, but one with the least surprises...

-- 
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] Moving Document Library Product

2005-08-18 Thread Dieter Maurer
David wrote at 2005-8-17 17:06 +0100:
> ...
>The problem occurs when trying to paste [I/O Error: not enough space  
>on the device] the library (copy command seems to work) or import  
>(export seems to work).

Hmmm:

  This verbal report does not at all fits to the traceback
  below...

  An "IOError: not enough space" is very different from an
  "ImportError: No module named Splitter".

In the future, please try to present consistent information
(traceback and verbal description filling together).

>DocumentLibrary version 1.0rc1
>Zope 2.4 (I am trying to migrate a site to Zope 2.7)

Move the "Data.fs"...

> ...
>Module ZODB.Connection, line 344, in commit
>Module ZODB.ExportImport, line 153, in _importDuringCommit
>ImportError: No module named Splitter

If you really care, give it a module "Splitter".
Almost surely, after this, you will get different exceptions:

  Almost surely, Zope will expect some classes inside
  the "Splitter" module.

  Probably, a better way would be to locate the correct
  "Splitter" module in your old Zope and copy it to the new
  one.

-- 
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] apache 2, mod_deflate, mod_fastcgi, zope 2.7: something's slow.

2005-08-18 Thread Dieter Maurer
Faried Nawaz wrote at 2005-8-18 02:12 +0500:
>On 8/18/05, Dieter Maurer <[EMAIL PROTECTED]> wrote:
>> Looks as if you should not use "mod_deflate".
>> 
>> Zope can perform "gzip" compression by itself.
>
>As you probably read in my previous email, I have rules defined in
>Apache to handle various browsers and proxies when dealing with
>possibly gzip'd content.  How do I do the same in Zope?

Zope's "gzip" support is enabled (for a single request) by
calling "RESPONSE.enableHTTPCompression" in that request.

You have all request headers and the full power of Python available
to dertermine when you want to call it (this gives you more power
than you have in Apache).

>(Also, I have static content on the site that can benefit from mod_deflate.)

If "static content" means "File/Image" objects, then their
so called "precondition" can get the "enableHTTPCompression".

Check beforehand, whether compression really saves something.
While I expect it for "bmp", I am not so sure for "jpg", e.g.


-- 
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] Workflow question

2005-08-18 Thread Dieter Maurer
David Pratt wrote at 2005-8-17 18:08 -0300:
>Hi Dieter. Many thanks for your reply. The place in my workflow that it 
>failed was opening the image.
>
>IOError: cannot identify image file
> ...
>error here --> image = PIL.Image.open(original_file)

This does not look like a workflow problem.

Instead, PIL seems to be unable to determine the type of image
("jpg", "png", "gif", ...).
I cannot tell you why.

Looking at the traceback (where is the exception raised?)
and then at the corresponding code may give you a hint.

> ...
>I discovered that it does not appear possible to have a workflow act on 
>content immediately after being FTP'd to a site without generating the 
>'FTP 426 Error creating file' error.  If I FTP an image to the folder 
>as Manager with copy or move permission, it will trigger 426 Error 
>creating file and the following traceback.  The workflow will work for 
>regular operations within the portal, just not FTP.
>
> *  Module OFS.CopySupport, line 92, in manage_cutObjects
>
>Copy Error: The action against the 
>A084.JPG object could not be carried out. One of the following 
>constraints caused the problem:i
>  * The object does not support this operation
> -- OR --
>  * The currently logged-in user does not have the
>Copy or Move permission respective to the object.

X. Almost a Windows like message :-(


But, your traceback was definitely larger. Please post the whole one.

Probably, your workflow gets fired too early -- at a time
when the object is not yet put placed inside the Zope object hierarchy.
At such a time, Zope permission system does not yet work
(the permissions defined at objects in the hierarchy are passed down
to lower level -- however, they can only reach objects placed in the
tree).

The full traceback may tell us whether this hypothesis is true.


-- 
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] ZEO troubles on RedHat EL4 Linux

2005-08-18 Thread Dieter Maurer
Andreas Krasa // WUW wrote at 2005-8-18 08:50 +0200:
> ...
>Btw. since this also happens on 5 other machines - all natively
>installed with RHEL4 - there actually might really be something wrong
>within the OS.
>
>Is that worth submitting a bug to RedHat? Or is ist more like a
>"feature"? ;)

The Linux documentation explicitly mentions that it is not
defined whether or not an ignored SIGCHLD is inherited by
child processes.

Thus, the Redhat behaviour at least conforms to the documention.

I would not call it a bug (also I had to change Zope code,
to get rid of the nasty side effects).

-- 
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] Moving Document Library Product

2005-08-18 Thread Tim Peters
[David]
>> ...
>> The problem occurs when trying to paste [I/O Error: not enough space
>> on the device] the library (copy command seems to work) or import
>> (export seems to work).

[Dieter Maurer]
> Hmmm:
> 
>  This verbal report does not at all fits to the traceback
>  below...
> 
>  An "IOError: not enough space" is very different from an
>  "ImportError: No module named Splitter".
> 
> In the future, please try to present consistent information
> (traceback and verbal description filling together).

Yup!

WRT "not enough space on the device" during a paste, I've heard of
this happening when the directory used by Python for temporary files
lives in (as it often does) a small partition.  A temp file created by
ExportImport.py can run out of disk space then.  Here's to find out
which directory Python uses for temp files:

[EMAIL PROTECTED] tim]$ python
Python 2.3.5 (#1, Feb 16 2005, 10:31:52)
...
>>> import tempfile
>>> tempfile.gettempdir()
'/tmp'

If that's on a too-small partition, you can boost the partition size. 
Or you can tell Python to use a different directory for temp files,
via setting an envar (TMPDIR should work for Linux boxes):

[EMAIL PROTECTED] tim]$ TMPDIR=~ python
Python 2.3.5 (#1, Feb 16 2005, 10:31:52)
...
>>> import tempfile
>>> tempfile.gettempdir()
'/home/tim'
___
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] ZEO troubles on RedHat EL4 Linux

2005-08-18 Thread Tim Peters
[Andreas Krasa]
> ...
> As I understood Dieter's mail, this strange behavior is caused by the
> way RedHat Enterprise Linux 4 system libraries handle SIG_IGN/SIGCHLD.

I don't know.  Dieter asked whether you ran the tests via "zopectl
test", but I didn't see an answer to that.  If you run the Zope tests
directly ("python test.py"), then the ZODB/ZEO tests never touch the
OS's default handler for SIGCHLD; if you do use zopectl, zopectl.py
_does_ set its own handler for SIGCHLD.

I'm not sure Dieter's info is current either.  The SIGCHLD handler in
current Zope 2.7.7's zopectl.py explicitly catches and ignores the
specific exception you reported:

def _ignoreSIGCHLD(*unused):
while 1:
try: os.waitpid(-1, os.WNOHANG)
except OSError: break

...

signal.signal(signal.SIGCHLD, _ignoreSIGCHLD)

But looks like Dieter added that code to begin with, so hard to
believe he forgot about it ;-)

> If this problem was due to some improper Zope methods, most people would
> have this sort of problems. Which is not the case. That makes me believe
> that the failure of ZEO tests actually is caused by some uncommon or
> improper implementation of those two handles - which, in my opinion,
> makes it something RedHat should take a look at.

I don't believe anyone at this point knows why you're seeing this
problem; the best way to make progress is to whittle it down to a
small, small-contained test case.  "Some ZEO tests fail sometimes"
still involves mountains of code, including everything from the OS
kernel to hundreds of .py files.   The ZEO test process setup isn't
anywhere near as complicated as zopectl, or as anything relying on
zdaemon:  the ZEO tests spawn processes directly via Python's
os.spawnve(), and later waits for them to end, via the waitpid() code
shown earlier.  It doesn't muck around with signals, forks, or
anything else that should be platform-dependent (the same ZEO-test
process code is used on both Linux and Windows, BTW -- for this
reason, it can't rely on any fancy signal or process gimmicks;
spawnve+watipid is the entire story here).

> ...
> Anyway - how severe are those testing failures for actually USING a ZEO
> client/server on that particular OS as a production system?

All the failures you showed were in test teardown.  If that's all the
failures you got, then all the test bodies actually passed.  Of course
you have to be wary that normal methods of detecting child-process
termination aren't working as hoped on this box, because all the test
failures you reported were exactly failures to detect child-process
termination.  I don't know how much of that Zope does, but can say
ZODB/ZEO never does that in normal operation (spawning multiple
processes, in ZODB+ZEO, is unique to the testing code; a ZEO server is
a single process, and doesn't spawn other process while it's running).
___
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 )


[Zope] manage_afterAdd quirks

2005-08-18 Thread Philip Jägenstedt
Hello!

I'm trying to write a small filesystems based product which I'm calling
MovieWorld. The main class (MovieWorld) inherits from ObjectManager and
is to be configured to contain a folder with images and a index_html
page template (so that it can be edited via ZMI if needed). Setting
these things up in a manage_afterAdd works fine as long as I'm just
adding new products, but renaming or copying will cause manage_afterAdd
to be called again, which fails because the objects to be created
already exist. What should I do?

The obvious solution is to check for existance of the objects and only
add them if they don't exist, which is what I tried. This worked for the
folder called "images", but I was using hasattr(self,'images') to check
to existance, so it worked by coincidence. What I mean is it works only
if there is no object called images aquired, which means it also mus not
exist anywhere along the aquire path. For this reason,
hasttr(self,'index_html') will return true, and the index_html template
will not be added at all.

It seems I need one of three things:

1. A better way to add images and a template altogether.
2. A hook which is only called once, when the object is first created.
3. A method to check if the objects exist in the newly added item
directly, not aquired.

Help!

// Philip Jägenstedt

___
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] manage_afterAdd quirks

2005-08-18 Thread Peter Bengtsson
Hej
> 
> I'm trying to write a small filesystems based product which I'm calling
> MovieWorld. The main class (MovieWorld) inherits from ObjectManager and
> is to be configured to contain a folder with images and a index_html
> page template (so that it can be edited via ZMI if needed). Setting
> these things up in a manage_afterAdd works fine as long as I'm just
> adding new products, but renaming or copying will cause manage_afterAdd
> to be called again, which fails because the objects to be created
> already exist. What should I do?
> 
Consider using CheckoutableTemplates instead of templates as Zope objects. 
Gives you that filesystem-based-power they're all talking about PLUS
the ability to edit the template specifically or globally in the ZMI.

> The obvious solution is to check for existance of the objects and only
> add them if they don't exist, which is what I tried. This worked for the
> folder called "images", but I was using hasattr(self,'images') to check
> to existance, so it worked by coincidence. What I mean is it works only
> if there is no object called images aquired, which means it also mus not
> exist anywhere along the aquire path. For this reason,
> hasttr(self,'index_html') will return true, and the index_html template
> will not be added at all.
> 

No, use the 'aq_base'. Like this:

def _createImages(self, imageids):
  here_only = getattr(self, 'aq_base', self)
  for imageid in imageids:
  if not hasattr(here_only, imageid):
  self.manage_addImage(...)



-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.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 )


Re: [Zope] Workflow question

2005-08-18 Thread David Pratt
Hi Dieter!  I believe you on the spot about it not being in the 
heirarchy yet. There are a couple of interesting things:


First, it is a different sort of workflow because it is automatically 
activated with contents being dropped in folder but

original object is deleted as part of worklow too. To start

# Get the object and its id
image_obj = state_change.object
id = image_obj.getId()

This gives me a handle on the state change object but it is really not 
in the heirarchy yet.  I do get an id and FTP does give
me the data but not in the way I may have expected but still perhaps 
enough to do something with.
This seems to be why I could not get the objects data yesterday. So I 
am instead testing request method and
using  request_body (context.REQUEST.BODY) to get data when PUT method 
is being used (since normal
method getting .data attribute works fine for HTTP uploads and cut and 
paste into specific folder.


if request_method == 'PUT':
image_file = StringIO(str(request_body))
image = PIL.Image.open(image_file)
else:
image_file = StringIO(str(image_obj.data))
image = PIL.Image.open(image_file)

The workflow has an automatic trigger from a state called preprocessed 
to destination state of
private (since I don't want to affect all images or the regular 
workflow, only the images that go into a specific folder). The script 
is a before script that gathers information and gives info to a tool 
method for PIL.


With what I am doing above, I get data for PIL and I end up with my 
images sized and in the right places which is what I
want with no 426 error.  All for exception of one thing - I want to 
delete the object as part of the workflow since it is no longer needed. 
 Here again I can raise 426 Error with FTP since if

I use manage_delObjects like so:

# Delete original object from the upload folder
upload_dir.manage_delObjects([id,])

method it raises following traceback:

Traceback (innermost last):

* Module ZPublisher.Publish, line 113, in publish
* Module ZPublisher.mapply, line 88, in mapply
* Module ZPublisher.Publish, line 40, in call_object
* Module webdav.NullResource, line 138, in PUT
* Module Products.CMFCore.PortalFolder, line 393, in PUT_factory
* Module OFS.ObjectManager, line 261, in _getOb

AttributeError: A1032.JPG

I guess my question is how can you delete an object that really is not 
there yet, correct - and at the same time have FTP think
the object has landed in the folder?  If I omit my delete statement, 
the workflow finishes and FTP is happy - if only I were happy too 
because this is not quite right - even though I have my sized images 
and in folders and types I want, I also want the object in the 
upload_dir to disappear as well.


Because I already have already obtained what I need from the FTP'd 
file, is there a way to give the FTP process something after the PIL 
process to have it think it has completed its job and send a 226 
Transfer complete. This way I think workflow should be happy, FTP will 
be happy because it gets a successful transfer,  and I will be happy 
because there is no file in the upload directory to worry about 
deleting.  Even it is a very different kind of situation, perhaps it 
can still work.


Regards,
David


On Thursday, August 18, 2005, at 05:00 PM, Dieter Maurer wrote:


David Pratt wrote at 2005-8-17 18:08 -0300:
Hi Dieter. Many thanks for your reply. The place in my workflow that 
it

failed was opening the image.

IOError: cannot identify image file
...
error here -->   image = PIL.Image.open(original_file)


This does not look like a workflow problem.

Instead, PIL seems to be unable to determine the type of image
("jpg", "png", "gif", ...).
I cannot tell you why.

Looking at the traceback (where is the exception raised?)
and then at the corresponding code may give you a hint.


...
I discovered that it does not appear possible to have a workflow act 
on

content immediately after being FTP'd to a site without generating the
'FTP 426 Error creating file' error.  If I FTP an image to the folder
as Manager with copy or move permission, it will trigger 426 Error
creating file and the following traceback.  The workflow will work for
regular operations within the portal, just not FTP.

*  Module OFS.CopySupport, line 92, in manage_cutObjects

Copy Error: The action against the
A084.JPG object could not be carried out. One of the 
following

constraints caused the problem:i
 * The object does not support this operation
-- OR --
 * The currently logged-in user does not have the
   Copy or Move permission respective to the object.


X. Almost a Windows like message :-(


But, your traceback was definitely larger. Please post the whole one.

Probably, your workflow gets fired too early -- at a time
when the object i

Re: [Zope] ZEO troubles on RedHat EL4 Linux

2005-08-18 Thread Willi Langenberger
According to Tim Peters:
> I don't know.  Dieter asked whether you ran the tests via "zopectl
> test", but I didn't see an answer to that.

Ok, here some data points...

  bender:~/Zope-2.7.7-final$ cat /proc/version 
  Linux version 2.6.9-11.ELsmp ([EMAIL PROTECTED]) (gcc version 3.4.3 20050227 
(Red Hat 3.4.3-22)) #1 SMP Fri May 20 18:26:27 EDT 2005

  bender:~/Zope-2.7.7-final$ python2.3 
  Python 2.3.5 (#1, Apr 19 2005, 14:53:39) 
  [GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.

Running one single test:

  bender:~/Zope-2.7.7-final$ python2.3 test.py testConnection 
checkNoVerificationOnServerRestart\$
  Running unit tests from /home/wlang/Zope-2.7.7-final/lib/python
  ==
  ERROR: checkNoVerificationOnServerRestart 
(ZEO.tests.testConnection.FileStorageReconnectionTests)
  --
  Traceback (most recent call last):
File 
"/home/wlang/Zope-2.7.7-final/lib/python/ZEO/tests/ConnectionTests.py", line 
121, in tearDown
  os.waitpid(pid, 0)
  OSError: [Errno 10] No child processes

  --
  Ran 1 test in 0.689s

  FAILED (errors=1)

After some retries, the same test passes:

  bender:~/Zope-2.7.7-final$ python2.3 test.py testConnection 
checkNoVerificationOnServerRestart\$
  Running unit tests from /home/wlang/Zope-2.7.7-final/lib/python
  --
  Ran 1 test in 0.691s

  OK

Interesstingly, if i run the test with strace, i never see the test
fail (i tried at least 30 times):

  bender:~/Zope-2.7.7-final$ strace -e trace=signal -o /var/tmp/zeotest.trc 
python2.3 test.py testConnection checkNoVerificationOnServerRestart\$
  Running unit tests from /home/wlang/Zope-2.7.7-final/lib/python
  --
  Ran 1 test in 0.710s

  OK

(Obviously a Heisenberg effect -- the observation influences the
behaviour ;-)

If anyone is interessted in the trace file -- it can be found at:

  http://slime.wu-wien.ac.at/misc/zeotest.trc

(However, it would be way more interessting to see the syscalls while
the test is failing...)

Also, i debugged the whole test with the python debugger. Unfortunatly
(as with strace), i was not able to reproduce the failing of the test
in the debugger.

> the ZEO tests spawn processes directly via Python's
> os.spawnve(), and later waits for them to end, via the waitpid() code
> shown earlier.  It doesn't muck around with signals, forks, or
> anything else that should be platform-dependent (the same ZEO-test
> process code is used on both Linux and Windows, BTW -- for this
> reason, it can't rely on any fancy signal or process gimmicks;
> spawnve+watipid is the entire story here).

Yes, its as simple as that: zeo ist started, zeo is stopped, and when
the parent calls waitpid, we get the "No child processes" error most of
the time :-(

Any ideas what we can try to narrow this down?

> All the failures you showed were in test teardown.  If that's all the
> failures you got, then all the test bodies actually passed.  Of course
> you have to be wary that normal methods of detecting child-process
> termination aren't working as hoped on this box, because all the test
> failures you reported were exactly failures to detect child-process
> termination.

Sure -- we could just make this change:

  bender:.../ZEO/tests$ diff ConnectionTests.py.ori ConnectionTests.py
  121c121,124
  < os.waitpid(pid, 0)
  ---
  > try:
  > os.waitpid(pid, 0)
  > except OSError:
  > pass

then all tests will pass. But then we will not know why the zeo zombie
vanishes before the waitpid can reap the exit code ;-)


\wlang{}

PS: i'am afraid it turns out to be a python thread / signals / race
problem -- yuck!

-- 
[EMAIL PROTECTED]Fax: +43/1/31336/9207
Zentrum fuer Informatikdienste, Wirtschaftsuniversitaet Wien, Austria
___
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 )


[Zope] Cancelling long processes in Zope

2005-08-18 Thread Ausum Studio
How do you stop a long process just triggered, i.e., by accident?  One of
our apps allows our users to trigger long processes. The way we used to deal
with them is to stream response lines so that the user has an idea of what's
going on. Nonetheless, some processes aren't worth to watch, so they are
simply logged and associated to a mail alert. That's fine so far.

As processes can commit transactions regularly on demand, has anyone tried
to deal with long processes by means of hacking the Zope threads machinery
(or something like that), in order to achieve start, stop and resume
commands? Most transactions don't need this, but unawared long procceses use
to leak memory and CPU cycles, and they ought to be managed.

Any experiences on this subject? Thanks in advance,


Ausum
___
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] Cancelling long processes in Zope

2005-08-18 Thread Andreas Jung
I think it is good practice to deal with long-running processes using a 
dedicated ZEO client and not to use a website for this. Especially because 
a long-running request allocates one thread. If you have four threads 
(default) and a user double or trible-clicks on the same link this will eat 
up all of your threads.


-aj

--On 19. August 2005 01:31:28 -0500 Ausum Studio <[EMAIL PROTECTED]> 
wrote:



How do you stop a long process just triggered, i.e., by accident?  One of
our apps allows our users to trigger long processes. The way we used to
deal with them is to stream response lines so that the user has an idea
of what's going on. Nonetheless, some processes aren't worth to watch, so
they are simply logged and associated to a mail alert. That's fine so far.

As processes can commit transactions regularly on demand, has anyone tried
to deal with long processes by means of hacking the Zope threads machinery
(or something like that), in order to achieve start, stop and resume
commands? Most transactions don't need this, but unawared long procceses
use to leak memory and CPU cycles, and they ought to be managed.

Any experiences on this subject? Thanks in advance,


Ausum
___
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 )






pgpkTWlnoLfbB.pgp
Description: PGP signature
___
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 )