[Zope-dev] RestrictedPython - inserting variables before doing exec(code)

2010-11-03 Thread Russ Ferriday
Good day!

Refs:
http://pypi.python.org/pypi/RestrictedPython

I want to pass existing bound variables into the environment of some restricted 
code before running it.  

This is similar to when globals are passed to compile_restricted_function.

The idea... 

x = 42
y = 'foo'
src=print x*2; print y; return printed
code=compile_restricted(src, 'string', 'exec')
code.global['x'] = x # - just dreaming, here.
code.global['y'] = y # - just dreaming, here.
ans = exec(code) in restricted_globals
print ans# prints   84\n'foo'\n

It's clear that passing in arbitrary objects is not feasible. But what if I'm 
prepared to constrain input to built-in numeric and string types, possibly in 
or with nested dicts?

In many cases the input will be large integer or float arrays, and I want to 
avoid any nasty
kludge such as printing those inputs into the top lines of the src ;).  The src 
in the demo is a constant,
but in the application, it's provided by users via a list of pre-defined and 
user-created 'macros'.

If I'm missing something obvious, flames welcome!

--r.

Russ Ferriday -- 
CEO Topia Systems Ltd.
ru...@topia.com  --  +1 (805) 910 7877  --  www.topia.com








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


Re: [Zope-dev] RestrictedPython - inserting variables before doing exec(code)

2010-11-03 Thread Russ Ferriday
Apologies for the noise.
Brain in gear
--r.

Begin forwarded message:

 From: Russ Ferriday ru...@topia.com
 Date: November 3, 2010 12:47:33 PM PDT
 To: zope-dev zope-dev@zope.org
 Subject: RestrictedPython - inserting variables before doing exec(code)
 
 Good day!
 
 Refs:
 http://pypi.python.org/pypi/RestrictedPython
 
 I want to pass existing bound variables into the environment of some 
 restricted code before running it.  
 
 This is similar to when globals are passed to compile_restricted_function.
 
 The idea... 
 
 x = 42
 y = 'foo'
 src=print x*2; print y; return printed
 code=compile_restricted(src, 'string', 'exec')
 code.global['x'] = x # - just dreaming, here.
 code.global['y'] = y # - just dreaming, here.
 ans = exec(code) in restricted_globals
 print ans# prints   84\n'foo'\n
 
 It's clear that passing in arbitrary objects is not feasible. But what if I'm 
 prepared to constrain input to built-in numeric and string types, possibly in 
 or with nested dicts?
 
 In many cases the input will be large integer or float arrays, and I want to 
 avoid any nasty
 kludge such as printing those inputs into the top lines of the src ;).  The 
 src in the demo is a constant,
 but in the application, it's provided by users via a list of pre-defined and 
 user-created 'macros'.
 
 If I'm missing something obvious, flames welcome!
 
 --r.
 
 Russ Ferriday -- 
 CEO Topia Systems Ltd.
 ru...@topia.com  --  +1 (805) 910 7877  --  www.topia.com
 
 
 
 
 
 
 
 


Russ Ferriday -- Systems Architect  Entrepreneur
CEO Topia Systems Ltd.
ru...@topia.com  --  +1 (805) 910 7877  --  www.topia.com








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


Re: [Zope-dev] deprecate http://download.zope.org/distribution

2008-11-14 Thread Russ Ferriday

On 14 Nov 2008, at 16:40, Tres Seaver wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Christian Zagrodnick wrote:

On 2008-11-12 23:41:55 +0100, Jim Fulton [EMAIL PROTECTED] said:

http://download.zope.org/distribution was set up as a place to  
publish

distributions while we were learning about setuptools, eggs, and
pypi.  I think now, we're all using PyPI (or local repositories).   
I'd

like to deprecate this site, making it read-only for now, but
eventually removing it.


Yeah, make it read only. But I'd just leave it there. We have the
policy of not removing eggs which are out there, so I suggest leaving
the eggs there.


- -1:  many of the eggs that are there should never have been  
released at

all in a public repository:  they are attractive nuisances.

+1 for removing the bear trap ASAP.



Might be worth putting a takedown message in place of the files.

There are many incoming links

--r.

___
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] Zope installation woes

2006-07-06 Thread russ
What does it mean if this is listed under ps -eLf:

zope 15601 15600 15601  01 Jul05 ?00:00:05 /usr/bin/python
/usr/

...but isn't anywhere to be seen under netstat -p ?

 how do I telnet to port 8080 *on* the same machine?

Sorry :S

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: 05 July 2006 18:59
To: russ
Subject: RE: [Zope] Zope installation woes

use the ps command to see that that process is still running. also
use the netstat command (with the -p flag (as root)) to see/confirm
what port zope is listening on.

if it's running, on port 8080, then try to telnet to port 8080, both as
localhost:8080 and hostname:8080 (both from the server itself).  if
both of those work, then telnet to hostname:8080 from a remote
machine (e.g., the desktop machine you've been using yoru browser
from). if the telnets from the server work, but the telnet from the
remote host doesn't, then your issue is likely to be a firewall.




 Original Message 
 Date: Wednesday, July 05, 2006 06:24:40 PM +0100
 From: russ [EMAIL PROTECTED]
 To: 'Jonathan' [EMAIL PROTECTED], zope@zope.org
 Subject: RE: [Zope] Zope installation woes
 
 Well I've tried to follow your steps with the exception of point 15
 (mkzopeinstance.py doesn't reside in my python directory, it's in the
 zope/bin folder).  At the last stage I hit enter and got:
 
 bash-3.00$ ./zopectl start
 . daemon process started, pid=15601
 
 And now what?  http://www.domain.tld:8080 still produces nothing.
 
 :(
 
 
 -Original Message-
 From: Jonathan [mailto:[EMAIL PROTECTED] 
 Sent: 05 July 2006 17:14
 To: russ; zope@zope.org
 Subject: Re: [Zope] Zope installation woes
 
 
 - Original Message - 
 From: russ [EMAIL PROTECTED]
 To: zope@zope.org
 Sent: Wednesday, July 05, 2006 11:37 AM
 Subject: RE: [Zope] Zope installation woes
 
 
 O.k. thanks,
 
 There are a number of lines like this:
 
 mailman   2485  2468  2485  01 Jun29 ?00:00:00
 /usr/bin/python2.4 /u
 
 ...and a few like this:
 
 root 12796 11967 12796  01 13:10 pts/100:00:00
 /usr/bin/python /usr/
 
 These are not zope entries, you are looking for something like:
 
 zope  3158 1  3158  01 07:52 ?00:00:00 
 /usr/local/bin/python
 /usr/local/Zope-2.9.2/lib/python/zdaemon/zdrun.py -S 
 /usr/local/Zope-2.9.2/l
 
 zope  3159  3158  3159  05 07:52 ?00:00:02 
 /usr/local/bin/python 
 /usr/local/Zope-2.9.2/lib/python/Zope2/Startup/run.py -C
 /apps/zope/etc/zope
 
 
 
 I can't see anything relating to zope specifically  running the
 zopect1 command results in this:
 
 [EMAIL PROTECTED] [/usr/local/zope/instance3/bin]#
 /usr/local/zope/instance3/bin/zopect1 fg
 -bash: /usr/local/zope/instance3/bin/zopect1: No such file or
 directory
 
 in your local zope/bin directory you should have some script files
 like: runzope, runzope.bat and zopectl (this is what I have with zope
 2.9.2  installation)
 
 If you do not have these files, then something is truly pooched.
 
 Here are the steps I used to install zope 2.9.2 (linux os)
 
 1) download zope 2.9.2 tarball into /usr/local/src (I used wget)
 2) tar -xzf the zope tarball (unpack it)
 3) change directory (cd) to the new zope subdirectory (created by the
 tar  command)
 4) make sure you have python 2.4.2 (this is for zope 2.9.2, check
 what you  need for zope 2.9.3). My python 2.4.2 is installed in
 /usr/local/bin and  this directory is contained with the PATH
 environment variable (type echo  $PATH at the command prompt - if the
 directory containing your python 2.x is
 
 not in PATH you will need to modify PATH)
 5) at the command line enter: ./configure
 6) at the command line enter: make
 7) at the command line enter: make install(This will install zope
 in  /usr/local/zope-2.9.x)
 
 Now you need to add a 'zope' user to your system (if you do not
 already have
 
 one)
 8) cd /etc
 9) groupadd zope (unless you already have a zope group defined)
 10) useradd -g zope zope (this creates a zope user)
 11) passwd zope (sets a password for the new user)
 12) usermod -d /apps/zope zope (sets the home directory for the new
 user to  /apps/zope)
 
 Now you need to create a zope instance:
 
 13) change directory to /usr/local/zope-2.9.x/bin
 14) su zope (change to the zope user you created earlier)
 15) at the command line enter: /usr/local/bin/python
 mkzopeinstance.py  (note: replace /usr/local/bin/python with the
 location of your python 2.4.x  installation)
 You will be prompted for a zope instance home (i use /apps/zope), a
 username
 
 and a password (your zope admin account)
 16) change directory to the new zope instance home (eg. cd
 /apps/zope) and  you should see several subdirectories.
 17) check the ownership of the directories/files - they should all be
 owned  by zope and belong to the zope group.  To change them enter:
 chown zope *  (changes ownership); chgrp zope * (changes group)
 
 Now you need to make a couple

RE: [Zope] Zope installation woes

2006-07-06 Thread russ
I agree Sascha, I would prefer to much more grounded in the ways of the
command line before attempting this stuff.  I'm trying to get this running
as I was hoping that it wouldn't be too involved and would be able to get
busy creating Plone sites.  I don't have the luxury of time to learn more
about this in general beforehand and so made the decision to learn on the
job as it were.  You may see this as foolish, and it probably is, but I
entered into this hoping that I wouldn't have to get my hands too dirty.  I
now find myself in uncharted territory, not wanting to turn back.

So do you think I should throw in the towel now?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Sascha Welter
Sent: 06 July 2006 10:14
To: zope@zope.org
Subject: RE: [Zope] Zope installation woes

(Wed, Jul 05, 2006 at 12:00:08PM -0400) [EMAIL PROTECTED]
wrote/schrieb/egrapse:
 From: russ [EMAIL PROTECTED]
 Subject: RE: [Zope] Zope installation woes

 Firstly I'll just mention a little bit more about the server.  We have
 cPanel and Apache running.  There's a number of accounts setup in cPanel
and

It appears that this is a production server.

...

Jonathan wrote:
 If zope is not running try starting zope with the command: ./zopectl fg
 this should allow you to see any errors that are generated while zope
 tries to start up.

good advice

...

russ wrote:
 I can't see anything relating to zope specifically  running the zopect1
 command results in this:
 
 [EMAIL PROTECTED] [/usr/local/zope/instance3/bin]#
 /usr/local/zope/instance3/bin/zopect1 fg
 -bash: /usr/local/zope/instance3/bin/zopect1: No such file or directory

...

later Jonathan replied:

 Don't give up!

And now my point: Jonathan, I disagree here. Russ, you are running a
command you don't know about (and you don't even care enough to check
the spelling) as *root* on a *production* server. 

Please notify the servers administrator and/or owner about this. You
shouldn't be allowed near a root prompt. At least till you've done your
homework to the extend that you pay attention before doing anything as
root. Besides, nobody told you to do this as root. When giving commands
as root, you can destroy everything that is on that server. For starters
try it with `rm -rf /`.

Why don't you try the installation first on a test machine or personal
workstation? We all have to learn stuff first, but a production server
isn't a learning environment. Nowadays it is *very* easy to get a Unix
clone system to play around with. There is also documentation to be
found about Zope and System Administration in general, for free on the
Internet.

[Stepping down from Soap Box]

Have a nice day + Regards,

Sascha

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


[Zope] Zope installation woes

2006-07-06 Thread russ
Thanks for your help guys, much appreciated.  I'll see what I can find on
the subject.

R.

-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED] 
Sent: 06 July 2006 13:08
To: russ; zope@zope.org
Subject: Re: [Zope] Zope installation woes


- Original Message - 
From: russ [EMAIL PROTECTED]
To: 'Sascha Welter' [EMAIL PROTECTED]; zope@zope.org
Sent: Thursday, July 06, 2006 5:38 AM
Subject: RE: [Zope] Zope installation woes


I agree Sascha, I would prefer to much more grounded in the ways of the
 command line before attempting this stuff.  I'm trying to get this running
 as I was hoping that it wouldn't be too involved and would be able to get
 busy creating Plone sites.  I don't have the luxury of time to learn more
 about this in general beforehand and so made the decision to learn on the
 job as it were.  You may see this as foolish, and it probably is, but I
 entered into this hoping that I wouldn't have to get my hands too dirty. 
 I
 now find myself in uncharted territory, not wanting to turn back.

 So do you think I should throw in the towel now?

If you only have one server available and if it is a production server, then

you need to think about the ramifications of crashing that server. 
'Production server' means different things to different organizations, and 
if no-one is going to be screaming at you if you kill the server then carry 
on!

However, if your organization takes a dim view of production server 
downtime, then I would caution you against proceeding!

You don't need to be a linux expert to install zope, but you do need at 
least a rudimentary understanding of how linux works and how some basic 
commands work.  I would recommend spending some time reading the intro 
chapters of some linux documentation (you can find some at 
http://www.linux.org/docs/, and there is a good doc at: 
http://www.centos.org/docs/4/html/rhel-rg-en-4/) - it may seem like a waste 
of time, but it will save you time and aggravation in the future.

If you do not want to spend the time on linux/zope and you just want to 'get

working', you could look at some of the zope hosting companies (they already

have zope up and running, and they look after maintaining the 
'infrastructure', which lets you focus on your application).


Jonathan


___
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 installation woes

2006-07-06 Thread russ
o.k. when running that I saw this:

unix  2  [ ACC ] STREAM LISTENING 546729 15600/python
/home/zope/instance/var/zopectlsock.15599

Does this mean it's running?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: 06 July 2006 15:44
To: russ
Subject: RE: [Zope] Zope installation woes

if your zope instance does not show in the output from:

  netstat -ap | grep LISTEN

(issued as root)

then there's no sense in trying to figure out how to telnet to
localhost 8080 (or whatever port your zope is running on) as there's
nothing listening for the inbound connection. i.e., until your zope
instance is running correctly so shows up in the netstat output, trying
to connect inbound to it will fail and prove nothing. 

[there are a variety of things that can cause an inbound connection to
a service to fail. you need to take the debugging one step at a time,
starting with confirming that there's actually a service running.]


  - Rick


 Original Message 
 Date: Thursday, July 06, 2006 10:28:46 AM +0100
 From: russ [EMAIL PROTECTED]
 Subject: RE: [Zope] Zope installation woes
 
 What does it mean if this is listed under ps -eLf:
 
 zope 15601 15600 15601  01 Jul05 ?00:00:05
 /usr/bin/python /usr/
 
 ...but isn't anywhere to be seen under netstat -p ?
 
  how do I telnet to port 8080 *on* the same machine?
 
 Sorry :S
 
 -Original Message-
 From: replies-lists-zope
 Sent: 05 July 2006 18:59
 To: russ
 Subject: RE: [Zope] Zope installation woes
 
 use the ps command to see that that process is still running. also
 use the netstat command (with the -p flag (as root)) to see/confirm
 what port zope is listening on.
 
 if it's running, on port 8080, then try to telnet to port 8080, both
 as localhost 8080 and hostname 8080 (both from the server
 itself).  if both of those work, then telnet to hostname 8080 from
 a remote machine (e.g., the desktop machine you've been using your
 browser from). if the telnets from the server work, but the telnet
 from the remote host doesn't, then your issue is likely to be a
 firewall.
 
 
 
 
  Original Message 
 Date: Wednesday, July 05, 2006 06:24:40 PM +0100
 From: russ [EMAIL PROTECTED]
 To: 'Jonathan' [EMAIL PROTECTED], zope@zope.org
 Subject: RE: [Zope] Zope installation woes
 
 Well I've tried to follow your steps with the exception of point 15
 (mkzopeinstance.py doesn't reside in my python directory, it's in the
 zope/bin folder).  At the last stage I hit enter and got:
 
 bash-3.00$ ./zopectl start
 . daemon process started, pid=15601
 
 And now what?  http://www.domain.tld:8080 still produces nothing.
 
 :(
 
 


___
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] Zope installation woes

2006-07-05 Thread russ
Hello Zopesters,

Firstly, I must say that I'm completely new to this as I usually develop
front-end stuff, so excuse my ignorance.  Right... that's out of the way - I
have been trying to install Zope on a server I have access to via SSH.  I've
followed the instructions for installing it from source found here:

http://plone.org/documentation/how-to/setup-from-source

I've got as far as making an instance and then attempting to start Zope.
First of all I got this:

[EMAIL PROTECTED] [~]# /usr/local/zope/instance3/bin/runzope
/usr/local/zope/zope2.9.3/lib/python/ZServer/utils.py:33:
DeprecationWarning: The zLOG package is deprecated and will be removed in
Zope 2.11. Use the Python logging module instead.
LOG('ZServer', severity[type], message)
/usr/local/zope/zope2.9.3/lib/python/Signals/SignalHandler.py:39:
DeprecationWarning: The zLOG package is deprecated and will be removed in
Zope 2.11. Use the Python logging module instead.
zLOG.LOG('Z2', zLOG.BLATHER, Installed sighandler for %s % (


...and then nothing :-|  I tried running it again  got the following:

snipped output
ZConfig.ConfigurationError: There was a problem starting a server of type
HTTPS erver. This may mean that your user does not have permission to bind
to the por t which the server is trying to use or the port may already be in
use by another application. (Address already in use)

The log file reports it's running, yet I cannot seem to access the start
page from http://myserverip:8080.

I don't know what to do next?  Can anyone please help me out?

:(

R.

___
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 installation woes

2006-07-05 Thread russ
Hi Jake,

Firstly I'll just mention a little bit more about the server.  We have
cPanel and Apache running.  There's a number of accounts setup in cPanel and
I've tried to access Zope via one of these urls (www.domain.tld:8080) but to
no avail.  I've also tried the IP of the server with no luck.  I don't know
what else to try now, as I mentioned before I'm completely new to all of
this stuff so it's quite a steep learning curve.  I also don't know what you
mean by use top :S

Thanks for your reply BTW.

R.

-Original Message-
From: Jake [mailto:[EMAIL PROTECTED] 
Sent: 05 July 2006 15:56
To: russ
Cc: zope@zope.org
Subject: Re: [Zope] Zope installation woes

It looks like it is already running. Use top and look for a process called
python.

Did you try the url in a browser on port 8080?

Jake
___
http://www.ZopeZone.com


On Wed, July 5, 2006 10:31 am, russ said:
 Hello Zopesters,

 Firstly, I must say that I'm completely new to this as I usually develop
 front-end stuff, so excuse my ignorance.  Right... that's out of the way -
 I
 have been trying to install Zope on a server I have access to via SSH.
 I've
 followed the instructions for installing it from source found here:

 http://plone.org/documentation/how-to/setup-from-source

 I've got as far as making an instance and then attempting to start Zope.
 First of all I got this:

 [EMAIL PROTECTED] [~]# /usr/local/zope/instance3/bin/runzope
 /usr/local/zope/zope2.9.3/lib/python/ZServer/utils.py:33:
 DeprecationWarning: The zLOG package is deprecated and will be removed in
 Zope 2.11. Use the Python logging module instead.
 LOG('ZServer', severity[type], message)
 /usr/local/zope/zope2.9.3/lib/python/Signals/SignalHandler.py:39:
 DeprecationWarning: The zLOG package is deprecated and will be removed in
 Zope 2.11. Use the Python logging module instead.
 zLOG.LOG('Z2', zLOG.BLATHER, Installed sighandler for %s % (


 ...and then nothing :-|  I tried running it again  got the following:

 snipped output
 ZConfig.ConfigurationError: There was a problem starting a server of type
 HTTPS erver. This may mean that your user does not have permission to
 bind
 to the por t which the server is trying to use or the port may already be
 in
 use by another application. (Address already in use)

 The log file reports it's running, yet I cannot seem to access the start
 page from http://myserverip:8080.

 I don't know what to do next?  Can anyone please help me out?

 :(

 R.

 ___
 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 installation woes

2006-07-05 Thread russ
O.k. thanks,

There are a number of lines like this:

mailman   2485  2468  2485  01 Jun29 ?00:00:00
/usr/bin/python2.4 /u

...and a few like this:

root 12796 11967 12796  01 13:10 pts/100:00:00 /usr/bin/python
/usr/

I can't see anything relating to zope specifically  running the zopect1
command results in this:

[EMAIL PROTECTED] [/usr/local/zope/instance3/bin]#
/usr/local/zope/instance3/bin/zopect1 fg
-bash: /usr/local/zope/instance3/bin/zopect1: No such file or directory



-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED] 
Sent: 05 July 2006 16:15
To: russ; zope@zope.org
Subject: Re: [Zope] Zope installation woes

At the o/s command prompt, type:  ps -eLf

You should see a listing which contains some zope/python entries if zope is 
running.

If zope is not running try starting zope with the command: ./zopectl fg
this should allow you to see any errors that are generated while zope tries 
to start up.


hth

Jonathan



___
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 installation woes

2006-07-05 Thread russ
Well I've tried to follow your steps with the exception of point 15
(mkzopeinstance.py doesn't reside in my python directory, it's in the
zope/bin folder).  At the last stage I hit enter and got:

bash-3.00$ ./zopectl start
. daemon process started, pid=15601

And now what?  http://www.domain.tld:8080 still produces nothing.

:(


-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED] 
Sent: 05 July 2006 17:14
To: russ; zope@zope.org
Subject: Re: [Zope] Zope installation woes


- Original Message - 
From: russ [EMAIL PROTECTED]
To: zope@zope.org
Sent: Wednesday, July 05, 2006 11:37 AM
Subject: RE: [Zope] Zope installation woes


 O.k. thanks,

 There are a number of lines like this:

 mailman   2485  2468  2485  01 Jun29 ?00:00:00
 /usr/bin/python2.4 /u

 ...and a few like this:

 root 12796 11967 12796  01 13:10 pts/100:00:00 /usr/bin/python
 /usr/

These are not zope entries, you are looking for something like:

zope  3158 1  3158  01 07:52 ?00:00:00 
/usr/local/bin/python /usr/local/Zope-2.9.2/lib/python/zdaemon/zdrun.py -S 
/usr/local/Zope-2.9.2/l

zope  3159  3158  3159  05 07:52 ?00:00:02 
/usr/local/bin/python 
/usr/local/Zope-2.9.2/lib/python/Zope2/Startup/run.py -C /apps/zope/etc/zope



 I can't see anything relating to zope specifically  running the zopect1
 command results in this:

 [EMAIL PROTECTED] [/usr/local/zope/instance3/bin]#
 /usr/local/zope/instance3/bin/zopect1 fg
 -bash: /usr/local/zope/instance3/bin/zopect1: No such file or directory

in your local zope/bin directory you should have some script files like:
runzope, runzope.bat and zopectl (this is what I have with zope 2.9.2 
installation)

If you do not have these files, then something is truly pooched.

Here are the steps I used to install zope 2.9.2 (linux os)

1) download zope 2.9.2 tarball into /usr/local/src (I used wget)
2) tar -xzf the zope tarball (unpack it)
3) change directory (cd) to the new zope subdirectory (created by the tar 
command)
4) make sure you have python 2.4.2 (this is for zope 2.9.2, check what you 
need for zope 2.9.3). My python 2.4.2 is installed in /usr/local/bin and 
this directory is contained with the PATH environment variable (type echo 
$PATH at the command prompt - if the directory containing your python 2.x is

not in PATH you will need to modify PATH)
5) at the command line enter: ./configure
6) at the command line enter: make
7) at the command line enter: make install(This will install zope in 
/usr/local/zope-2.9.x)

Now you need to add a 'zope' user to your system (if you do not already have

one)
8) cd /etc
9) groupadd zope (unless you already have a zope group defined)
10) useradd -g zope zope (this creates a zope user)
11) passwd zope (sets a password for the new user)
12) usermod -d /apps/zope zope (sets the home directory for the new user to 
/apps/zope)

Now you need to create a zope instance:

13) change directory to /usr/local/zope-2.9.x/bin
14) su zope (change to the zope user you created earlier)
15) at the command line enter: /usr/local/bin/python mkzopeinstance.py 
(note: replace /usr/local/bin/python with the location of your python 2.4.x 
installation)
You will be prompted for a zope instance home (i use /apps/zope), a username

and a password (your zope admin account)
16) change directory to the new zope instance home (eg. cd /apps/zope) and 
you should see several subdirectories.
17) check the ownership of the directories/files - they should all be owned 
by zope and belong to the zope group.  To change them enter: chown zope * 
(changes ownership); chgrp zope * (changes group)

Now you need to make a couple of small changes to the zope.conf file:
18) cd /apps/zope/etc
19) edit the zope.conf file (save a copy first!) and change debug-mode to 
'on' (optional) and change effective-user to 'zope'

Now you need to start the zope instance:
20) cd /apps/zope/bin
21) ./zopectl start (or ./zopectl fg in case of errors during start up)


HTH!

Jonathan







___
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-dev] Referencial Integrity in ZCatalogs

2004-08-02 Thread Russ Ferriday
Take a look at archetypes on Plone.org, and download a version from sf.net.
Look in particular at the ReferenceEngine, based on the catalog, and note that there have been implementation changes, and there's a new beta version.
Ben Saller and Kapil Thangavelu were part of the team responsible for Archetypes.
--r.
On 2 Aug 2004, at 12:46, Santi Camps wrote:

Hi all,

I've been developing database oriented applications for about 10 years, using zope with Relation DDBB for one year and a half, and just one year using Zope with ZODB in my applications.   At this point, I can see a lot of advantatges of use ZODB with Zope, but there are some points where the relational model was more useful to me. In fact, the main problem in my applications are relationships.   In a relational world, you can specify relations using foreign keys, and also say what action should be done on delete or on update (no action, set null, restrict, cascade, set default).   This is very useful developing business oriented applications. Using ZODB some of these relations can be done using containment:   If A contains B, this is the same of having a relation 1->N on delete cascade
Another case is to use a Relation Manager.   I've implemented and object Relation that is deleted when some of the two related objects are (using manage_beforeDelete).  This is the same that a relation M -> N on delete cascade
The third case I've been implemented, and the one giving me more problems, is to have a property referencing another object (path or UID).  If the referenced object is dropped, the referer has problems

I work a lot with ZCatalogs, using one catalog for each meta_type of objects, so for me catalogs are the most similar thing to a Table.   I'm thinking that could be very useful to implement some basic referencial integrity in ZCatalogs.   Just being able to define primary keys and some simple types of foreign keys we will have on Zope the best of two worlds.   Seeing code of ZCatalog product it seems not to be very difficult to implement, adding some validations on catalog_object and uncatalog_object methods.   Of course, all these should be optional.   I no Primary Keys neither Foreign Keys are defined, catalogs should work exactly like until now.

What do you think about this ?  If nobody convince me that this is a stupid work, I will try to implement it.   In this case, what's the better way to provide the code ?  A patch for ZCatalog ?  Or a new Product IntegrityZCatalog inheriting from ZCatalog ?

Thanks

Santi Camps

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


Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com
___
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] KeyError in GlobalTranslationService.py

2004-07-29 Thread Russ Ferriday
I just submitted a patch for Plone 2.0.3 
http://plone.org/collector/3329
that stops a KeyError from being triggered in GlobalTranslationService.py when a msgid contains a $ 

I think that passing a translation key containing $ should not cause an Error page.

So here's a patch for Zope that at least prevents the problem. Translation Service dudes will probably pick big holes in it.

Oh, and traceback attached below. The msgid was Ca$hville, the title of a doc.

--r.

diff GlobalTranslationService.py.orig GlobalTranslationService.py 
28,31c28,35 
def repl(m, mapping=mapping): 
return ustr(mapping[m.group(m.lastindex)]) 
cre = re.compile(r'\$(?:(%s)|\{(%s)\})' % (NAME_RE, NAME_RE)) 
return cre.sub(repl, default or msgid) 
--- 
>try: 
>def repl(m, mapping=mapping): 
>return ustr(mapping[m.group(m.lastindex)]) 
>cre = re.compile(r'\$(?:(%s)|\{(%s)\})' % (NAME_RE, NAME_RE)) 
>return cre.sub(repl, default or msgid) 
>except KeyError: 
>return msgid 

Traceback: 
 
Site Error 

An error was encountered while publishing this resource. 

KeyError 
Sorry, a site error occurred. 

Traceback (innermost last): 

* Module ZPublisher.Publish, line 163, in publish_module_standard 
* Module ZPublisher.Publish, line 127, in publish 
* Module Zope.App.startup, line 203, in zpublisher_exception_hook 
* Module ZPublisher.Publish, line 100, in publish 
* Module ZPublisher.mapply, line 88, in mapply 
* Module ZPublisher.Publish, line 40, in call_object 
* Module Shared.DC.Scripts.Bindings, line 306, in __call__ 
* Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec 
* Module Products.CMFCore.FSPageTemplate, line 191, in _exec 
* Module Products.CMFCore.FSPageTemplate, line 124, in pt_render 
* Module Products.PageTemplates.PageTemplate, line 96, in pt_render 
FSPageTemplate at /testdollarproblem/document_view used for 
/testdollarproblem/foo> 
* Module TAL.TALInterpreter, line 189, in __call__ 
* Module TAL.TALInterpreter, line 233, in interpret 
* Module TAL.TALInterpreter, line 663, in do_useMacro 
* Module TAL.TALInterpreter, line 233, in interpret 
* Module TAL.TALInterpreter, line 408, in do_optTag_tal 
* Module TAL.TALInterpreter, line 393, in do_optTag 
* Module TAL.TALInterpreter, line 388, in no_tag 
* Module TAL.TALInterpreter, line 233, in interpret 
* Module TAL.TALInterpreter, line 663, in do_useMacro 
* Module TAL.TALInterpreter, line 233, in interpret 
* Module TAL.TALInterpreter, line 605, in do_loop_tal 
* Module TAL.TALInterpreter, line 233, in interpret 
* Module TAL.TALInterpreter, line 408, in do_optTag_tal 
* Module TAL.TALInterpreter, line 393, in do_optTag 
* Module TAL.TALInterpreter, line 388, in no_tag 
* Module TAL.TALInterpreter, line 233, in interpret 
* Module TAL.TALInterpreter, line 629, in do_condition 
* Module TAL.TALInterpreter, line 233, in interpret 
* Module TAL.TALInterpreter, line 552, in do_insertTranslation 
* Module TAL.TALInterpreter, line 615, in translate 
* Module Products.PageTemplates.TALES, line 263, in translate 
* Module Products.PageTemplates.GlobalTranslationService, line 31, in 
translate 
* Module Products.PageTemplates.GlobalTranslationService, line 29, in repl 

KeyError: 'hville' (Also, an error occurred while attempting to render the 
standard error message.) 


Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com___
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] Log procedure

2004-07-27 Thread Russ Ferriday
How about pound doing the logging?
It's working nicely here.
--r.
On 27 Jul 2004, at 14:18, Chris McDonough wrote:

Just curious: rather than jump through hoops to try to make Zope log the
right IP would it be possible for you to put Apache in front of Pound
and have it do the logging?  This would also provide a single log for
all requests (no matter which backend server they made it to).

On Tue, 2004-07-27 at 06:29, Egon wrote:
I have a Zope server behind a proxy server (
http://www.apsis.ch/pound ), in Zope, I am configured
zope.conf ( trust-servers and cgi-environment).
But in the log file, I can see only the ip of the
proxy, when I want to see the client ip.
HTTP-FORWARDED-FROM is set. 
But Zope logs REMOTEADDR in place of FORWARDED-FROM.
I think that I may modify any python file in order to
log FORWARDED-FROM , but I cannot find the py file
that I may modify.

Could anybody help me? I want to log the
forwarded-from value.

Thanks.




__
Yahoo! lanza su nueva tecnologa de bsquedas
te atreves a comparar?
http://busquedas.yahoo.es
___
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 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 )


Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com
___
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] ERROR(200) ZODB Couldn't load state for... Memory problem?

2004-07-26 Thread Russ Ferriday
This thread's not over 'til the fat lady sings.

OK, so apologies first:

Paul Winkler's comment in this thread was nearer the mark than Tres Seavers. clienthome is not relevant to where caches are created, and of course I need zeo-client-home.

Problem is now that zeo-client-home seems not to have the intended effect.
I set zeo-client-home to zeo1, in my first conf file and restart, but never see any cache files of that name.
I traced as far as the parse handler zeo_client_home. It's invoked with the correct value. But it stuffs the value into the env, and I can't see any other reference to ZEO_CLIENT pulling it back out of there again.
Working up the stack trace from ClientCache.py, where the files are created (*-None-*), my client value is always None, but there's a gap in the middle that I did not bridge, around BaseConfig and ZeoConfig.

Has anyone been successful naming cache files? I'm on OSX Panther 10.3.

--r.


I've traced through to the zeo_client_name handler, and see the name of 
On 23 Jul 2004, at 21:37, Chris McDonough wrote:

On Fri, 2004-07-23 at 16:21, Tim Peters wrote:
[Chris McDonough]
...
self._f[current] = open(self._p[current],'w+b')

 will be likely to fail at the last line if you're using
nonpersistent cache files, because self._p[current] is (bogus)
'1-None-0' (relative bogus filename).

Is it really *likely* to fail? 

I suppose it depends on the working directory of the shell/process used
to start Zope.  Zope doesn't mess with the working directory on its own,
AFAIK.

If you follow Richard Stevens' (UNIX Network Programming guy,
apparently now dead) advice, he says that well-behaved daemon
processes should change their working directory to /.  So I suspect
there are daemonizers that do this.

Guido's zdrun daemon (which zopectl uses) gives you an option to set
the working directory of the daemonized process, but I don't use it
(neither zdrun nor the option, that is).  It does nothing to the working
directory by default.

But I think the common case is that the program is run out of an
/etc/init.d rc script, and I suspect the working directory is / when
Zope gets started in that circumstance.  Which I guess makes the error
understandable.

It's just a name, and it's opened in
'w' ('+b') mode, not 'r' mode.  That is, it creates the file -- no
file of that name need already exist (and if one does, it tries to
overrwrite it).  Running on Windows most days, I'm not usually aware
of all the permission bugs Linuxheads delight in torturing themselves
with wink>.

Yes.  Gotta agree with you there.  I don't think a day passes where I
don't want to rip the face off the guy who proclaimed that TCP ports
below 1024 couldn't be bound to by a user other than root.  What a
disaster.

There should probably be a _using_persistent_cache flag attr rather than
trying to inspect self._p to find out if we're using persistent caches.

+1.  As you later discovered, this hmm, let's try to guess what we're
doing based on obscure droppings business is a continuing bug
factory.

Thankfully, Dieter fixed it so it doesn't (at least in this one case).

I may try to work up a patch + test for this later.

I'm neutral on whether you try, but +1 on you actually doing it wink>.

Too late!  It's already fixed.  I didn't know either. ;-)  This thread
was full of sound and fury

- C


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


Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com
___
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] ERROR(200) ZODB Couldn't load state for... Memory problem?

2004-07-26 Thread Russ Ferriday
Thanks Chris,
looks like I may have been bouncing messages. I did not see your earlier reply.
Your comments regarding file locations seem dead on. Sorry for the noise on that topic.
I'll try the naming change.
I've had to go back to 2.7.1 due an another error, below.
(Yes, I did rmpyc on all Products before running this version. Going back to 271 worked fine again. And the problem is repeatable)
2004-07-26T01:57:04 ERROR(200) SiteError
Traceback (most recent call last):
File /usr/local/zope/zope/lib/python/ZPublisher/Publish.py, line 101, in
publish
request, bind=1)
File /usr/local/zope/zope/lib/python/ZPublisher/mapply.py, line 88, in
mapply
if debug is not None: return debug(object,args,context)
File /usr/local/zope/zope/lib/python/ZPublisher/Publish.py, line 39, in
call_object
result=apply(object,args) # Type scr> to step into published object.
File /usr/local/zope/zope/lib/python/Shared/DC/Scripts/Bindings.py, line
306, in __call__
return self._bindAndExec(args, kw, None)
File /usr/local/zope/zope/lib/python/Shared/DC/Scripts/Bindings.py, line
343, in _bindAndExec
return self._exec(bound_data, args, kw)
File /usr/local/zope/instances/prodZope/Products/CMFCore/FSPageTemplate.py,
line 191, in _exec
result = self.pt_render(extra_context=bound_names)
File /usr/local/zope/instances/prodZope/Products/CMFCore/FSPageTemplate.py,
line 124, in pt_render
result = FSPageTemplate.inheritedAttribute('pt_render')(
File

/usr/local/zope/zope/lib/python/Products/PageTemplates/PageTemplate.py, line
88, in pt_render
raise PTRuntimeError, 'Page Template %s has errors.' % self.id
PTRuntimeError: Page Template login_form has errors.

I'll get back with confirmations once I have more.

Thanks again!
--r


On 26 Jul 2004, at 09:12, Chris McDonough wrote:

Russ, I posted a message today about this at about 2pm with a solution.

See http://mail.zope.org/pipermail/zope-dev/2004-July/023538.html .

HTH,

- C


On Mon, 2004-07-26 at 03:42, Russ Ferriday wrote:
This thread's not over 'til the fat lady sings.




Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com
___
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] ERROR(200) ZODB Couldn't load state for... Memory problem?

2004-07-25 Thread Russ Ferriday
e zeo1

Fair enough. I'm setting a name. Here are my other critical items:
zodb_db temporary>
temporarystorage>
name sessions
/temporarystorage>
mount-point /temp_folder
container-class Products.TemporaryFolder.TemporaryContainer
/zodb_db>


zodb_db main>
mount-point /
zeoclient>
server localhost:8800
storage 1
name zeostorage
var $ZEO_INSTANCE/var
/zeoclient>
/zodb_db>

So I cd to the zope root and..
grep -r zeo-client-name *
lib/python/Zope/Startup/zopeschema.xml:  key name=zeo-client-name handler=zeo_client_name>

So zeo-client-name is handled by zeo_client_name. Great! I shoved a pdb_trace there. n and l  give me
76 def zeo_client_name(value):
77 value and _setenv('ZEO_CLIENT', value)
78 import pdb; pdb.set_trace()
79  -> return value
(Pdb) value
'zeo1'

Cool! So far so good. 

But this brings me to the gap..  How is ZEO_CLIENT in the environment going to get into self.config.client in the ZEOClient? Bearing in mind grep -r ZEO_CLIENT * shows me only comments, apart from the handler, where it is set.

Any ideas? Anyone seen anything but *-None-* for cache files?

Meanwhile, I'm going to see why zope gets creative about spreading the cache files around.

--r.

On 23 Jul 2004, at 21:37, Chris McDonough wrote:

On Fri, 2004-07-23 at 16:21, Tim Peters wrote:
[Chris McDonough]
...
self._f[current] = open(self._p[current],'w+b')

 will be likely to fail at the last line if you're using
nonpersistent cache files, because self._p[current] is (bogus)
'1-None-0' (relative bogus filename).

Is it really *likely* to fail? 

I suppose it depends on the working directory of the shell/process used
to start Zope.  Zope doesn't mess with the working directory on its own,
AFAIK.

If you follow Richard Stevens' (UNIX Network Programming guy,
apparently now dead) advice, he says that well-behaved daemon
processes should change their working directory to /.  So I suspect
there are daemonizers that do this.

Guido's zdrun daemon (which zopectl uses) gives you an option to set
the working directory of the daemonized process, but I don't use it
(neither zdrun nor the option, that is).  It does nothing to the working
directory by default.

But I think the common case is that the program is run out of an
/etc/init.d rc script, and I suspect the working directory is / when
Zope gets started in that circumstance.  Which I guess makes the error
understandable.

It's just a name, and it's opened in
'w' ('+b') mode, not 'r' mode.  That is, it creates the file -- no
file of that name need already exist (and if one does, it tries to
overrwrite it).  Running on Windows most days, I'm not usually aware
of all the permission bugs Linuxheads delight in torturing themselves
with wink>.

Yes.  Gotta agree with you there.  I don't think a day passes where I
don't want to rip the face off the guy who proclaimed that TCP ports
below 1024 couldn't be bound to by a user other than root.  What a
disaster.

There should probably be a _using_persistent_cache flag attr rather than
trying to inspect self._p to find out if we're using persistent caches.

+1.  As you later discovered, this hmm, let's try to guess what we're
doing based on obscure droppings business is a continuing bug
factory.

Thankfully, Dieter fixed it so it doesn't (at least in this one case).

I may try to work up a patch + test for this later.

I'm neutral on whether you try, but +1 on you actually doing it wink>.

Too late!  It's already fixed.  I didn't know either. ;-)  This thread
was full of sound and fury

- C


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


Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com
___
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] ERROR(200) ZODB Couldn't load state for... Memory problem?

2004-07-23 Thread Russ Ferriday
Thanks Tim and Chris! - You were both dead on in so many respects.

Chris, There was a correlation with flip in the logs

Tim: looks like once a None occurs it sticks.

Source of the problem was an old cache file (1-None-1) that could not be overwritten by the current uid running Zope. (That's the second stupid permissions problem in as many days. My advice - if you have any kind of cache problems occurring after an initial period, look hard at permissions. Secondly - don't be sloppy and run zope first as one user then as another. Thirdly grep the event logs for IOError first. That's the easiest thing to fix.) 

more comments below...

On 23 Jul 2004, at 02:14, Tim Peters wrote:

[Chris McDonough]
...
I think the problem is related to ZEO client storage cache flips.

..
anyway, pointing to None.  But this code gives me a headache, and I'm
not sure that can actually happen (despite that I hear you guys saying
it is wink>).
I was slow interpreting all of this due to separate event files.
This piece of bash script was helpful to get a grip of time order between Clients:


grep ZEC ev*.log | sed 's/:/ /' | sort -k 2 > interleaved.ZEC.events.log

a multi-line merge script would be helpful. I'll bet someone's created one.

But then I turned off persistent ZEO client cachefile storage (but omitting
the zeo-client-name parameter from zope.conf), believing this would be a
workaround, but it hasn't been.  I gave up at that point and that's where I am now.

Did you continue to get errors in the log near cache-flip times?  I
don't see a way for checkSize() to screw up unless an unexpected
exception is raised.
Bingo!
2004-07-21T11:35:07 INFO(0) ZEC:1-None-1 flipping cache files.  new current = 1
--
2004-07-21T11:35:07 ERROR(200) ZODB Couldn't load state for 00012323
Traceback (most recent call last):
File /usr/local/zope/zope271/lib/python/ZODB/Connection.py, line 559, in setstate
p, serial = self._storage.load(oid, self._version)
File /usr/local/zope/zope271/lib/python/ZEO/ClientStorage.py, line 754, in load
self._cache.checkSize(0)
File /usr/local/zope/zope271/lib/python/ZEO/ClientCache.py, line 581, in checkSize
self._f[current] = open(self._p[current],'w+b')
IOError: [Errno 13] Permission denied: '1-None-1'

...
My theory is that it will happen as often as a Zope client's ZEO client storage
needs to flip its cache file.  The cache file is only flipped when it exceeds a
certain size and it only exceeds a certain size after a certain pattern of usage
causes it to do so (lots of loads from the database of new items, typically).
Yup!

It appears that once self._f[self._current] is None, all future
attempts by ZEO to store into its client cache will fail the same way.
So I'd be even more surprised if you saw just one of these occur.
Yup!

It would be nice if you could confirm this.  Reading the Zope event log
file of the client that generated the error would be a good start.

The log is everything here.  The ZEO client cache logs most relevant
messages at info level, producing msgs starting with ZEC.


Thanks again for the insights.

--r.

Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com
___
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] ERROR(200) ZODB Couldn't load state for... Memory problem?

2004-07-23 Thread Russ Ferriday

On 23 Jul 2004, at 17:00, Chris McDonough wrote:

Thanks a lot for the confirmation!

A pint from me the next time I see you. And Tim!

The next item is this message - I see many - and need to restart the instance that's spewing them:
2004-07-23T08:21:07 INFO(0) ZEC:1-None-1 load: bad record for oid 1c8c at position 2082264 in cac
he file 1

This problem also occurs after a few hours.

Is this caused because I'm on a MP box, with two clients, sharing the same directory for cache files??

if so, I can't see immediately how to put the files elsewhere, per Client.

--r.




Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com
___
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: ERROR(200) ZODB Couldn't load state for... Memory problem?

2004-07-23 Thread Russ Ferriday
Thanks Tres,
That looks to be about it.
We'll limp through today, and try this on the weekend. This will cause a couple of other changes and I don't have the nerve for it at 7PM on a Friday night.
I'll let you know, and write up these last few lessons on Zope.org.
--r.
On 23 Jul 2004, at 18:35, Tres Seaver wrote:

Russ Ferriday wrote:
On 23 Jul 2004, at 17:00, Chris McDonough wrote:
Thanks a lot for the confirmation!
A pint from me the next time I see you. And Tim!
The next item is this message - I see many - and need to restart the instance that's spewing them:
2004-07-23T08:21:07 INFO(0) ZEC:1-None-1 load: bad record for oid 1c8c at position 2082264 in cac
he file 1
This problem also occurs after a few hours.
Is this caused because I'm on a MP box, with two clients, sharing the same directory for cache files??
if so, I can't see immediately how to put the files elsewhere, per Client.

(Untested):

# zope.conf.appserver1
%include zope.conf.common
clienthome /path/to/zope/var/appserver1

# zope.conf.appserver2
%include zope.conf.common
clienthome /path/to/zope/var/appserver2

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Zope Corporation  Zope Dealers   http://www.zope.com

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


Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com
___
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] ERROR(200) ZODB Couldn't load state for... Memory problem?

2004-07-23 Thread Russ Ferriday
No, I think Tres nailed it, in his reply.
I'll confirm when I know more.
Thanks anyway.
--r.
On 23 Jul 2004, at 18:38, Paul Winkler wrote:

it shouldn't matter what directory as long as the filenames are
unique...

if so, I can't see immediately how to put the files elsewhere, per 
Client.

You mean this, from zope.conf.in?

# Directive: zeo-client-name


Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com
___
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] ERROR(200) ZODB Couldn't load state for... Memory problem?

2004-07-22 Thread Russ Ferriday
Hi all,

On OSX 10.3 (Pahter), Python 2.3.4, Zope 2.7.1, I'm frequently seeing this..
2004-07-22T14:00:24 ERROR(200) ZODB Couldn't load state for 16ad
Traceback (most recent call last):
File /usr/local/zope/zope271/lib/python/ZODB/Connection.py, line 559, in setstate
p, serial = self._storage.load(oid, self._version)
File /usr/local/zope/zope271/lib/python/ZEO/ClientStorage.py, line 755, in load
self._cache.store(oid, p, s, v, pv, sv)
File /usr/local/zope/zope271/lib/python/ZEO/ClientCache.py, line 601, in store
self._store(oid, p, s, version, pv, sv)
File /usr/local/zope/zope271/lib/python/ZEO/ClientCache.py, line 631, in _store
f.seek(self._pos)
AttributeError: 'NoneType' object has no attribute 'seek'

It's intermittent at first, then back-to-back. 

Following thread leads me to look for memory shortage. But I'd expect a different message in that case.
http://www.mail-archive.com/[EMAIL PROTECTED]/msg15039.html

This thread seems to suggest such messages (in different context) can be ignored. But I can't do that. This is a symptom of a bigger problem.
http://mail.zope.org/pipermail/zope/2001-August/097300.html

Has anyone seen this in these circumstances?
--r.





Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com___
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] ERROR(200) ZODB Couldn't load state for... Memory problem?

2004-07-22 Thread Russ Ferriday
Thanks, Chris.
We're fronting two Zopes with Pound for load balancing. I can't see there would be any connection with this error. But I mention it in case there's a pattern.
Also, the database came from 2.7.0 and an earlier python. This looks like resource starvation to me. The servers run for an hour or two this problems shows up, becoming worse for a while, then we need a restart.
I'm try to debug it tomorrow. What would you look for? Any tips for resource monitoring?
--r. 
On 22 Jul 2004, at 21:49, Chris McDonough wrote:

I have seen this as well but I haven't been able to pin it down.

On Thu, 2004-07-22 at 16:16, Russ Ferriday wrote:
Hi all,

On OSX 10.3 (Pahter), Python 2.3.4, Zope 2.7.1, I'm frequently
seeingthis..
2004-07-22T14:00:24 ERROR(200) ZODB Couldn't load state
for16ad
Traceback (most recent call last):
File /usr/local/zope/zope271/lib/python/ZODB/Connection.py,
line559, in setstate
p, serial = self._storage.load(oid, self._version)
File /usr/local/zope/zope271/lib/python/ZEO/ClientStorage.py,
line755, in load
self._cache.store(oid, p, s, v, pv, sv)
File /usr/local/zope/zope271/lib/python/ZEO/ClientCache.py,
line601, in store
self._store(oid, p, s, version, pv, sv)
File /usr/local/zope/zope271/lib/python/ZEO/ClientCache.py,
line631, in _store
f.seek(self._pos)
AttributeError: 'NoneType' object has no attribute 'seek'

It's intermittent at first, then back-to-back. 

Following thread leads me to look for memory shortage. But I'd expecta
different message in that case.
http://www.mail-archive.com/[EMAIL PROTECTED]/msg15039.html

This thread seems to suggest such messages (in different context)
canbe ignored. But I can't do that. This is a symptom of a bigger
problem.
http://mail.zope.org/pipermail/zope/2001-August/097300.html

Has anyone seen this in these circumstances?
--r.





Russ Ferriday
Solution Workshops for Plone
(+44) (0) 7789 338868
http://www.solutionworkshops.com

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


Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com
___
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 )