Re: [Zope] Weird "undefined symbol: PyUnicodeUCS{2|4}_AsEncodedString" errors

2009-02-18 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Marco Bizzarri wrote:
> On Wed, Feb 18, 2009 at 12:00 PM, Chris Withers  
> wrote:
>> Chris Withers wrote:
>>> ImportError: /usr/lib/zope2.9/lib/python/persistent/cPersistence.so:
>>> undefined symbol: PyUnicodeUCS4_AsEncodedString
>>> ImportError: /opt/Zope-2.9/lib/python/persistent/cPersistence.so:
>>> undefined symbol: PyUnicodeUCS2_AsEncodedString
>> Having had a bit of a google, I found this post from Andreas:
>>
>> http://mail.zope.org/pipermail/zope3-users/2006-June/003791.html
>>
>> So it seems that "python2.4" resolves to one python when cron is running
>> and another when run from a shell of the same user.
>>
>> Has anyone seen this behaviour before or know what could cause it?
>>
>> cheers,
>>
>> Chris
>>
>> PS: I've solved this for now by changing python2.4 to
>> /usr/local/bin/python2.4 in the control scripts, which seems to have
>> done the trick.
>>
>> --
>> Simplistix - Content Management, Zope & Python Consulting
>>- http://www.simplistix.co.uk
> 
> Is it possible that you've something in your .bash_profile or .bashrc
> which manipulates the PATH environment variable?
> 
> The behaviour could be explained because cron could define and execute
> your script using /bin/sh as the shell. Even though that one is a sym
> or an hard link to /bin/bash, bash could behave like sh and not
> reading the .bashrc or .bash_profile scripts before starting.

Yup.  In fact, this is why battle-scarred sysadmins always use
fully-qualified paths in scripts meant to be run from cron, as well as
in the crontab itself.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJnEgV+gerLs4ltQ4RAl51AJ9isWVwl7Km7R4gGCVCBQ8Nc8SwRwCgvRXm
1BfLu4pi2wsvE3Bw869KN3M=
=wker
-END PGP SIGNATURE-

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


Re: [Zope] Weird "undefined symbol: PyUnicodeUCS{2|4}_AsEncodedString" errors

2009-02-18 Thread Marco Bizzarri
On Wed, Feb 18, 2009 at 12:00 PM, Chris Withers  wrote:
> Chris Withers wrote:
>> ImportError: /usr/lib/zope2.9/lib/python/persistent/cPersistence.so:
>> undefined symbol: PyUnicodeUCS4_AsEncodedString
>
>> ImportError: /opt/Zope-2.9/lib/python/persistent/cPersistence.so:
>> undefined symbol: PyUnicodeUCS2_AsEncodedString
>
> Having had a bit of a google, I found this post from Andreas:
>
> http://mail.zope.org/pipermail/zope3-users/2006-June/003791.html
>
> So it seems that "python2.4" resolves to one python when cron is running
> and another when run from a shell of the same user.
>
> Has anyone seen this behaviour before or know what could cause it?
>
> cheers,
>
> Chris
>
> PS: I've solved this for now by changing python2.4 to
> /usr/local/bin/python2.4 in the control scripts, which seems to have
> done the trick.
>
> --
> Simplistix - Content Management, Zope & Python Consulting
>- http://www.simplistix.co.uk

Is it possible that you've something in your .bash_profile or .bashrc
which manipulates the PATH environment variable?

The behaviour could be explained because cron could define and execute
your script using /bin/sh as the shell. Even though that one is a sym
or an hard link to /bin/bash, bash could behave like sh and not
reading the .bashrc or .bash_profile scripts before starting.

Hope this help

Regards
Marco


-- 
Marco Bizzarri
http://notenotturne.blogspot.com/
http://iliveinpisa.blogspot.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] Weird "undefined symbol: PyUnicodeUCS{2|4}_AsEncodedString" errors

2009-02-18 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 18.02.2009 12:00 Uhr, Chris Withers wrote:
> Chris Withers wrote:
>> ImportError: /usr/lib/zope2.9/lib/python/persistent/cPersistence.so: 
>> undefined symbol: PyUnicodeUCS4_AsEncodedString
> 
>> ImportError: /opt/Zope-2.9/lib/python/persistent/cPersistence.so: 
>> undefined symbol: PyUnicodeUCS2_AsEncodedString
> 

You are running your Zope with a different Python version as used for
installing Zope or your mixing up somehow PYTHONPATHs or your installed
modules.

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkmb6qcACgkQCJIWIbr9KYz93wCfd/xvitZqZQUDKkTJkkWj0Rgf
xywAni+17U9ZE3nOT0dyGQ+pIos8dIqK
=RuDP
-END PGP SIGNATURE-
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:i...@zopyx.com
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard

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


Re: [Zope] Weird "undefined symbol: PyUnicodeUCS{2|4}_AsEncodedString" errors

2009-02-18 Thread Chris Withers
Chris Withers wrote:
> ImportError: /usr/lib/zope2.9/lib/python/persistent/cPersistence.so: 
> undefined symbol: PyUnicodeUCS4_AsEncodedString

> ImportError: /opt/Zope-2.9/lib/python/persistent/cPersistence.so: 
> undefined symbol: PyUnicodeUCS2_AsEncodedString

Having had a bit of a google, I found this post from Andreas:

http://mail.zope.org/pipermail/zope3-users/2006-June/003791.html

So it seems that "python2.4" resolves to one python when cron is running 
and another when run from a shell of the same user.

Has anyone seen this behaviour before or know what could cause it?

cheers,

Chris

PS: I've solved this for now by changing python2.4 to 
/usr/local/bin/python2.4 in the control scripts, which seems to have 
done the trick.

-- 
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] Weird "undefined symbol: PyUnicodeUCS{2|4}_AsEncodedString" errors

2009-02-18 Thread Janko Hauser
You probably have two different versions of Python installed. And  
probably this is a 64-bit system at least in parts.


Check the python path cron uses and compare to the path the instance  
is run with.


HTH,

__Janko

Am 18.02.2009 um 11:37 schrieb Chris Withers:


Hi All,

I wonder if anyone has seen errors like these before...

Scenario is as follows, two Zope instances and a zeo server all  
running

from the debian zope2.9 packages. All the control scripts for these
instances fail with the following error when used:

Traceback (most recent call last):
  File "/usr/lib/zope2.9/lib/python/Zope2/Startup/zopectl.py", line
322, in ?
main()
...
  File "/usr/lib/zope2.9/lib/python/persistent/__init__.py", line  
19, in ?
from cPersistence import Persistent, GHOST, UPTODATE, CHANGED,  
STICKY

ImportError: /usr/lib/zope2.9/lib/python/persistent/cPersistence.so:
undefined symbol: PyUnicodeUCS4_AsEncodedString

However, when run as a cron job as follows:

@daily /var/lib/zope2.9/instance/x/bin/zopectl run
/var/lib/zope2.9/instance/x/Products/Stepper/run.py -q / jobs

...the control scripts behave properly and the stepper jobs get run.

To solve the problem, I built python from source and installed the
latest Zope 2.9 from source.

Now, all the instances behave fine, except the above cron job now  
fails

with the following:

Traceback (most recent call last):
  File "/opt/Zope-2.9/lib/python/Zope2/Startup/zopectl.py", line  
334, in ?

exitstatus = main()
...
File "/opt/Zope-2.9/lib/python/persistent/__init__.py", line 19, in ?
from cPersistence import Persistent, GHOST, UPTODATE, CHANGED,  
STICKY

ImportError: /opt/Zope-2.9/lib/python/persistent/cPersistence.so:
undefined symbol: PyUnicodeUCS2_AsEncodedString

So, the problem seems inverted now and the error is about UCS2 rather
than UCS4.

Anyone ever seen anything like this? What is that symbol and why would
it be there when run from a shell and not there when run from cron?

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 )




PGP.sig
Description: Signierter Teil der Nachricht
___
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 )