IRC log of #zope for Wednesday, 2011-11-09

*** shentonfreude has joined #zope00:15
*** shentonfreude has quit IRC00:23
*** eperez has quit IRC00:55
*** avoinea has quit IRC01:02
*** MrTango has quit IRC01:10
*** ccomb has quit IRC01:20
*** ccomb has joined #zope01:26
*** evilbungle has quit IRC01:52
*** TomBlockley has quit IRC01:54
*** evilbungle has joined #zope01:59
*** _mup_ has quit IRC02:00
*** J1m has quit IRC02:00
*** _mup_ has joined #zope02:00
*** supton has quit IRC02:02
*** TomBlockley has joined #zope02:07
*** kiorky has quit IRC02:10
*** kiorky has joined #zope02:11
*** TomBlockley has quit IRC02:43
*** alecm has quit IRC02:43
*** alecm has joined #zope02:43
*** alecm has joined #zope02:43
*** TomBlockley has joined #zope02:44
*** AnneGilles has quit IRC02:50
*** TomBlockley has quit IRC02:52
*** runyaga has quit IRC02:53
*** TomBlockley has joined #zope03:04
*** daMaestro has quit IRC03:07
*** J1m has joined #zope03:18
*** TomBlockley has quit IRC03:20
*** kiorky has quit IRC03:25
*** kiorky has joined #zope03:26
*** Spanktar has quit IRC03:26
*** alecm has quit IRC03:31
*** evilbungle has quit IRC03:38
*** RichardBarrell has quit IRC03:40
*** supton has joined #zope03:50
*** mcdonc has quit IRC03:50
*** tiwula has quit IRC04:06
*** tiwula has joined #zope04:25
*** mr_jolly has quit IRC04:26
*** J1m has quit IRC04:26
*** mr_jolly has joined #zope04:28
*** mr_jolly has left #zope04:29
*** ccomb has quit IRC05:24
*** Gautam has joined #zope05:44
*** patul has joined #zope05:50
*** Rakshith has joined #zope06:08
*** alexpilz has joined #zope06:16
*** tiwula has quit IRC06:29
*** Dikeshwar has joined #zope07:02
*** dayne has joined #zope07:16
*** Sada has joined #zope07:18
*** dayne has quit IRC07:54
*** shentonfreude has joined #zope08:34
*** agroszer has joined #zope09:00
*** mr_jolly has joined #zope09:04
*** __mac__ has joined #zope09:13
*** zagy has joined #zope09:16
*** __mac__1 has joined #zope09:18
*** __mac__ has quit IRC09:20
*** MooCalifornia is now known as MooInteratlantic09:29
*** goschtl has joined #zope09:32
*** yvl has joined #zope09:35
*** mr_jolly has quit IRC09:38
*** mr_jolly has joined #zope09:41
*** AnneGilles has joined #zope09:50
*** MrWu has joined #zope10:15
*** MrWu has quit IRC10:17
*** MrWu has joined #zope10:18
*** AnneGilles has quit IRC10:37
*** goschtl has quit IRC10:51
*** sunew has joined #zope10:51
*** MrTango has joined #zope10:54
*** Sada has quit IRC10:55
*** eperez has joined #zope11:21
*** menesis has joined #zope11:23
*** goschtl has joined #zope11:26
*** menesis has quit IRC11:27
*** menesis has joined #zope11:31
*** goschtl has quit IRC11:36
*** goschtl has joined #zope11:36
*** menesis has quit IRC11:40
*** menesis has joined #zope11:41
*** menesis1 has joined #zope11:45
*** menesis has quit IRC11:45
*** menesis1 is now known as menesis11:46
*** Sada has joined #zope11:48
*** __mac__1 has quit IRC11:51
*** __mac__ has joined #zope11:52
*** MrTango has quit IRC11:56
*** J1m has joined #zope11:58
*** zagy1 has joined #zope12:08
*** zagy has quit IRC12:10
*** MrTango has joined #zope12:10
*** MrTango has quit IRC12:17
*** zagy1 has quit IRC12:28
*** zagy has joined #zope12:28
*** MrTango has joined #zope12:31
*** do3cc has joined #zope12:39
*** teix has joined #zope12:43
*** MrTango has quit IRC12:47
*** batlock666 has joined #zope12:48
*** goschtl has quit IRC13:00
*** goschtl has joined #zope13:01
*** ccomb has joined #zope13:08
*** teix has quit IRC13:13
*** mitchell`off is now known as mitchell`13:30
*** teix has joined #zope13:34
*** goschtl_ has joined #zope14:00
*** goschtl has quit IRC14:01
*** goschtl_ is now known as goschtl14:01
*** mr_jolly has joined #zope14:02
*** MrWu has quit IRC14:04
*** AnneGilles has joined #zope14:08
*** dayne has joined #zope14:15
*** MrWu has joined #zope14:26
*** alexpilz1 has joined #zope14:27
*** alexpilz has quit IRC14:29
*** J1m has quit IRC14:31
*** goschtl has quit IRC14:34
*** goschtl has joined #zope14:35
*** goschtl has quit IRC14:47
*** goschtl has joined #zope14:53
*** MrWu has quit IRC14:54
*** shentonfreude has quit IRC15:00
*** benji has joined #zope15:00
*** ccomb has quit IRC15:07
*** bloodbare has joined #zope15:44
bloodbarehey guys , does anybody know why on a mod-wsgi3.3 py2.6 zope 2.13.8 I get this error on startup : http://pastie.org/283624115:45
bloodbarea  NameError: global name 'setNumberOfThreads' is not defined15:45
mitchell`Somehow setNumberOfThreads is being called twice and while it deletes the reference to itself from ZServer.PubCore, it doesn't delete the reference used by Zope2.Startup which is imported from the ZServer root package.15:46
koshis there a newer version of zope you can try? wsgi support is extremely new15:53
bloodbarekosh: I'm using plone on top of it .. so is quite risky15:54
koshthen I would just not use wsgi15:54
*** goschtl_ has joined #zope15:55
bloodbarekosh: I know is a … $$ question for a ONG15:55
bloodbareNGO15:56
*** patul has quit IRC15:56
koshhuh?15:56
*** ccomb has joined #zope15:56
koshhow would wsgi save money?15:56
bloodbarekosh: the NGO has a service provider for ngo's that offers php/wsgi at one price and VPS another price15:57
*** goschtl has quit IRC15:57
*** goschtl_ is now known as goschtl15:57
koshah interesting15:57
bloodbarekosh: 3 times more expensive vps than wsgi .. I also don't understand but they asked me to help them to move their plone there15:58
bloodbarekosh: if it's possible15:58
*** ajkaanbal has joined #zope15:58
koshthere are some wsgi fixes in versions of zope higher then 2.13.8 so I would setup a test server with 2.13.10 and see if it works15:59
*** J1m has joined #zope15:59
bloodbarethanks kosh, I'll try :)15:59
mitchell`bloodbare: if you see MatthewWilkes about, collar him: he's been doing a lot of work on Zope & WSGI at the moment16:00
bloodbareok , thanks mitchell`16:01
bloodbaremitchell`: I installed 3 years ago a big self-service plone on top of zope 2.10 with wsgi suport and worked well16:02
bloodbaremitchell`: so I supposed that on 2.12 everything would go more fluent16:02
*** Gautam has quit IRC16:03
*** AnneGilles has quit IRC16:05
*** m8 has joined #zope16:10
*** dayne has quit IRC16:30
*** Arfrever has joined #zope16:42
*** Dikeshwar has quit IRC16:47
*** fredvd has joined #zope16:48
*** Rakshith has quit IRC17:20
*** Sada has quit IRC17:21
*** supton has quit IRC17:30
*** J1m has quit IRC17:42
*** J1m has joined #zope17:43
*** ajkaanbal has quit IRC17:45
*** ajkaanbal has joined #zope17:45
*** runyaga has joined #zope18:00
*** runyaga has quit IRC18:00
*** runyaga has joined #zope18:00
*** goschtl has quit IRC18:18
*** AnneGilles has joined #zope18:21
*** sunew has quit IRC18:23
*** runyaga_ has joined #zope18:24
*** batlock666 has quit IRC18:24
*** runyaga has quit IRC18:26
*** AnneGilles has quit IRC18:27
*** __mac__ has quit IRC18:33
*** tiwula has joined #zope18:33
*** supton has joined #zope18:40
*** TomBlockley has joined #zope18:45
*** fredvd has quit IRC18:51
*** agroszer has quit IRC19:00
*** ccomb has quit IRC19:21
*** Spanktar has joined #zope19:22
*** TomBlockley has quit IRC19:29
*** DreadPirateBob has joined #zope19:34
DreadPirateBobI've got a zope 2.10 instance that moved datacenters, but it has some psycopg connections that point to the old IP addresses.  Now I can't do anything through the manage interface as (every?) page load tries to connect to that IP until it times out.19:35
DreadPirateBobAny way to fix this?19:35
betabugis this because it tries to find your user in the SQL db?19:36
DreadPirateBobpossibly19:36
DreadPirateBobBut it let me log in and show the manage home page easily enough, I just can't get down into the www/site dir19:36
suptonDreadPirateBob: get your hands dirty with ./bin/instance debug, change the ZPsycopgDA settings programmatically, then commit a transaction.19:37
mitchell`^^19:37
DreadPirateBobsupton, mitchell`any recommended reading on the subject?19:43
DreadPirateBobI've got a debug prompt, but I don't really know where to go from here.19:44
suptonDreadPirateBob: let's first assume you know where your ZPsycopgDA instance is located (path, I mean)?19:45
DreadPirateBobI have /www/site/psycopg/ and /www/site/psycopg_newsletter are my two ZPsycopgDA objects19:45
suptonDreadPirateBob: and /www/site is a folder relative to the root app object.19:45
*** AnneGilles has joined #zope19:46
DreadPirateBobright19:46
suptonDreadPirateBob: >>> site = app.unrestrictedTraverse('/www/site')19:46
suptonDreadPirateBob: >>> da1 = site['psycopg']19:46
suptonDreadPirateBob: >>> da1.__dict__ # let's see what's being stored19:47
suptonDreadPirateBob: find the attribute name that is storing your hostname/IP19:47
DreadPirateBobempty.  :(19:47
suptonDreadPirateBob: what do you mean empty?19:47
suptonwhat is empty?19:47
DreadPirateBob__dict__ is {}19:47
DreadPirateBobis it supposed to be site hasattr psycopg19:48
DreadPirateBoberr, site hasattr psycopg19:48
DreadPirateBobrepr da1 hangs19:48
suptonDreadPirateBob: time for you to look at source code for ZPsycopgDA and figure out how/where it stores the IP or hostname19:48
suptonto perform brain surgery, please first consult our lovely image of the brain, courtesy of our friends in the radiology department  ;)19:50
*** TomBlockley has joined #zope19:50
mitchell`DreadPirateBob: try http://pastie.org/283735719:50
mitchell`replacing the new connection string as necessary, natch.19:53
DreadPirateBobI ran zopectl debug then started pasting your script19:54
DreadPirateBobI get an import error (no module named hooks) on zope.component.hooks import setSite19:54
mitchell`ah, just ignore that bit then19:56
mitchell`it's for Plone 4+19:56
mitchell`sorry, Zope 2.11+19:56
mitchell`I think19:56
DreadPirateBobI'm getting an attribute error NoneType object has no attribute __of__19:57
DreadPirateBobon the login call19:57
suptonDreadPirateBob: that means you likely have a different username than mitchell`'s script assumes20:00
*** daMaestro has joined #zope20:00
*** daMaestro has joined #zope20:00
* DreadPirateBob hates being such a n00b20:01
suptonDreadPirateBob: adjust accordingly... that login() gets a user object, but it has to be wrapped in an acquisition context (thus __of__).  you cannot wrap None this way, and you get None because getUserId('this_id_not_here') returns None20:01
suptonDreadPirateBob: no worries, we are here to help...20:01
mitchell`:)20:02
suptonmeet half-way with a few adjustments to the examples, and you will likely find what you need20:02
DreadPirateBobUgh, the print da1.connection_string is hanging20:02
*** s34n_ has joined #zope20:02
*** sdeng has joined #zope20:02
DreadPirateBobI used the site = app.unrestrictedTraverse supton pasted above20:02
suptonDreadPirateBob: >>> print type(da1)20:03
s34n_I just got handed a harddrive for an ols zope server.20:03
suptonDreadPirateBob: >>> from Acquisition import aq_base20:03
mitchell`ah - DreadPirateBob the username you replaced it with - is it a user retrieved from SQL?20:03
suptonDreadPirateBob: >>> real_da1 = aq_base(da1)20:03
s34n_the server is now dead and I'm supposed to revive the data from the harddrive20:03
s34n_it is zope 2 circa 200620:04
mitchell`s34n_: Data.fs should copy fairly well, just so long as you build out the same code.20:04
suptonDreadPirateBob: >>> print real_da1.__dict__20:04
suptons34n_: define old?20:04
* mitchell` lets supton take it from here. Home time.20:04
*** mitchell` is now known as mitchell`off20:04
s34n_supton: zope 2 circa 200620:04
suptonwow, #zope is usually such a ghost town20:04
suptons34n_: >= 2.7?20:05
s34n_2.920:05
mitchell`offsupton: https://dndg.it/cgi-bin/gitweb.cgi?p=public/psycopg2.git;a=blob;f=ZPsycopgDA/DA.py;h=f515437114090760a21ef7656e934626e7661408;hb=HEAD may be some use.20:05
s34n_I don't want to attempt to build another zope 2 server20:06
suptons34n_: just make sure you have all the same products in your products dir, and all the add-ons that were installed (for any persistent class references) previously need to be installed in your same zope instance20:06
*** AnneGilles has quit IRC20:06
s34n_but what are my options for extractive html. etc to revive the static content?20:06
DreadPirateBobsupton, real_da1.__dict__ is the empty dict20:07
suptons34n_: download the version of zope you need, then check for hotfixes for that version to apply (security), then download all add-ons you need (same versions!), then try migrating your Data.fs20:07
s34n_I have no idea what Products were on the old server20:07
s34n_how can I know?20:07
DreadPirateBobthey're in the Products folder of your instance home20:07
DreadPirateBobclose to where you found Data.fs20:08
suptonDreadPirateBob: >>> print type(da1)20:08
DreadPirateBob<type 'ImplicitAcquirerWrapper'>20:08
*** eperez has quit IRC20:08
suptons34n_: look in zope.conf for instance.... find references to all product folders in zope.conf, then look in those dirs for an installed add-on products.20:08
DreadPirateBobreal_da1 is <class 'Products.ZPsycopgDA.DA.Connection'>20:08
suptonDreadPirateBob: >>> print hasattr(real_da1, 'connection_string')20:09
s34n_I see ZMySQLDA v1.420:09
*** goschtl has joined #zope20:10
suptonDreadPirateBob: your best bet may be to use the login() method pasted in the example, then try using da1.manage_edit(title='Some title here', connection_string='my psycogpg connection string here')20:11
suptonDreadPirateBob: manage_edit() will only work after calling newSecurityManager() (permission checking)20:11
s34n_is there a way to dump the "file system" into a real filesystem?20:11
suptonDreadPirateBob: then you check that da1.connection_string is non-empty... hopefully, then you commit transaction once edited20:12
suptons34n_: what do you mean?  What is your intent with the content in the ZODB?20:12
suptons34n_: that very much depends on what is stored20:13
s34n_I want to dissect the content of the site and move it into something more current20:13
s34n_I don't want to rebuild a working zope2 server in order to do it20:14
s34n_I'd rather build a current version of zope or grok or whatever and move it there20:15
s34n_but obviously I need to see the source content20:15
betabugit will be much, much more difficult with going directly to a current zope version20:16
betabugbasically on that road, the first stop would be to get the original version of zope up and running20:16
s34n_I doubt the site was very complicated20:16
betabugand as for grok, I guess it's out of the question without intricate knowledge of the old products20:16
betabugdid the old site use products or was it developed TTW (e.g. with DTML)?20:17
s34n_I don't think there were old products, except for ZMySQLDA20:17
s34n_I don't know what TTW is, but I'm guessing there were only a handful of templated pages20:17
betabugso it *could* be that it was done TTW with "Script (Python)" objects, DTML and ZSql20:18
s34n_yes20:18
betabugTTW == Through The Web20:18
s34n_oh. yes. totally TTW20:18
*** TomBlockley has quit IRC20:18
suptons34n_: if it is just Zope and ZMySQLDA that you  have to deal with, it might work to use a newer Zope version (and a compatible ZMySQLDA), but YMMB20:18
s34n_no real admin or dev on this site20:18
suptonYMMV20:18
betabugand you have the sql db that came with it?20:18
s34n_yes20:19
betabugwell, yeah, maybe do what supton said20:19
betabugbut personally I'd invest an hour more to build the "old version" site first20:19
betabug(but that's given that I know that old stuff)20:19
suptonbetabug: and I think that with newer Zope, being egg-based, things like Products.ZSQLMethods are spun off into peripheral products instead of the core, IIRC... can't remember compelete20:19
suptons34n_: ^^20:20
s34n_I did a repozo20:20
betabugyeah, there might be dependencies that will have to be hunted down20:20
suptons34n_: ditto do betabug's suggestion of investing a small amount of time to restore the old version20:20
betabugdunno, do they still have dtml in 2.13?20:20
s34n_ok20:21
betabugs34n_: a repozo backup gets you the ZODB, you have the sql too?20:21
suptonbetabug: dunno, I'll look in my omeletee20:21
s34n_So repozo have me 2 files, a data file and an fs file20:21
suptonbetabug: looks like App/dtml is part of the Zope2 distribution20:22
betabugand you will need to get the Data.fs out of the repozo files again - probably best done with the same version of repozo that made the backup20:22
suptonbetabug: gotta have dtml for ZMI anyway20:22
betabugsupton: ok, so they didn't yet throw it out :-)20:22
DreadPirateBobsupton, mitchell`off I think I got it.  Now I need to figure out what else is causing it to hang20:23
suptonDreadPirateBob: good luck20:23
s34n_so grab the 2 files from repoze, plus Data.fs for good measure, and the mysql db20:38
s34n_and move those to a new zope 2 instance20:38
*** do3cc has quit IRC20:42
*** eperez has joined #zope21:09
DreadPirateBobYay!21:11
DreadPirateBobI'm back!21:11
*** menesis has quit IRC21:11
DreadPirateBobOk, scripting question; I've got a zope site that has a bunch of pages that may have fully qualified URL links.  Any way to quickly replace them with full path URLs?21:12
*** menesis has joined #zope21:13
suptonDreadPirateBob: for content in ZODB recursively walk all folders and items (OFS API) and check each object one-by-one; you must know the attribute name containing the content for each type of item you are storing.  For content in relational database, if any, I have no idea.21:21
betabugDreadPirateBob: in what form are they? inside text attributes on some objects?21:21
suptonDreadPirateBob: not likely a "quick" way21:21
suptonDreadPirateBob: more likely than not, this can be trivially scripted, but by that I mean that you could write 40-50 lines of Python code to do this.21:21
betabugwell, if it's inside sql, you can dump it, edit it with text tools and reimport it21:21
suptonbetabug, DreadPirateBob: and you could always try dumping out whatever you have in ZODb via WebDAV to files to do mass-search-replace on (might work for dtml and page templates, never tried this).21:22
betabugmight work21:23
suptonZODB --(DAV)--> bunch of files --(sed)--> bunch of corrected text files --(DAV upload)--> ZODB21:23
betabugassuming they are the right kind of objects and they are well behaved21:24
betabugif they were abused (e.g. storing stuff in properties on them) things might go wrong21:24
suptonDreadPirateBob: or set up your old site, and use funnelweb or similar to get what you need by scraping your site. ;)21:24
DreadPirateBobThis site is never destined for production use again, so I'm just going to fix up the main site template and let the client set up a hosts file if it gets too messy to keep rewriting the URL.21:25
*** teix has quit IRC22:11
*** s34n_ is now known as s34n22:16
*** Spanktar has quit IRC22:42
*** goschtl has quit IRC23:00
*** goschtl has joined #zope23:09
*** daMaestro has quit IRC23:11
*** daMaestro has joined #zope23:12
*** goschtl has quit IRC23:56

Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!