Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Zope and mysql using zmysqlda
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
michal65
n00b
n00b


Joined: 30 Nov 2002
Posts: 58

PostPosted: Wed Dec 01, 2004 3:47 pm    Post subject: [Solved] Zope and mysql using zmysqlda Reply with quote

I have zope set up and working just fine running an instance at /var/lib/zope/red
After I emerged zmysqlda it added it to the Products directory under my instance but when I try to restart the zope instance it doesn't come up anymore. After I try /./etc/init.d/red start it tells me that it's started it even gives me pid and shows up when I do ps -aux, but I cannot connect to the server at http://localhost:8080
Looking at the logs at /var/log/zope/red/ there is no mention of zope starting up, the last startup and shutdown was before I loaded zmysqlda. I would appreciate your help, thanks.
Michal


Last edited by michal65 on Wed Dec 01, 2004 6:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
michal65
n00b
n00b


Joined: 30 Nov 2002
Posts: 58

PostPosted: Wed Dec 01, 2004 6:51 pm    Post subject: Problem solved Reply with quote

I emerged mysql-python and then zmysqlda again and everything worked from that point on.
If you go into python and can't import _mysql, than you need to emerge mysql-python. I already had it but for some reason had to emerge it again. Cool!
Back to top
View user's profile Send private message
dnix
Apprentice
Apprentice


Joined: 17 Jun 2003
Posts: 271
Location: Italy

PostPosted: Wed Nov 30, 2005 11:18 am    Post subject: Reply with quote

hi!
I got the same error, I've emerged mysql-python again and zmysqlda again but... :evil:
Code:

2005-11-30T12:13:06 ERROR(200) Zope Could not import Products.ZMySQLDA
Traceback (most recent call last):
  File "/usr/lib/zope-2.7.8/lib/python/OFS/Application.py", line 673, in import_product
    product=__import__(pname, global_dict, global_dict, silly)
  File "/var/lib/zope/zope-test/Products/ZMySQLDA/__init__.py", line 91, in ?
    import DA
  File "/var/lib/zope/zope-test/Products/ZMySQLDA/DA.py", line 92, in ?
    from db import DB
  File "/var/lib/zope/zope-test/Products/ZMySQLDA/db.py", line 89, in ?
    import _mysql
ImportError: No module named _mysql
Traceback (most recent call last):
  File "/usr/lib/zope-2.7.8/lib/python/Zope/Startup/run.py", line 50, in ?
    run()
  File "/usr/lib/zope-2.7.8/lib/python/Zope/Startup/run.py", line 19, in run
    start_zope(opts.configroot)
  File "/usr/lib/zope-2.7.8/lib/python/Zope/Startup/__init__.py", line 52, in start_zope
    starter.startZope()
  File "/usr/lib/zope-2.7.8/lib/python/Zope/Startup/__init__.py", line 231, in startZope
    Zope.startup()
  File "/usr/lib/zope-2.7.8/lib/python/Zope/__init__.py", line 47, in startup
    _startup()
  File "/usr/lib/zope-2.7.8/lib/python/Zope/App/startup.py", line 45, in startup
    OFS.Application.import_products()
  File "/usr/lib/zope-2.7.8/lib/python/OFS/Application.py", line 650, in import_products
    import_product(product_dir, product_name, raise_exc=debug_mode)
  File "/usr/lib/zope-2.7.8/lib/python/OFS/Application.py", line 673, in import_product
    product=__import__(pname, global_dict, global_dict, silly)
  File "/var/lib/zope/zope-test/Products/ZMySQLDA/__init__.py", line 91, in ?
    import DA
  File "/var/lib/zope/zope-test/Products/ZMySQLDA/DA.py", line 92, in ?
    from db import DB
  File "/var/lib/zope/zope-test/Products/ZMySQLDA/db.py", line 89, in ?
    import _mysql
ImportError: No module named _mysql


any suggestion?
Back to top
View user's profile Send private message
dnix
Apprentice
Apprentice


Joined: 17 Jun 2003
Posts: 271
Location: Italy

PostPosted: Wed Nov 30, 2005 12:00 pm    Post subject: Reply with quote

SUGGESTION:
edit your
Code:

$INSTANCEHONE/bin/zopectl

and
Code:

s/python2.3/python2.4


Everything goes in the right way!
The problem is that Gentoo install modules using python 2.4 but, by default, zope use python 2.3...

cheers,
Denix
Back to top
View user's profile Send private message
vik777
n00b
n00b


Joined: 21 Jan 2005
Posts: 3
Location: Tokyo, Japan

PostPosted: Wed Dec 07, 2005 6:19 am    Post subject: It's deeper than what it looks like.... Reply with quote

dnix wrote:
SUGGESTION:
edit your
Code:

$INSTANCEHONE/bin/zopectl

and
Code:

s/python2.3/python2.4


Everything goes in the right way!
The problem is that Gentoo install modules using python 2.4 but, by default, zope use python 2.3...

cheers,
Denix


Denix,
Your suggestion, while it may work, could be potentially dangerous because the zope ebuild specifically uses python2.3 to compile. You are forcing zope to run with python2.4 when it's not really ready for it. Also, the zope site says:
<quote>
Using Python 2.4.X is not supported and not recommended at this time. Python 2.4.X will be supported when a security audit took place. This means that you are using Python 2.4 + Zope 2.8 at your own risk.
</quote>

So, what to do then...??

The whole python-upgrade-to-2.4 in portage recently has pretty much killed us zope users, because python-updater removes all the site-packages from 2.3, which zope and it's related products depend on. The real issue here is that we don't have a py21 equivalent for python2.3 ebuilds so we can at least handpick the stuff we need for zope/plone.

2 ways to solve the issue:
1) Forget portage for zope realted stuff and install python2.3 packages manually.
ie: download package, untar etc, and do python2.3 setup.py or install.py

2) Contribute to portage and:
a) modify eclass/distutils.eclass to support PYTHON_SLOT_VERSION = 2.3
b) make a bunch of py23 ebuilds to satisfy zope requirements.

2 is probably the best way to do it, but I have no idea where to start, as I haven't contributed to gentoo-dev as of yet...
I guess I can start by posting a bug entry.

Now for some venting.
I read in some other thread that the py21 equivalent for 2.3 packages has been abandoned because it was not worth the trouble for the small amount of people who might benefit from this. I for one is part of this "minority" who uses zope on all the gentoo servers I have deployed, and this is a rather unacceptable decision. Today, I am stranded with pre-2.4 systems and not being able to update my servers. Maybe Gentoo is not the distro to run Zope anymore, but I love this distro.

My suggestion: Zope users, speak up and get our favorite application server to work on our favorite distro again!
Back to top
View user's profile Send private message
dnix
Apprentice
Apprentice


Joined: 17 Jun 2003
Posts: 271
Location: Italy

PostPosted: Wed Dec 07, 2005 10:09 am    Post subject: Reply with quote

I know, obviously this kind of workaround are not intended to be used on a production server.
It is also true that I have never had problems with this and the fact that a security audit has been done on p2.4+z2.8 doesn't mean it is so dangerous... :wink:
Unfortunately I currently don't have the time to write a suggestion ebuild for zope ... there are too many factors and I'm not a real zope expert. :cry:
If you submit a bug, send the link and, if I'm able to write something, I'll post it.

Cheers,
Denix
Back to top
View user's profile Send private message
nyk
Guru
Guru


Joined: 28 Aug 2004
Posts: 527
Location: Bern (Switzerland)

PostPosted: Fri Feb 17, 2006 4:44 pm    Post subject: Reply with quote

This is still not working from portage, even when I modify "$INSTANCEHONE/bin/zopectl" to use python 2.4, zmysqlda doesn't work anyway.

EDIT: Modified also "$INSTANCEHONE/bin/runzope" to python 2.4 and NOW IT WORKS!

EDIT2: Now I changed it back to 2.3 in zopectl and 2.4 in runzope. This way the zmysqlda works and I don't get the DeprecationWarnings (whrandom) on startup anymore! Are some parts of zope now using 2.3 and others 2.4? If yes, then it's certainly a good mix... :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum