[Zope] Re: help debugging a "can't pickle" error deep within a catalog reindex

2008-06-24 Thread Rob Miller

Rob Miller wrote:

hi,

i'm trying to perform a ZCatalog.refreshCatalog() on a catalog with over 
29,000 indexed objects.  it churns for a good long time, and eventually 
fails with a long set of tracebacks, of which i've included a sample at 
the end of this message.


i think i understand the gist of the issue... it's trying to write an 
object (probably a CatalogBrain) to the database, but this object's 
__dict__ contains a value that is of type instancemethod, which isn't 
allowed for persistent objects.


the problem is that i can't figure out which specific objects are 
causing the problem.  i've used pdb.post_mortem to get a debug prompt 
way down in the traceback, but the code goes in and out of C modules, so 
i'm missing a lot of what's happening.  and when i interactively peek at 
the objects that are being indexed when the error happens, there doesn't 
seem to be anything wrong, and i can index the objects w/ no problem.  
i've even tried dropping the subtransaction threshold down to 1, so it 
will try to commit a savepoint after every object, but none of the 
objects being indexed seemed to have any problems.


okay, after leaving this for a few days, i came back to it and managed to work 
it out.  for posterity's sake, what ended up working was that i added an 
explicit transaction.commit() after every object reindex, wrapped in a try: 
except, like so:


--- src/Zope/lib/python/Products/ZCatalog/ZCatalog.py   2007-10-29 
06:09:30.0 -0700
+++ lib/zope/lib/python/Products/ZCatalog/ZCatalog.py   2008-06-24 
10:47:49.0 -0700

@@ -294,6 +294,11 @@
 if obj is not None:
 try:
 self.catalog_object(obj, p, pghandler=pghandler)
+try:
+transaction.commit()
+except:
+import sys, pdb
+pdb.post_mortem(sys.exc_info()[2])
 except ConflictError:
 raise
 except:

this made the reindex take a ridiculously long time, and it leaves the catalog 
in an inconsistent state (i.e. it should only be done on a copy of the 
database, one that you can throw away), but it did in the end reveal to me 
which record was causing the problem.


the problematic record ended up being a ghosted catalog entry that happened to 
share the same name as a view.  when the catalog tried to look up the object 
by its path (via unrestrictedTraverse), the view object was returned.


thanks for the help!

-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] Re: help debugging a "can't pickle" error deep within a catalog reindex

2008-06-18 Thread Rob Miller

Ross Patterson wrote:

Rob Miller <[EMAIL PROTECTED]> writes:


hi,

i'm trying to perform a ZCatalog.refreshCatalog() on a catalog with
over 29,000 indexed objects.  it churns for a good long time, and
eventually fails with a long set of tracebacks, of which i've included
a sample at the end of this message.

i think i understand the gist of the issue... it's trying to write an
object (probably a CatalogBrain) to the database, but this object's
__dict__ contains a value that is of type instancemethod, which isn't
allowed for persistent objects.

the problem is that i can't figure out which specific objects are
causing the problem.  i've used pdb.post_mortem to get a debug prompt
way down in the traceback, but the code goes in and out of C modules,
so i'm missing a lot of what's happening.  and when i interactively
peek at the objects that are being indexed when the error happens,
there doesn't seem to be anything wrong, and i can index the objects
w/ no problem.  i've even tried dropping the subtransaction threshold
down to 1, so it will try to commit a savepoint after every object,
but none of the objects being indexed seemed to have any problems.

i CAN verify that the instancemethod that is causing the problem
renders like this:

>

even that hasn't proven enough for me to concretely identify the
source of the problem, though.

i've been working on this for a full day already, and am not sure how
to proceed.  does anyone have any debugging tips that might help me
figure out what, exactly, is causing the reindex attempts to blow up?

thanks!


Can you get a pdb.post_mortem prompt at the actual ZODB/serialize.py:416
error or only at transaction/_transaction.py:267 where some sort of
previous error is handled?


yes, i put the post_mortem around the "transaction.savepoint" call at line 559 
of Products/ZCatalog/ZCatalog.py.  this is the place where the error is 
happening, but it's where the subtransaction threshold has been reached, so 
IIUC the error could be caused by any of the objects in the subtransaction.



If the former, I often find it informative to step up to
ZODB/serialize.py:407 where obj.__getstate__() is called and find out
what obj is.  Is it the same object every time?  If not, is it of the
same type every time?


right.  as long as the subtxn threshold number is the same, then the object is 
the same.  but if i change the subtxn threshold, then the object will be 
different.  as i said, i even tried reducing the subtxn threshold to '1', so, 
assuming my understanding is correct, this would be triggered after every 
object.  it took many hours to get to my debug prompt; when i did, the obj was 
FileAttachment object that didn't seem to have any problems.  i was able to 
interactively index the object from the pdb prompt, and even commit the 
transaction, w/ no problems.



A next step can also be to put a pdb.set_trace() at
transaction/_transaction.py:340 in the register() method such that it's
is only called when the offending object is added to the transaction.


i'll give this a shot, thx.


Hope some of that helps,


even just having someone to discuss it with is helpful, for my sanity at 
least...  ;-)


thx.

-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] help debugging a "can't pickle" error deep within a catalog reindex

2008-06-17 Thread Rob Miller

hi,

i'm trying to perform a ZCatalog.refreshCatalog() on a catalog with over 
29,000 indexed objects.  it churns for a good long time, and eventually fails 
with a long set of tracebacks, of which i've included a sample at the end of 
this message.


i think i understand the gist of the issue... it's trying to write an object 
(probably a CatalogBrain) to the database, but this object's __dict__ contains 
a value that is of type instancemethod, which isn't allowed for persistent 
objects.


the problem is that i can't figure out which specific objects are causing the 
problem.  i've used pdb.post_mortem to get a debug prompt way down in the 
traceback, but the code goes in and out of C modules, so i'm missing a lot of 
what's happening.  and when i interactively peek at the objects that are being 
indexed when the error happens, there doesn't seem to be anything wrong, and i 
can index the objects w/ no problem.  i've even tried dropping the 
subtransaction threshold down to 1, so it will try to commit a savepoint after 
every object, but none of the objects being indexed seemed to have any problems.


i CAN verify that the instancemethod that is causing the problem renders like 
this:


/session_data_manager>>


even that hasn't proven enough for me to concretely identify the source of the 
problem, though.


i've been working on this for a full day already, and am not sure how to 
proceed.  does anyone have any debugging tips that might help me figure out 
what, exactly, is causing the reindex attempts to blow up?


thanks!

-r




Traceback (most recent call last):
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/Products/ZCatalog/ZCatalog.py", 
line 296, in refreshCatalog

self.catalog_object(obj, p, pghandler=pghandler)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/zope/Products/CMFPlone/CatalogTool.py", 
line 367, in catalog_object

self._increment_counter()
  File 
"/home/rob/topp/14000/builds/20080611/opencore/zope/Products/CMFPlone/CatalogTool.py", 
line 395, in _increment_counter

self._counter.change(1)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/BTrees/Length.py", 
line 55, in change

self.value += delta
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/ZODB/Connection.py", 
line 890, in register

self._register(obj)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/ZODB/Connection.py", 
line 900, in _register

self.transaction_manager.get().join(self)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/transaction/_transaction.py", 
line 273, in join

self._prior_operation_failed() # doesn't return
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/transaction/_transaction.py", 
line 267, in _prior_operation_failed

raise TransactionFailedError("An operation previously failed, "
TransactionFailedError: An operation previously failed, with traceback:

  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/ZServer/PubCore/ZServerPublisher.py", 
line 25, in __init__

response=b)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/ZPublisher/Publish.py", 
line 401, in publish_module

environ, debug, request, response)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/ZPublisher/Publish.py", 
line 202, in publish_module_standard

response = publish(request, module_name, after_list, debug=debug)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/ZPublisher/Publish.py", 
line 119, in publish

request, bind=1)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/ZPublisher/mapply.py", 
line 88, in mapply

if debug is not None: return debug(object,args,context)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/ZPublisher/Publish.py", 
line 42, in call_object

result=apply(object,args) # Type s to step into published object.
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/Products/ZCatalog/ZCatalog.py", 
line 260, in manage_catalogReindex

self.refreshCatalog(clear=1, pghandler=handler)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/lib/zope/lib/python/Products/ZCatalog/ZCatalog.py", 
line 296, in refreshCatalog

self.catalog_object(obj, p, pghandler=pghandler)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/zope/Products/CMFPlone/CatalogTool.py", 
line 385, in catalog_object

update_metadata, pghandler=pghandler)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/zope/Products/CacheSetup/patch.py", 
line 96, in catalog_object

uid, idxs, update_metadata, pghandler)
  File 
"/home/rob/topp/14000/builds/20080611/opencore/zope/Products/CacheSetup/patch_utils.py", 
line 6, in call

return getattr(self, PATTERN % __name__)(*args, **kw)
  File 
"/home/rob/topp/14000/builds/20080611/opencore

[Zope] Re: which operating system quandry

2006-09-29 Thread Rob Miller

David Bear wrote:

I know it has been asked many times which os is best for zope, I have
yet to see a 'system administration perspective' in the discussion. By
this I mean which os seems to have the most worry free administration
of a zope instances. I have installed zope on both FreeBSD and various
linucies and here is what I have observed:

1) Freebsd ports collection is an easy way to install zope -- the
ports maintainer takes care of making the build files to handle all the
zope dependencies including python versions, libraries, etc. However,
I have yet to use portupgrade to apply security patches to zope
instances running on freebsd. Does anyone know of using cvsupdate for
getting security patches works over the ports collection of zope
smoothly?

2) I've run zope on Red Hat and Suse linux. In both cases I found that
I needed to install a different version of python than the one
packaged with the distro becuase Zope had specific dependencies for
new versions python. Applying patches to zope is manual. It has always been very
inconvenient to build python and PIL in a separate run instances for
zope. This seems like a major pain in the ...


i've been most happy w/ debian or ubuntu, and have also had good luck w/ 
gentoo.  in each case, i use python (as well as nearly all python 
dependencies, e.g. PIL) from the distribution, but then build Zope itself from 
source, either a checkout or a tarball.


-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] Re: Using property() function in Zope 2.8

2006-07-06 Thread Rob Miller
On Thu, 06 Jul 2006 21:19:36 +0200, Max M wrote:

> I needed to dynamically generate local roles for an Archetypes based
> content object today.
> 
> Different layers in my Plone stack breaks all rules and reads the
> __ac_local_roles__ variable directly, instead of calling get_local_roles()
> 
> So to maximize the compatibility between Zopes zmi and Plones local roles
> management I wanted to make '__ac_local_roles__' a property with setters
> and getters.

it's not an answer to your original question (i have nothing to add to
what fred already replied) but TeamSpace solves this by using a
ComputedAttribute instead of a property for the dynamic local roles.  all
of the pertinent code is here, hope you find it useful:

http://svn.plone.org/view/collective/teamspace/tags/1.4/security.py?rev=24604&view=auto

-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] Re: Groupware in zope

2006-04-18 Thread Rob Miller

Saura Ramachandran wrote:

Hi,
  Is there a groupware in Zope with features like wiki, forum,
filemanager and other project management stuff in zope or plone? 
Please share your experiences.


you might find the Plone-based OpenCore software that is driving the 
openplans.org site useful.  it's feature-lean at the moment (basically 
just a group-centric wiki), but is under very active development, over 
the next two months we'll be deploying file attachments, mailing lists, 
blogs, and project rosters.


http://plone.org/products/opencore
http://openplans.org/projects/opencore

-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] Re: Presentations Available

2005-10-07 Thread Rob Miller

Nick Davis wrote:

Hello
Some thoughts :


- Upgrading to Zope 2.8 without reading the release notes.


I followed the release notes but this didn't fix catalog errors. I am 
not the only one. This is apparently fixed in Zope 2.8.2 but that 
doesn't look like it can be downloaded yet.


in some cases the problem will go away if you simply execute a 
'len(catalog)' command, either from a script or from zopectl debug.  YMMV.



- Third party products that are not yet fully compatible
  with Plone 2.1 and/or Zope 2.8.


Should this perhaps be the other way around? If those products used the 
APIs correctly, perhaps a new release of Zope/Plone should still support 
old APIs and/or deprecate them gradually and with warning? This is a 
difficult problem to address but sometimes it may be better to hold back 
on releasing something new if it causes things that depend on it to 
break. On the other hand I can understand peoples desire to release 
something new and cool (even if not quite ready) . ;-)
And its hard to know quickly what the bugs are if you don't release it 
to the real world. So hard to know what to do..


the problem is not with the APIs... those we have taken care to 
deprecate.  the problems lie within template code (such as the problem 
you describe below), where it's much harder to maintain backward 
compatibility and still move forward.



- Sites that have customized parts of Plone they shouldn't
  have touched in the first place.


This is an important issue. It is difficult not to touch things that one 
shouldn't. A trivial example - If you want your breadcrumbs to just list 
the breadcrumbs instead of say "you are here" you have to copy across 
global_pathbar.pt and take out "you are here". There is not another easy 
way to do it that I can see. If you then migrate to 2.1, that .pt has 
changed so you have to copy the new one and re-do it otherwise nothing 
renders. If you want to add another logo on the right of the header you 
have to hack Plone's templates further. Each change is in itself trivial 
but they add up and when you migrate, you;re left with stuff that 
doesn't work and spend quite a while resolving it. And thats for those 
of us savvy enough to use the filesystem. Those who customised through 
the ZMI will have a bigger headache.


tres responded to this more eloquently than i'd be able to...

as for the broken products, that is a pandemic within the open source 
community, hardly unique to plone.  


True.

AT's problems are entirely recognized by those of us who use it 
heavily, and i can assure you that the AT developer pool has no 
intention of continuing to pile more cruft on top of a shaky stack. .
the first iterations of this will probably also have some warts.  but 
please don't assume that plone/AT developers don't see the same 
problems that you see, and that they aren't willing and able to learn 
from their mistakes.


It would seem Archetypes has improved over time.

My real worry is when we do have a new release of Plone sitting on top 
of Zope 3 we'll have a whole new set of bleeding edge code sitting on 
top of other bleeding edge code, while stuff that did work with a mature 
AT1.3.x (or 1.4.x or whatever) suddenly stops working.

Hopefully this will prove to be an unjustified fear!


as tres said, z3 isn't really bleeding edge any more.  i'm not saying 
that there won't be migration bumps.. i expect there will be.  but there 
are a lot of folks with a lot of working code dependent on this stack, 
and we'll all be working together to get to the next level.


Probably this is no-one's fault. It is the nature of open source. To 
compare, have to admit I tried to get Bricolage to work a while back, 
and ran into CPAN dependency hell.


I wonder if perhaps the real problem is trying to do so much with so few 
resources.


this is, to me, the crux of the problem.  there are a million things 
that could be better.  i've got far more ideas for improvement than i 
have the time to give those ideas... we've all still got to get billable 
hours in.


that being said, things are getting better with time, and i expect them 
to continue to do so.


Linux has a very mature platform as much of its base, and a lot of 
commercial support which helps.
Perl and the CPAN is quite mature now and also had quite a lot of 
commercial support.
The good thing about commercial support is people being paid to do grunt 
work and run loads of tests and update documents.
Both Linux and CPAN are very modular. It is relatively easy to change 
one part without knowing about other parts.
I think it would be easier to find someone who could patch a broken CPAN 
module, than someone who could delve inside Zope and Plone. This is 
because many of us don't understand the various components of the 
underlying architecture, and a lot is changing for Zope 3. Also many 
Perl modules are widely used by many applications, whereas a lot of Zope 
code is only used by other Zope code.


again, tres 

[Zope] Re: Presentations Available

2005-10-06 Thread Rob Miller

Chris Withers wrote:

Nick Davis wrote:


there seem to still be migration problems and broken products which 
prevent people going to 2.1 yet. 


Yup.


this strikes me as a bit unfair.  to quote stefan holek from a post on 
plone-dev earlier today, most reported migration problems are due to:


- Upgrading to Zope 2.8 without reading the release notes.
- Third party products that are not yet fully compatible
  with Plone 2.1 and/or Zope 2.8.
- Sites that have customized parts of Plone they shouldn't
  have touched in the first place.
- Plone Team stupidity.

thus, while it's true that we have made mistakes (and will continue to, 
no doubt), most of the problems are issues beyond our control.


as for the broken products, that is a pandemic within the open source 
community, hardly unique to plone.  how many zope products are out there 
of dubious quality, or that are poorly maintained?  whenever you get a 
large community of developers, you get a mixed bag of talent and of 
follow-through.  the suggestion you make in your talk of having a peer 
rating process for add-on products is a good one, certainly, and one 
that's been discussed before, but getting there takes some effort.


My colleague has spent a long time trying to migrate a Product he 
wrote, from Archetypes 1.2.5 to 1.3.4, due to the fact he had to hack 
around problems with references. 


Archetypes is the chief sinner in all of this, I'm afraid. It's trying 
to solve a very difficult problem, and one which needs tackling with 
structure and upfront and intuitive design rather than the organic 
tacking on of new "bitz" whenever anyone felt like it that AT has 
suffered through...


  My fear is as more features are added, what you describe as a shaky 
stack of complex fragile components will get ever more dependencies 
and therefore ever more complex and fragile.


Yup.


yes, AT is in many ways a mess.  but, as you say, it's tackling a very 
difficult problem, and, like most attempts at tackling difficult 
problems, the first iterations were somewhat less than perfect.  the 
same can be said for zope itself... there's a reason z3 was a complete 
rewrite.


AT's problems are entirely recognized by those of us who use it heavily, 
and i can assure you that the AT developer pool has no intention of 
continuing to pile more cruft on top of a shaky stack.  instead, we're 
looking at how we can break the framework apart into components that can 
all be glued together in a nice z3 fashion.  there are a great many 
tools available to us now that were not available when AT was originally 
developed (adapters, events, views, etc.), and we have every intention 
of making use of them to improve the stack (by making it leaner and more 
efficient, NOT by adding features willy-nilly!).  ideally, you'll be 
able to pick and choose from the various AT features, using adapters to 
glue the functionality you need (and only what you need) into your own 
products.


the first iterations of this will probably also have some warts.  but 
please don't assume that plone/AT developers don't see the same problems 
that you see, and that they aren't willing and able to learn from their 
mistakes.


-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] VHost logs.

2000-11-30 Thread Rob Miller

seb bacon wrote:

>> Rob Miller wrote:

>>

>> In a manner of speaking, yes.  That is, Apache needs to have correctly 
>> configured VirtualHost directives to handle the requests from the 
>> outside world appropriately, and Zope needs to have the SiteAccess 
>> product installed with correctly configured SiteRoots and access rules. 
>>   It takes a little bit of time to figure out, but it works like a charm 
>> and is really quite simple, once you wrap your head around it.  There's 
>> a great HOW-TO on this at http://www.zope.org/Members/anser/apache_zserver.
> 
> 
> I would also point you to 
> 
>   http://www.apache.org/docs/vhosts/mass.html
> 
> for more info on the apache side, particularly this bit:
> 
>  The main disadvantage is that you cannot have a different log 
>  file for each virtual host; however if you have very many virtual 
>  hosts then doing this is dubious anyway because it eats file
>  descriptors. It is better to log to a pipe or a fifo and arrange 
>  for the process at the other end to distribute the logs to the 
>  customers (it can also accumulate statistics, etc.).

This document refers to handling situations where you have a very large 
number of virtual hosts and don't want a separate VirtualHost directive 
for each one (because they're all very similar).  This is not my case, 
but it could be the original poster's.  You certainly CAN log to 
different log files if you have a VirtualHost directive for each host; 
I'm doing so.

> 
> 
>> Another benefit of this setup is that it can allow for both regular HTTP 
>> and SSL connections to all of your sites, so you can remotely access the 
>> manage screens without sending your passwords in the clear.  A HOW-TO 
>> for this lives at http://www.zope.org/Members/unfo/apache_zserver_ssl. 
>> I still haven't figured out a clean way to make it impossible to access 
>> sensitive areas UNLESS you're using SSL, however.  Anyone out there 
>> doing this?
> 
> 
> mod_rewrite is your friend.  You just make a Rule that redirects
> anyone accessing your site on port 80 to port 443, something like
> this:
> 
> 
>   ServerName www.foobar.com
>   RewriteEngine on
>   RewriteRule ^/(.*)  https://www.foobar.com/
> 

I don't want to force ALL access to port 443, only certain sections of 
the site which require authentication to access.  I guess the above 
still holds true (your correction in a later message is noted), I just 
need to get more creative with my rewrite rules.  Thanks for the tip.

-rob


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




Re: [Zope] VHost logs.

2000-11-30 Thread Rob Miller

Jason C. Leach wrote:

> hi,
> 
> With Apache in front of zope, do you disable Medusa?

No.  Apache merely acts as a proxy server.  Apache gets a request, 
passes the request on to Zope, Medusa/Zserver serves up the results back 
to Apache, which then hands them out to the original requester.

> And do you need to
> set both Apache and Zope to have the vhosts (do I need to set up a vhost
> twice?).

In a manner of speaking, yes.  That is, Apache needs to have correctly 
configured VirtualHost directives to handle the requests from the 
outside world appropriately, and Zope needs to have the SiteAccess 
product installed with correctly configured SiteRoots and access rules. 
  It takes a little bit of time to figure out, but it works like a charm 
and is really quite simple, once you wrap your head around it.  There's 
a great HOW-TO on this at http://www.zope.org/Members/anser/apache_zserver.

Another benefit of this setup is that it can allow for both regular HTTP 
and SSL connections to all of your sites, so you can remotely access the 
manage screens without sending your passwords in the clear.  A HOW-TO 
for this lives at http://www.zope.org/Members/unfo/apache_zserver_ssl. 
I still haven't figured out a clean way to make it impossible to access 
sensitive areas UNLESS you're using SSL, however.  Anyone out there 
doing this?

-rob

> 
> On Wed, 29 Nov 2000, Rob Miller wrote:
> 
> 
>> Jason C. Leach wrote:
>> 
>> 
>>> hi,
>>> 
>>> Has anyone implemented there own logging for Virtual Sites?
>>> 
>>> I was thinking in the site rules an External Method could be called,
>>> passed the Request obj, and from that generate logs for virtual sites.
>>> 
>>> If anyone has done that, or knows of a better way I'd be interested in
>>> hearing it.
>> 
>> I'm not exactly sure what your goal is... but if you're just trying to 
>> generate separate log files for each of your virtual sites, I'm accomplishing 
>> that by having my virtual sites proxied behind Apache (using SiteAccess and 
>> the ProxyPass directive) and specifying the log files for each VirtualHost in 
>> my httpd.conf file.  You can control the contents of the logs using the 
>> LogFormat directive; I use the same format for all of my virtual hosts, but I 
>> think you can specify a different log format for each host if you desire.
>> 
>> If you're trying to accomplish something else which requires you to handle the 
>> logging on the Zope side of things, then it seems to me that your idea would 
>> work, although I'd want to find out how my server performance would be affected...
>> 
>> Hope this is useful for you,
>> 
>> rob
>> 
>> 



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




Re: [Zope] VHost logs.

2000-11-29 Thread Rob Miller

Jason C. Leach wrote:

> hi,
> 
> Has anyone implemented there own logging for Virtual Sites?
> 
> I was thinking in the site rules an External Method could be called,
> passed the Request obj, and from that generate logs for virtual sites.
> 
> If anyone has done that, or knows of a better way I'd be interested in
> hearing it.

I'm not exactly sure what your goal is... but if you're just trying to 
generate separate log files for each of your virtual sites, I'm accomplishing 
that by having my virtual sites proxied behind Apache (using SiteAccess and 
the ProxyPass directive) and specifying the log files for each VirtualHost in 
my httpd.conf file.  You can control the contents of the logs using the 
LogFormat directive; I use the same format for all of my virtual hosts, but I 
think you can specify a different log format for each host if you desire.

If you're trying to accomplish something else which requires you to handle the 
logging on the Zope side of things, then it seems to me that your idea would 
work, although I'd want to find out how my server performance would be affected...

Hope this is useful for you,

rob


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




[Zope] Second Try: Zope FTP tunneled through SSH1

2000-11-08 Thread Rob Miller

Nobody picked up at all on my first post of this question, so I'm hoping 
I have better luck this time.  Does anyone out there even have any leads 
for me in this situation?  Here's the repost:

I'm trying to tunnel FTP connections to a Zope server through SSH1 to
ensure that passwords don't get sent in the clear.  (I know the session
will still be unencrypted; that's okay for now.)  I've followed the
instructions for doing so that are available at
http://www.employees.org/~satch/ssh/faq/ssh-faq-5.html#ss5.6, and doing
so I can successfully create an FTP session through an SSH tunnel.  The
problem is, once I've logged in, Zope won't let me do anything.  It
responds to every valid command with a single word: 'Unauthorized.'  I 
know I'm connected to the server, because 'cd'ing into a nonexistent 
directory gives me a 'No Such Directory' response, byt 'cd'ing into a 
valid directory gives me th 'Unauthorized' response.  If I connect 
directly to the FTP server using the same login and password,
all works well.

If this can't work, does anyone have Zope FTP server connections being 
tunneled through an encryption layer?  I'd really like my developers to 
be able to use their favorite editor with an FTP connection, but I 
really don't want management-capable passwords flying around in the clear.

Thanks for your time and assistance,

rob


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




[Zope] Zope FTP through SSH1

2000-11-01 Thread Rob Miller

Hi,

I'm trying to tunnel FTP connections to a Zope server through SSH1 to 
ensure that passwords don't get sent in the clear.  (I know the session 
will still be unencrypted; that's okay for now.)  I've followed the 
instructions for doing so that are available at 
http://www.employees.org/~satch/ssh/faq/ssh-faq-5.html#ss5.6, and doing 
so I can successfully create an FTP session through an SSH tunnel.  The 
problem is, once I've logged in, Zope won't let me do anything.  It 
responds to every valid command with a single word: 'Unauthorized.'  If 
I connect directly to the FTP server using the same login and password, 
all works well.

Anyone here have any ideas why this might be?

Thanks for your time and assistance,

rob


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




Re: [Zope] secure management with Site Access?

2000-09-26 Thread Rob Miller


David Elkins writes:

> Have you tried setting up something like zope.domain.com with the https
> SiteRoot and Apache pointing directly at manage?

Pointing a virtual host directly at manage I can do, but where do I put the
SiteRoot?  If I put an https SiteRoot in a directory, then plain ol'
unencrypted access won't be happening... all of the URLs inside the site
will point to 'https://' instead of 'http://', right?  Or am I missing
something?

> You could additional add
> in a rewrite/proxy command to redirect to the SSL side for
> www.domain.com/manage.

Again, getting Apache to do the right thing I've got figured out.  It's
just the SiteRoot causing the problem; all of the links inside the folder
with the SiteRoot will be either 'http' or 'https', but I'm looking for
some solution that will allow either, depending on the previous REQUEST.  I
know that SiteRoot is basically a special kind of access rule, maybe a
smarter access rule can be used instead of a SiteRoot...

Thanks for your feedback, and please let me know if there's something that
I'm not seeing.

rob

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




[Zope] secure management with Site Access?

2000-09-26 Thread Rob Miller


Is anyone using the Apache/mod_proxy/SiteAccess method of using Zope with
the ability to access a given virtual host both with and without SSL
encryption?  If so, can you give me some pointers on how to accomplish
this?  I'd like to use SSL for all of my management activity but have the
main site be available for non-encrypted viewing.  The 'SiteRoot', though,
will only rewrite the URLs with either 'http' or 'https', and isn't smart
enough to do one or the other depending on the form of the original
request.

Is what I want to do even possible, or will I have to resort to using some
sort of PCGI solution to accomplish my goal?

thanks,

rob

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




Re: [Zope] "REQUEST" a string object?

2000-07-25 Thread Rob Miller

On Tue, 25 Jul 2000, Dieter Maurer wrote:
> Rob Miller writes:
>  > 
>  > 
>  > 
>  > 
>  > 
>  > 
> There are "sequence-index" and "sequence-number" variables
> defined by "dtml-in". Thus, you need not count yourself.
> Note: use as "_['sequence-*']" inside "...".

I don't think this works for me though, because I don't want to count all of
the sequence items, just the ones that match a certain criterion. 
Specifically, I'm stepping through all of the files in a directory, but I'm
only displaying (and thus counting) the ones that are themselves directories. 
Is there a way to leverage the "sequence-" variables to help me here?

> 
>  > The error I get, running Zope in debug mode, is this:
>  > 
>  >Error Type: AttributeError
>  >Error Value: 'string' object has no attribute 'set'
> Is is possible that some of your folders has
> a REQUEST property or acquires it?

No, that's not the case.  Nice thought, though.

I've discovered (with Jonothan Farr's help) that the problem doesn't occur in
Zope 2.1.6, only in 2.2.0.  This leads me to think that a) it's a new bug in
2.2.0 I've uncovered or b) there's something different about the way Zope 2.2.0
handles the REQUEST object that I need to understand and account for.

I've discovered (quite by accident) that an attempt to add a Squishdot
installation (Squishdot-0-4-1) into Zope 2.2.0 generates the same error that my
code generates.  There's a note on the Squishdot page that indicates that they
know it doesn't yet work with 2.2.0, and that it will soon be resolved (by
Squishdot-0-4-4, they promise).  There's no indication, though, of whether the
Squishdot author(s) know what the problem is at this point.

I'm considering making a post to Zope-dev describing the problem and asking if
anyone knows whether this is a feature or a bug that I'm bumping into.

rob

(p.s.  I've just had a thought that I might be able to force the
 loop to sort the files by type, which would at least guarantee that
all of the directories would be consecutive.  I could also maybe construct a
new list of just the directories and then iterate over the new list.  Either of
these may allow me to use the "sequence-" values constructively.  I want to
learn what's going on here, though, and I'd rather not have to resort to
complicating my algorithms.  Counting stuff is a basic programming task, it
should be able to be accomplished in a straightforward manner.)

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




Re: [Zope] Your feedback: what should DateTime strftime() behavior be?

2000-07-25 Thread Rob Miller

+1

On Tue, 25 Jul 2000, Brian Lloyd wrote:
> Hi all -
> 
> There has recently been some confusion over the expected 
> behavior of various approaches to DateTime formatting in 
> Zope regarding timezone representation. I would like to 
> resolve this for the next release by making a proposal 
> and asking you to reply to the list with a "vote":
> 
>   +1 == agree
> 
>   +/-0 == no strong opinion
> 
>   -1 == disagree
> 
>  
> So then, here is the situation. In Zope 2.2 (and earlier), 
> formatting a date using either:
> 
>   
> 
>   
> 
> ...would give you the date *formatted based on GMT rather than 
> uthe timezone (usually local) representation of the object*. 
> Simply doing:
> 
>   
> 
> ...however, would print the date in the current timezone of 
> tthe datetime object.
> 
> Many feel that this difference is unintuitive and a pain. The 
> proposal is that both:
> 
>   
> 
>   
> 
> ...would be changed to apply the format to the current TZ 
> rrepresentation of the object rather than convert to GMT. Of 
> course, this could be a problem if there are people currently 
> counting on the output being GMT, which is why we're putting it 
> to a vote. If this change is made for 2.2.1, those who still 
> wanted the output in GMT could just call the 'toZone()' method 
> of the datetime object to get a GMT version before formatting:
> 
>   
> 
> 
> What do you think?
> 
> 
> Brian Lloyd[EMAIL PROTECTED]
> Software Engineer  540.371.6909  
> Digital Creations  http://www.digicool.com 
> 
> 
> 
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] "REQUEST" a string object?

2000-07-24 Thread Rob Miller

On Mon, 24 Jul 2000, Jonothan Farr wrote:
> I couldn't reproduce this. The following code works for me in Zope 2.1.6,
> verbatim.

Ah-ha!  It was on 2.2.0 that this code failed.  And.. sure enough, a quick
check on the Zope 2.1.6 install I still have around shows that the code works
there for me as well.  Thank goodness; I was pulling my hair out trying to
figure out what I was doing wrong, but it seems likely to be a bug in the new
release that was causing my problem.

> 
> 
> 
> 
> 
> 
> 
>   
> 
>   
> 
> 
> 
>   
> 
> 
>   
> 
>  In case we end in the middle of a row... 
> 
>   
> 
> 
> 
> 
> Maybe you can play with this as a starting point.
> 
> I added a couple of REQUEST.set() calls at the top to simulate variables passed
> from a form, I assume.
> 
> 'local' is my LocalFS object. Are you using this code in a  statement
> or are you actually serving it as a .dtml file from the local file system?

It may be academic now, but I'm using it in a .dtml file that is called as a
method by a python product.  Actually, what I'm doing is hacking LocalFS to be
an image gallery, so that all I have to do is drop a bunch of image files in a
certain directory on my hard drive and they'll show up on the www all
thumbnailed and prettified, via the magic of Zope.  The code that you saw is
from my replacement for the 'methodBrowse.dtml' file in the LocalFS product.  I
know that there are some other PhotoAlbum type products out there that do
something similar, but I wanted the exercise.

Thanks for your help... I guess now I report this as a bug.  I've seen some
mention of a "Collector" for this sort of thing; I'll go dig around zope.org
(as soon as it comes back up) to find out what that is and how to use it. 
Unless of course any Zen masters notice this thread and decide to tackle the
problem straightaway... ;-]

rob

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




[Zope] "REQUEST" a string object?

2000-07-23 Thread Rob Miller

Arrggh!  I'm getting very frustrated trying to accomplish something that should
be easy.  I'm stepping through all of the files in a LocalFS directory, and I
want to dynamically create a  that displays all of the sub-directories
of the current directory.  I want to inject a "" every so often, so I
need to count the number of directories I've found so far to see whether I need
to start a new row or not.

I've spent a few hours digging through the list archives, so I know that
creating a manually managed counter variable is not a straightforward affair. 
Here's the code that I have:





  

  



  


  

 In case we end in the middle of a row... 

  




The error I get, running Zope in debug mode, is this:

   Error Type: AttributeError
   Error Value: 'string' object has no attribute 'set'

This is referring to the  line in the middle of the loop, the one
that actually does the incrementing.  It thinks that REQUEST is a string, which
of course doesn't have a "set" attribute.  I've been banging my head on this
all day and can't come up with an way to accomplish this trivial task.  I don't
want to push this into Python; this is simple UI code, not business logic, so
it doesn't belong there.  Besides, it's absurd to think that I would need to
write an external method or some other Python method to do something as simple
as this.  (It may end up being true, but it's still absurd... ;-) )

Any help would be greatly appreciated.

thanks for your time,

rob

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




Re: [Zope] sequence-item and ""

2000-07-18 Thread Rob Miller


Diego Rodrigo Neufert writes:

> Hi ppl...
> 
> Why I cant use dtml-var "sequence-item">??

Because, as I understand it, anything within "" gets treated as Python code
by the DTML interpreter.  Thus "sequence-item" is parsed as an expression:
sequence _minus_ item.  A dash is not a valid variable name character in
Python, but it is in DTML; this is unfortunate.

> 
> Every time I try to access sequence-item under "" in a dtml-call dtml-var or
> anything else I got this error:
> 
> Error Type: NameError
> Error Value: sequence
> 
> Well, I found a solution:
> 
> 
> 
> Now everything is ok... but I dont want to do this, I want to access the
> *&@%$#@& sequence-item in "".

I've searched through the list archives and come to the conclusion that
your solution above is the cleanest way to handle this, for now.  There are
other ways, but they involve ugly-looking permutations of the "_" namespace
variable, and they approach the splendor of Perl in their readability.  The
"right" solution, IMHO, would be to rename the "sequence-..." variables to
a different set of names that doesn't cause the Python interpreter to
choke.  I seem to recall someone saying that this (or something similar)
was being worked on, but, alas, for now  is our best option.

rob

> 
> Can anyone help me?
> 
> -
> Diego Rodrigo Neufert
> -webmaster
> ---
> (Magic Web Design)
> (email) ([EMAIL PROTECTED])
> (curitiba) (pr)
> 
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
> 




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




[Zope] HTMLFile from within a method?

2000-07-13 Thread Rob Miller

Greetings.  I'm a fairly experienced Python programmer, but am new to Zope. 
I'm working on a Python product, and through this process I'm learning my way
around the Zope innards.  I'm running Zope 2.2.0b3 on an RH6.1 box.

By declaring a class member that is an instance of the HTMLFile class, I
can publish dtml files.  This is right out of the "Boring Product" How-To; it
looks like this:

--
class Product(Implicit, Persistent, RoleManager, Folder):

index_html = HTMLFile('index', globals())
--

Then when I browse to an installed instance of my Product, I'll see the
appropriate output generated by my 'index.dtml' file, which is in the same
directory as my Product's python modules.

What I'm having trouble doing is something similar but from within one of my
Product class's methods.  I've tried this:

--
class Product(Implicit, Persistent, RoleManager, Folder):

def form_handler(self, REQUEST=None):
return HTMLFile('form_results', globals())
--

This causes the output to be munged, like so:



... and so on ...

I've also tried:

--
class Product(Implicit, Persistent, RoleManager, Folder):

form_results = HTMLFile('form_results', globals())

def form_handler(self, REQUEST=None):
return self.form_results()
--

This causes zope to attempt to publish the object, but the object (my DTML
method, stored in "form_results.dtml") doesn't seem to have access to the
Product's namespace.  That is, I get an error like:

Error Type: KeyError
Error Value: standard_html_header

...even though there's definitely a standard_html_header defined.

Finally, I've tried this:

--
class Product(Implicit, Persistent, RoleManager, Folder):

def form_handler(self, REQUEST=None):
dtml = open('lib/python/Products/Product/form_results.dtml', 'r')
s = dtml.read()
dtml.close()
return s
---

This causes the right data to be passed out, but it's not treated
as dtml.  A garbled version of my output appears in the browser window, and if
I view source I see:




... and so on ...

I know there are other ways to accomplish what I'm trying to accomplish, but I
really want to understand what's going on here.  Can anyone enlighten me as to
why I'm seeing the results I'm seeing?  Does anyone have suggestions for an
appropriately Zen approach to publishing dtml files from within a Product's
methods?

Thanks for your time,

rob

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