[Zope] Data.fs Recovery

2008-04-14 Thread Godwin Vaz

Apologies if this is not the right forum

I have a corrupt Data.fs file and would appreciate some help recovering
data.

Zope 2.4 (still in the Stone Age)
OS: Windows 2003 server
Runs as service

The problem was first noticed yesterday on trying to save a web page
after making changes. Received the following error message.
IOError: (0, 'Error')

I tried the following

Restating the Zope service with the following results
- Starts and stops immediately

Start the Zope service using "start.bat" get the following

D:\civil>start.bat
--
2008-04-14T23:20:34 PROBLEM(100) Init Ambiguous name for method of
Products.Pyth
onMethod.PythonMethod.PythonMethod: "manage" != "manage_main"
--
2008-04-14T23:20:35 PROBLEM(100) Init Ambiguous name for method of
Products.ZDat
aQueryKit.ZVisualODBCClient.ZVisualODBCClient: "manage_propertiesForm"
!= "manag
e_main"
--
2008-04-14T23:20:35 PROBLEM(100) Init Ambiguous name for method of
Products.ZDat
aQueryKit.ZVisualODBCClient.ZVisualODBCClient: "manage_propertiesForm"
!= "manag
e_main"
--
2008-04-14T23:20:35 PANIC(300) z2 Startup exception
Traceback (innermost last):
 File D:\civil\z2.py, line 564, in ?
 File , line 1, in ?
 File D:\civil\lib\python\Zope\__init__.py, line 110, in ?
 File D:\civil\lib\python\ZODB\FileStorage.py, line 311, in __init__
   (Object: D:\civil\var\Data.fs)
 File D:\civil\lib\python\ZODB\FileStorage.py, line 1747, in read_index
IOError: (0, 'Error')

Running tranalyzer.py and at some stage I get the following

31166 91405999210488
Traceback (most recent call last):
 File "lib/python/ZODB/tranalyzer.py", line 333, in ?
   main(sys.argv)
 File "lib/python/ZODB/tranalyzer.py", line 325, in main
   t = Transaction(f, off, refs)
 File "lib/python/ZODB/tranalyzer.py", line 170, in __init__
   self.obs.append(Record(f, refs))
 File "lib/python/ZODB/tranalyzer.py", line 214, in __init__
   data = f.c(dl - 8)
 File "lib/python/ZODB/tranalyzer.py", line 105, in c
   self.checkleft(n)
 File "lib/python/ZODB/tranalyzer.py", line 87, in checkleft
   raise 'Not enough data left, %d < %d' % (self.left, n)
Not enough data left, 31166 < 91405999210488

Running fsrecover.py get the following

D:\civil>bin\python lib/python/ZODB/fsrecover.py var/Data.fs
Traceback (most recent call last):
 File "lib/python/ZODB/fsrecover.py", line 94, in ?
   FileStorage.recover(sys.argv[1])
 File "D:\civil\lib\python\ZODB\FileStorage.py", line 1721, in recover
   pos, oid, tid = read_index(
 File "D:\civil\lib\python\ZODB\FileStorage.py", line 1747, in read_index
   file_size=file.tell()
IOError: (0, 'Error')

D:\civil>bin\python lib/python/ZODB/fsrecover.py
Traceback (most recent call last):
 File "lib/python/ZODB/fsrecover.py", line 94, in ?
   FileStorage.recover(sys.argv[1])
IndexError: list index out of range


Please help!!

Thanks
Godwin

___
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] type checking

2008-04-14 Thread Jonathan


- Original Message - 
From: "Jaroslav Lukesh" <[EMAIL PROTECTED]>

To: "Garry Saddington" <[EMAIL PROTECTED]>; 
Sent: Monday, April 14, 2008 4:48 PM
Subject: Re: [Zope] type checking





   Variable is integer

   Variable is not integer


   Variable is not number



The 'same_type' function  may be what you are looking for:


 a is a list

 a is a dict





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] Upgrade to 2.7.2 results in all content unavailable - SOLUTION!

2008-04-14 Thread Thomas Bennett
So was this RHEL machine customized to update ZOPE with YUM or Up2date or is 
this a default.  I have been using Fedora and CentOS (both built from redhat 
dist.) for some time now and haven't seen this issue.  This would be nice to 
know seeing that I am currently moving all my linux servers to RHEL5.

Thanks

Thomas


On Monday 14 April 2008 14:25, Wes Modes wrote:
> Thanks everyone for the help.  It was a combination of useful
> suggestions, blind optimism, tenacious persistence, and fervent desire
> to keep my job that eventually solved the problem.
>
> It was neither super simple, not really complex.  The list of things I
> tried spans 6 pages in my notebook, so I won't bore you with that.  But
> I will give you a quickie summary.
>
> The Problem:  A previous sysadmin had built both zope and python from
> source.  As is often the case, things end up in non-standard locations
> (or the standard locations change over time).  So with the monthly
> system software updates, the installer (Red Hat EL 4's up2date program,
> based on yum) gave me new versions of zope and python.  I apparently
> went from Zope 2.7.2 to Zope 2.10.5 and from Python 2.3.X to Python
> 2.5.2.  I had no intention of updating either package, but neither was
> in the up2date exceptions file.
>
> After the update, zope was still running but wasn't serving any
> content.  Even the ZMI and the Congratulations page were unavailable.  I
> could see that the data storage had not been lost, but nor had it been
> touched since the update.  I tried all sorts of things to get everything
> working again, but it looked like my best bet would be to install the
> latest versions of Zoep and Python and then import the old data.  So
> that's the path I took.
>
> The Solution:  I rebuilt both zope and python to the most current stable
> versions.  In attempting to make the new packages work together, I noted
> that the old versions of python were installed in /usr/lib and the new
> versions were installed in /usr/local/lib.  So even when I went back to
> a 2.4.X version of python it couldn't find all of the modules that had
> been earlier built for it.  Once I moved some of the needed modules
> over, and rebuilt others, zope at least started working normally.
>
> Then after I moved the old data into place and restarted zope, all of
> the content returned.
>
> Summary:  Be careful when updating python, it may leave all of its
> modules behind.
>
> Wes

-- 

Thomas McMillan Grant Bennett   Appalachian State University
Operations & Systems AnalystP O Box 32026
University Library  Boone, North Carolina 28608
(828) 262 6587

"... using OpenOffice.org, and save them back to disk automatically,
in MS Word format.  They surf the Web, check e-mail, do instant 
messsaging, view YouTube videos, visit their Facebook pages, learn 
touch-typing skills and lots more.  Our public library has been 
offering these Linux public stations for the past three years."
 - Phil Shapiro Linux Journal January 2008

Library Systems Help Desk: https://www.library.appstate.edu/help/

___
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] type checking

2008-04-14 Thread Jaroslav Lukesh

Sorry, syntax error:


---^

___
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] type checking

2008-04-14 Thread Jaroslav Lukesh



   Variable is integer

   Variable is not integer


   Variable is not number



- Original Message - 
From: "Garry Saddington" <[EMAIL PROTECTED]>




Is there any way to do data type checking in dtml-if, for example to check
that a variable is an integer? 


___
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] type checking

2008-04-14 Thread Garry Saddington
Is there any way to do data type checking in dtml-if, for example to check 
that a variable is an integer?
regards
garry
___
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] try clause in external method

2008-04-14 Thread Jonathan


- Original Message - 
From: "Garry Saddington" <[EMAIL PROTECTED]>

To: 
Sent: Monday, April 14, 2008 3:19 PM
Subject: [Zope] try clause in external method


I have the following external method which takes an input .csv file and 
enters
the data into a database by calling a ZSQL method. There may be errors in 
the

input file and so I am trying to catch them and insert each bad row in a
different table. The errors are detected by table constraints on the table
definition and should be reported by the Psycopg connector. However no
correct rows are entered and only the last error row is entered. Can 
anyone

see what I am doing wrong in this script?

def timetabler(self,REQUEST):
 import csv,string
 f=REQUEST.form["TTEXPORT.CSV"]
 from cStringIO import StringIO
 filebody=StringIO(f.read())
 r =
csv.DictReader(filebody("day","periodstart","periodend" 
,"year","teachgroup","teacher" ,"subject" ,"set" ,"room"))

 for row in r:
  try:
 self.insertintoiclasses(**row)
  except:
  self.insertimporterrors(**row)
 dtmlMethodName="manage_import_from_timetabler"
 return self[dtmlMethodName](self,self.REQUEST)


A couple of things...

1) Have bare try/except clauses may cause you grief ;-)

2) When an error is trapped by the 'try' statement the transaction is not 
committed (ie. nothing is written to your db), only the 'except' statement 
is executed.



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 )


[Zope] try clause in external method

2008-04-14 Thread Garry Saddington
I have the following external method which takes an input .csv file and enters 
the data into a database by calling a ZSQL method. There may be errors in the 
input file and so I am trying to catch them and insert each bad row in a 
different table. The errors are detected by table constraints on the table 
definition and should be reported by the Psycopg connector. However no 
correct rows are entered and only the last error row is entered. Can anyone 
see what I am doing wrong in this script?

def timetabler(self,REQUEST):
  import csv,string
  f=REQUEST.form["TTEXPORT.CSV"]
  from cStringIO import StringIO
  filebody=StringIO(f.read())
  r = 
csv.DictReader(filebody("day","periodstart","periodend" 
,"year","teachgroup","teacher" ,"subject" ,"set" ,"room"))
  for row in r:
  try:
  self.insertintoiclasses(**row)
  except:
  self.insertimporterrors(**row)
  dtmlMethodName="manage_import_from_timetabler"
  return self[dtmlMethodName](self,self.REQUEST)

regards
garry
___
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] Upgrade to 2.7.2 results in all content unavailable - SOLUTION!

2008-04-14 Thread Wes Modes
Thanks everyone for the help.  It was a combination of useful 
suggestions, blind optimism, tenacious persistence, and fervent desire 
to keep my job that eventually solved the problem.


It was neither super simple, not really complex.  The list of things I 
tried spans 6 pages in my notebook, so I won't bore you with that.  But 
I will give you a quickie summary.


The Problem:  A previous sysadmin had built both zope and python from 
source.  As is often the case, things end up in non-standard locations 
(or the standard locations change over time).  So with the monthly 
system software updates, the installer (Red Hat EL 4's up2date program, 
based on yum) gave me new versions of zope and python.  I apparently 
went from Zope 2.7.2 to Zope 2.10.5 and from Python 2.3.X to Python 
2.5.2.  I had no intention of updating either package, but neither was 
in the up2date exceptions file.


After the update, zope was still running but wasn't serving any 
content.  Even the ZMI and the Congratulations page were unavailable.  I 
could see that the data storage had not been lost, but nor had it been 
touched since the update.  I tried all sorts of things to get everything 
working again, but it looked like my best bet would be to install the 
latest versions of Zoep and Python and then import the old data.  So 
that's the path I took.


The Solution:  I rebuilt both zope and python to the most current stable 
versions.  In attempting to make the new packages work together, I noted 
that the old versions of python were installed in /usr/lib and the new 
versions were installed in /usr/local/lib.  So even when I went back to 
a 2.4.X version of python it couldn't find all of the modules that had 
been earlier built for it.  Once I moved some of the needed modules 
over, and rebuilt others, zope at least started working normally. 

Then after I moved the old data into place and restarted zope, all of 
the content returned.


Summary:  Be careful when updating python, it may leave all of its 
modules behind.


Wes

--

Wes Modes
Server Administrator & Programmer Analyst
McHenry Library
Computing & Network Services
Information and Technology Services
459-5208
___
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: [Zope3-Users] Authentication without cookies

2008-04-14 Thread Jonathan


- Original Message - 
From: "Hermann Himmelbauer" <[EMAIL PROTECTED]>

To: "Peter Bengtsson" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, April 14, 2008 1:34 PM
Subject: Re: [Zope3-Users] Authentication without cookies



Am Montag, 14. April 2008 18:55 schrieb Peter Bengtsson:

Slightly off-topic: What mobile browsers that support XHTML don't
support cookies these days? Don't need an accurate answer but I'm
curious about rough numbers.


Well, I have a SonyEricsson K750i which seems not to support cookies. It 
does

have some options for cookies, but they don't work.

And the SonyEricsson K550i does support cookies, but - even worse - 
sometimes

does not send the cookie, which *may* have something to do with the cookie
path and bugs in the mobile browser. In this case, the user loses his
authentication and has to login.

So, if even such recent models have severe cookie-problems, I deduce that
things will be at least the same if not worse in older models. But I can 
only
speak about SonyEricsson models as I had not yet time to test other 
brands.


Moreover, WAP seems not to support cookies by design, at least in another,
incompatible fashion, which I'm unsure how this works.


A little off the zope topic, but...

In order to ensure usability by all of our users (regardless as to device 
type) we do not use cookies on our WAP sites. We embed a session identifier 
in every url.


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 )


[Zope] File objects AttributeError:alt

2008-04-14 Thread Palermo, Tom
I've recently upgraded my Zope version from 2.7.6 to 2.9.8. I've
recently discovered that older File objects are generating an
AttributeError: alt whenever I call manage_changeProperties() on those
File object instances. I'm aware of the change to
lib/python/OFS/Image.py that removed the alt class attr from the File
class. I thought my File objects would have automatically updated too
but, apparently not. I just tried doing the following:

objs = context.ZopeFind(context.this(), obj_metatypes=['File'],
search_sub=1)

for k,v in objs:
  if hasattr('alt',v):
delattr('alt',v)

The above code didn't seem to do anything to fix the issue. Any
suggestions would be greatly appreciated.

Sincerely,

Tom Palermo

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


Re: [Zope] Re: Conditional dtml-boundary in dtml-sendmail

2008-04-14 Thread Chris Withers

Josef Meile wrote:

Well, I guess I will do an external method on my own server and then try
to convince the people owning the machine where the page is hosted to
include it. 


You could do a lot worse that using MailTemplates:

http://www.simplistix.co.uk/software/zope/mailtemplates

It's a stable piece of software that's been around for a few years now 
and will let you do lots of useful mail-related things without having to 
install further code on the server filesystem...


cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
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] Upgrade to 2.7.2 results in all content unavailable

2008-04-14 Thread Dan Fairs

Wes Modes wrote at 2008-4-11 10:44 -0700:

...
File "/usr/lib/zope/lib/python/ZODB/lock_file.py", line 63, in
  __init__
  lock_file(self._fp)
File "/usr/lib/zope/lib/python/ZODB/lock_file.py", line 42, in
  lock_file
  fcntl.flock(file.fileno(), _flags)
  IOError: [Errno 11] Resource temporarily unavailable


This may be the essential hint.

It tells you that the storage file is still used by a different
process. In such a case, the ZODB cannot be opened.

Ensure that no process uses the storage file.






If this was an (ahem) 'unscheduled upgrade', the old Zope process(es)  
may be hanging around using the file. The 'ps', 'lsof' and 'kill'  
commands may help you here.


Cheers,
Dan

--
Dan Fairs <[EMAIL PROTECTED]> | http://www.stereoplex.com/

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

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


Re: [Zope] Re: [Plone-developers] the grand reunion

2008-04-14 Thread Yuri


> I would like to have an easy way to develop without having to be subject 
> to dependencies from other envinroment, minimize the effort to mantain 
> it and focus on doing things  :) 
> 
  


Maybe not exactly what you are asking for but I recommend you play
with buildout a bit - I'm sure you'll appreciate the ease with which
you can manage independent installations in a repeatable and easily
modifiable way.

  
> Is one big zope installation, with multiple instances, well suited for 
> this tasks? Or is better different zope versions? What about the various 
> Data.fs, is better to have them separated by application or by zope 
> envinroment? I mean all the Plone in a single Data.fs or each one in a 
> separated Data.fs?
> 



Without further knowing how these sites might be related or not
this is hard to answer but often times I prefer to have separate
Zope instances (-> different ZODBs) for different Plone sites.
Even if they share substantial configuration/add-ons etc.
Again, using buildout makes it a snap to create and maintain
as many Zope instances as you want. And using a common buildout
cache they can also mostly share the basic installation.

Just my 2 cents,

Raphael

  




hi yuri,

when setting up a zope/zeo task and everything was still a bit of a 
challenge (at least to me) we tended to have everything in one big 
instance that served some 20 low traffic sites.
since then setting up a site with all the tools it needs has become a 
trivially easy and quick to execute task. we have converted nearly all 
these sites to have their own instance.


I would not do it differently anymore ..

robert
  


Thanks to all!

It seems that a separate zope instance for each plone site is the way 
to go. Just a question: is it a problem for performance/bottleneck/big 
python lock?

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