Skip to content

Instantly share code, notes, and snippets.

@wboykinm
Created September 20, 2012 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wboykinm/3758381 to your computer and use it in GitHub Desktop.
Save wboykinm/3758381 to your computer and use it in GitHub Desktop.
db irc log
[09:51:31] --> wboykinm (~quassel@132.198.159.96) has joined #districtbuilder
[09:51:32] *** Mode #districtbuilder +nst by wolfe.freenode.net
[09:51:32] * Channel #districtbuilder created on Thu Sep 13 08:52:48 2012
[10:43:57] <wboykinm> zwarg: got a sec for a config Q?
[10:46:36] <zwarg> in a few min, plz hold
[10:48:27] <wboykinm> zwarg: no worries. thanks
[11:03:56] <zwarg> wboykinm: okay, fire away
[11:04:40] <wboykinm> zwarg: so here are my verbose setup.py errors: http://flic.kr/p/dciSpf
[11:04:54] <wboykinm> zwarg: which tells me i'm trying to use too much stuff from the SC template
[11:05:08] <wboykinm> zwarg: what's the absolute bare minimum tag requirement to get it running?
[11:05:32] <wboykinm> zwarg: more specifically, can i leave out all the calculators at first?
[11:05:46] <zwarg> Just to be clear -- is this v2.0-rc?
[11:05:56] <zwarg> Yes, you can leave out all the calculators
[11:06:24] <zwarg> You won't have any scores displayed, but the app will work with zero calculators.
[11:06:25] <wboykinm> zwarg: yah, 2.0
[11:06:28] <zwarg> okay
[11:06:56] <wboykinm> zwarg: I actually don't need scores to start, just total pop and deviation from target
[11:07:16] <wboykinm> although i guess that could be called a score of some kind . . .
[11:07:35] <zwarg> So I can step through the errors. You can refer to the Configuration reference, too:
[11:07:35] <zwarg> https://github.com/PublicMapping/DistrictBuilder/wiki/Configuration
[11:08:36] <zwarg> I suspect you used an old config file, just off the top of my head.
[11:08:47] <wboykinm> zwarg: yeah, adapted from the SC AMI
[11:09:19] <zwarg> Okay: 1) You have an element named LegislativeBody that looks something like: '<LegislativeBody member="District %s" ...>'
[11:09:32] <zwarg> You'll need to rename that 'member' attribute to 'short_label'
[11:09:42] <wboykinm> aha.
[11:10:00] <zwarg> I think you should change it to 'long_label', and set 'short_label' to '%s'
[11:10:08] <zwarg> Both are required
[11:10:28] <zwarg> You also need to add a 'sort_key' attribute to the LegislativeBody element
[11:11:03] <zwarg> Last, 'Targets' has been removed completely in 2.0, and replaced by Calculators. You can delete the whole <Targets> element and children.
[11:11:15] <wboykinm> This is what i currently have:
[11:11:16] <wboykinm> <LegislativeBodies>
[11:11:16] <wboykinm> <!-- A Legislative body has an ID (for referencing in GeoLevel
[11:11:16] <wboykinm> definitions later), a name, and a label for plan items
[11:11:16] <wboykinm> ("District" for Council, etc) -->
[11:11:16] <wboykinm> <LegislativeBody id="council" name="Burlington City Council" short_label="Ward %s" maxdistricts="7"/>
[11:11:16] <wboykinm> </LegislativeBodies>
[11:11:42] <zwarg> So change 'short_label' to "%(district_id)s"
[11:11:56] <wboykinm> zwarg: cool. then on to calculators
[11:12:04] <zwarg> Add 'long_label="Ward %(district_id)s"'
[11:12:16] <zwarg> Add 'sort_key="1"'
[11:12:45] <zwarg> I'm following the example config, which is here: https://raw.github.com/PublicMapping/DistrictBuilder/master/docs/config.dist.xml
[11:15:09] <wboykinm> zwarg: "maxdistricts" still works? https://gist.github.com/3756525
[11:15:20] <wboykinm> aha. i see it.
[11:16:11] <wboykinm> "targets" now commented out.
[11:22:16] <wboykinm> zwarg: Okay, I'm just going to wildly comment things out now: http://flic.kr/p/dcuMNh
[11:24:04] <zwarg> Hold on
[11:24:37] <zwarg> Add 'label="wards"' to the GeoLevel element
[11:24:42] <wboykinm> aha
[11:25:26] <zwarg> Add an element before <Admin>:
[11:26:00] <zwarg> <Internaltionalization timezone="US/Eastern" default="en"><Language code="en" label="English"/></Internationalization>
[11:27:02] <zwarg> Maybe comment out everything *inside* the <Scoring> element
[11:28:05] <zwarg> We haven't tested it with zero scoring, so this will be a new thing.
[11:33:54] <wboykinm> zwarg: whew. lots of internal comments there already. got it.
[11:33:59] <wboykinm> trying setup . . .
[11:34:44] <wboykinm> zwarg: errors -
[11:34:46] <wboykinm> The data XML file could not be parsed.
[11:34:46] <wboykinm> ../../docs/config.xml:380:39:FATAL:PARSER:ERR_TAG_NAME_MISMATCH: Opening and ending tag mismatch: Internaltionalization line 378 and Internationalization
[11:34:46] <wboykinm> Configuration could not be validated.
[11:35:41] <wboykinm> whoops. got it
[11:35:47] <wboykinm> dang typos
[11:36:46] <wboykinm> zwarg: man, now it's all the BARD stuff coming up:
[11:37:15] <wboykinm> https://gist.github.com/3756652
[11:37:34] <wboykinm> commenting . . .
[11:38:58] <wboykinm> zwarg: will this bonk if I comment out everything in "<Validation>"?
[11:40:41] <wboykinm> zwarg: yeah, that answers your earlier question - it doesn't configure without children in <score> or in <validation>
[11:56:08] <zwarg> Okay, so it looks like you should add a really simple score display.
[11:58:21] <zwarg> Try this: <ScoreDisplays><ScoreDisplay id="display1" legislativebodyref="ward" type="sidebar" title="Scores">
[11:58:21] <zwarg> <ScorePanel ref="panel1" /></ScoreDisplay></ScoreDisplays>
[11:59:20] <wboykinm> zwarg: does that need a <scorefunction> as well?
[12:00:04] <zwarg> <ScorePanels><ScorePanel id="panel1" type="plan" position="1" title="Panel 1" cssclass="district_demographics wards" template="demographics.html"><Score ref="score1"/></ScorePanel></ScorePanels>
[12:02:29] <zwarg> <ScoreFunctions><ScoreFunction id="score1" type="district" calculator="publicmapping.redistricting.calculators.Target"><SubjectArgument name="value" ref="poptot"/><Argument name="target" value="10000" /><Argument name="range1" value="0.05"/><Argument name="range2" value="0.1"/></ScoreFunction></ScoreFunctions>
[12:02:31] <PubMapBot> Sorry zwarg, that's not unique, or not recognized as a commit.
[12:02:47] <zwarg> PubMapBot: shh, enough out of you
[12:02:52] <wboykinm> zwarg: conceptually, is there a reason there's a <scorepanel> tag within the <scoredisplays> tag and not within the <scorepanels> tag?
[12:03:06] <wboykinm> zwarg: dude, that bot is talking serious smack.
[12:03:17] <wboykinm> zwarg: he should be glad we're keeping him company.
[12:03:27] <zwarg> Yes -- The ScoreDisplay elements organize a set of score panels together, but it does not define them.
[12:03:35] <wboykinm> right on
[12:03:37] <zwarg> Likewise for panels and functions.
[12:03:54] <zwarg> You define a function in the ScoreFunctions element, then reference them later with ref=""
[12:03:57] <zwarg> etc
[12:05:27] <wboykinm> zwarg: can i change that argument to my target #?
[12:07:25] <zwarg> absolutesy
[12:07:35] <zwarg> er ... absolutely
[12:08:18] <wboykinm> that word is now going into my lexicon . . .
[12:08:43] <wboykinm> zwarg: so the last one here might be a typo, but BARD is still throwing errors: http://flic.kr/p/dcvpFF
[12:11:00] <zwarg> You can safely remove the <BardConfigs> element. That is optional now.
[12:12:05] <zwarg> Make sure the elements are in the correct order -- use https://github.com/PublicMapping/DistrictBuilder/blob/v2.0-rc/docs/config.dist.xml to see the proper order for ScoreFunctions, panels, displays, etc.
[12:12:13] <wboykinm> zwarg: awesome, since i had it pointing to BARD in the GA configuration anyway . . .
[12:12:30] <wboykinm> zwarg: will do, with a recompile on the way.
[12:12:51] <zwarg> You can also probably add an empty criteria element in the Validation: <Validation><Criteria legislativebodyref="ward"/></Validation>
[12:16:57] <wboykinm> zwarg: will do; just running some cleanup.
[12:17:18] <wboykinm> zwarg: are you in the same physical location as Mike Romanx by any chance?
[12:18:07] <zwarg> I don't know of him ... what does he do?
[12:18:48] <wboykinm> GIS with a capital GIS: http://www.azavea.com/about-us/staff-profiles/mike-romankiewicz/
[12:18:58] <wboykinm> I can never spell his last name right :)
[12:19:40] <wboykinm> Looks like he works for the city firectly, but he pointed out DB to me in the first place.
[12:22:58] <wboykinm> zwarg: is it okay to pull out <BardBodyConfigs> as well?
[12:23:01] <zwarg> ah! No, he's in Philly, I'm located in Boston.
[12:23:18] <wboykinm> aha. right on. you guys are everywhere.
[12:23:29] <zwarg> workin' on it. ;)
[12:25:01] <wboykinm> zwarg: a better question; can i remove the whole <reporting> tag?
[12:28:27] <zwarg> I don't know -- never tried. ;)
[12:30:12] <zwarg> brb
[12:36:34] <-- zwarg (~David_Zwa@66.228.68.108) has quit (Ping timeout: 252 seconds)
[12:37:51] --> zwarg (~David_Zwa@66.228.68.108) has joined #districtbuilder
[12:46:50] <wboykinm> zwarg: So the config file is barebones now but I'm still getting these key-sequence errors: https://gist.github.com/3756999
[12:47:58] <wboykinm> zwarg: "citeria" is now "criterion"
[12:48:31] <wboykinm> zwarg: what do you make of lines 3 and 5 in that gist?
[12:49:20] <zwarg> Make sure the ref="" attribute of all elements match the id="" attribute of the referencing items.
[12:49:40] <zwarg> What's the ID of the LegislativeBody element?
[12:49:56] <wboykinm> "council"
[12:50:15] <zwarg> Ah, so change the ref="ward" in my previous examples to ref="council"
[12:51:21] <wboykinm> zwarg: and spell it as "criterion"? does that also need a <criteria> parent?
[12:51:27] <zwarg> Can you post your whole config to a gist?
[12:51:41] <wboykinm> long overdue. sorry.
[12:51:45] <wboykinm> incoming
[12:55:11] <wboykinm> zwarg: https://gist.github.com/3757032
[12:56:04] <zwarg> move <ScorePanels> above <ScoreDisplays> in the <Scoring> element
[12:57:29] <zwarg> Remove <LegislativeBodies> from the <GeoLevel> element
[12:57:59] <wboykinm> zwarg: heeeeeey, that's a short and fixable error:
[12:58:01] <wboykinm> ../../docs/config.xml:26:22:FATAL:PARSER:ERR_TAG_NAME_MISMATCH: Opening and ending tag mismatch: Subjects line 13 and Subject
[12:58:03] <zwarg> Remove <GeoLevelCharacteristics> from the <GeoLevel> element
[12:58:25] <wboykinm> zwarg: altogether?
[12:58:30] <wboykinm> no replacement?
[12:58:59] <zwarg> It's obsolete, so you can remove it completely
[12:59:08] <wboykinm> zwarg: sweet.
[13:00:00] <wboykinm> zwarg: you guys have plenty on your plates with the knight win, but can i (as the public) request a new demo AMI built on 2.0 at some point?
[13:00:02] <zwarg> I think you'll need to add a <Regions> element
[13:00:14] <zwarg> Yes, that's in the cards
[13:01:19] <zwarg> Your region element can be: <Regions><Region id="region1" name="region1" label="Council" description="City Council" sort_key="1">
[13:01:37] <zwarg> <LegislativeBodies><LegislativeBody ref="council"/></LegislativeBodies>
[13:01:55] <zwarg> <GeoLevels><GeoLevel ref="block"/></GeoLevels></Region>
[13:05:34] <wboykinm> zwarg: would that replace lines 58-136 here? https://gist.github.com/3757032
[13:06:01] <wboykinm> zwarg: seems to wipe out the blocks shapefile . . .
[13:06:41] <zwarg> No, do not replace, add that new element.
[13:07:00] <zwarg> Like line 27 here: https://github.com/PublicMapping/DistrictBuilder/blob/v2.0-rc/docs/config.dist.xml
[13:07:18] <zwarg> But you have 1 GeoLevel, and 1 LegislativeBody
[13:07:19] <wboykinm> zwarg: cool. plus a closing </regions> tag i assume
[13:07:23] <zwarg> Yes
[13:08:19] <wboykinm> onward!
[13:10:08] <zwarg> brb
[13:10:16] <-- zwarg (~David_Zwa@66.228.68.108) has quit (Quit: Leaving.)
[13:11:59] --> zwarg (~dzwarg@66.228.68.108) has joined #districtbuilder
[13:12:27] *** Mode #districtbuilder +o zwarg by PubMapBot
[13:13:22] <wboykinm> zwarg: we're back to validation stuff. it keeps tossing me between criteria and criterion, so i think it needs content there.
[13:13:54] <wboykinm> zwarg: is it possible to just get "plan_all_blocks_assigned" running?
[13:15:53] <zwarg> Yes -- you can copy that verbatim from line 420 in the .dist.xml file
[13:15:57] <wboykinm> zwarg: i.e.: https://gist.github.com/3757141
[13:16:31] <zwarg> Make sure you also add that scorefunction to the list
[13:16:36] <zwarg> Then that should work
[13:16:47] <wboykinm> alright. trying it out.
[13:18:22] <wboykinm> my regions must be out of order: https://gist.github.com/3757153
[13:18:26] <wboykinm> checking . . .
[13:19:34] <zwarg> Move <Regions> to right after <LegislativeBodies>
[13:20:30] <zwarg> Change the ref="ward" in the ScoreDisplay to ref="council"
[13:21:08] <wboykinm> looks liike i've got it appearing twice. once at line 5 and once at line 121: https://gist.github.com/3757032
[13:22:16] <zwarg> Remove the element at 121
[13:22:26] <zwarg> Remove the GeoLevelCharacteristics at line 111
[13:24:37] <wboykinm> zwarg: awesome! it ran!
[13:24:52] <wboykinm> zwarg: [until it failed on my DB password, but i'm on that]
[13:25:21] <zwarg> make sure you run with -v2. Also it may help to pipe it to a file (there will be a TON of output)
[13:26:07] <wboykinm> zwarg: I noticed in the install file it mentioned i need to enable password auth on the db.
[13:26:17] <wboykinm> zwarg: where's that file with the keys?
[13:26:45] <zwarg> You should be able to use the same user info from the GA config
[13:26:52] <zwarg> user & password
[13:27:25] <wboykinm> zwarg: i set it to build a new db though.
[13:27:33] <wboykinm> let me look at that .sql script . . .
[13:27:55] <zwarg> If the sql script creates it properly, the 'publicmapping' user should have ownership & access
[13:28:24] <wboykinm> zwarg: lemme check. the java shell just booted me . . .
[13:28:32] <wboykinm> curses upon my windows box.
[13:28:41] <zwarg> Putty is your friend
[13:29:48] <wboykinm> one of these days . . .
[13:36:49] <wboykinm> zwarg: does this look right if i point the config.xml to "publicmapping2"? https://gist.github.com/3757269
[13:37:29] <zwarg> yes, that looks right.
[13:37:39] <wboykinm> cool. i'll run that
[13:37:42] <zwarg> You'll connect as the user 'publicmapping'
[13:40:49] <wboykinm> okay, that's up, moving on
[13:43:01] <wboykinm> zwarg: hm, password auth failed for user publicmapping . . .
[13:43:23] <zwarg> Can you connect via 'psql -U publicmapping publicmapping2' on the cmd line?
[13:44:56] <wboykinm> password auth failed
[13:45:12] <zwarg> Can you copy the password from the original GA config?
[13:45:15] <wboykinm> i'm using the "encrypted password" thing from the sql script
[13:45:22] <wboykinm> yeah, i did.
[13:46:08] <zwarg> Hm. If psql won't let you in, then that's the wrong pw.
[13:46:22] <zwarg> The password in the config file is not encrypted
[13:46:26] <wboykinm> seemed to work for GA . . .
[13:47:56] <zwarg> You can reset that postgresql pw to something that you will remember, if you can access psql via the postgres user
[13:48:28] <zwarg> if you are root: "su -- postgres; psql postgres"
[13:49:16] <zwarg> "alter role password 'mypass';"
[13:50:54] <wboykinm> syntax error it seems
[13:51:57] <zwarg> "alter role publicmapping password 'mypass';"
[13:56:06] --> GitHub143 (~GitHub143@sh3.rs.github.com) has joined #districtbuilder
[13:56:06] <GitHub143> [DistrictBuilder] dzwarg pushed 1 new commit to v2.0-rc: https://github.com/PublicMapping/DistrictBuilder/commit/6fb450f52234f813d2279132d2cc431b16300c60
[13:56:06] <GitHub143> [DistrictBuilder/v2.0-rc] Repaired translation of "Map Transparency" - David Zwarg
[13:56:06] <-- GitHub143 (~GitHub143@sh3.rs.github.com) has left #districtbuilder
[13:56:19] <wboykinm> all set, now moving back to setup . . .
[13:56:28] <zwarg> great
[13:58:28] <wboykinm> ugh. passwordauth failed again.
[13:58:32] <wboykinm> testing connection.
[13:59:47] <zwarg> Is the database host set properly? Seems like something else may be going haywire
[14:00:04] <wboykinm> weird. I'm through just fine on the command line with that password.
[14:00:15] <wboykinm> ahhhh. i forgot to update config.xml
[14:00:19] <wboykinm> on it
[14:01:04] <wboykinm> "error: no module named transport"
[14:01:23] <wboykinm> zwarg: is that a BARD thing?
[14:02:45] <zwarg> can you post more of the error output?
[14:02:55] <zwarg> oh. I know
[14:03:23] <zwarg> in the top folder of your git checkout, run: "pip install -r requirements.txt"
[14:03:34] <zwarg> Some dependencies (fun!) have changed
[14:03:57] <wboykinm> zwarg: fun but unavoidable
[14:07:57] <wboykinm> zwarg: as much as "spicy.spatial" sounds awseome: https://gist.github.com/3757435
[14:08:49] <zwarg> as root, can you do "easy_install scipy"?
[14:09:37] <wboykinm> Reading http://pypi.python.org/simple/spicy/
[14:09:37] <wboykinm> Couldn't find index page for 'spicy' (maybe misspelled?)
[14:09:37] <wboykinm> Scanning index of all packages (this may take a while)
[14:09:37] <wboykinm> Reading http://pypi.python.org/simple/
[14:09:37] <wboykinm> No local packages or download links found for spicy
[14:09:38] <wboykinm> error: Could not find suitable distribution for Requirement.parse('spicy')
[14:10:05] <zwarg> heh. it's not "spicy", but "scipy"
[14:10:21] <zwarg> "science" + "python"
[14:10:24] <wboykinm> wow. arcana FTW
[14:10:28] <zwarg> or something
[14:11:03] <wboykinm> ahhhh. "python for science". i get it.
[14:11:20] <wboykinm> oh hell, it's telling me numpy is too old.
[14:11:25] <wboykinm> lemme update
[14:11:48] <zwarg> pip install -u numpy
[14:12:58] <zwarg> maybe -U
[14:14:30] <wboykinm> wow. we're several rabbit holes down right now. "cannot compile python.h"
[14:14:42] <wboykinm> this is starting to feel like yesterday's XKCD
[14:16:44] <zwarg> fun!
[14:17:07] <zwarg> "sudo apt-get install python-dev"
[14:19:02] <wboykinm> zwarg: wow. i got a 403 at maverick-updates
[14:19:19] <wboykinm> never seent hat before. is maverick deprecated or something?
[14:19:23] <zwarg> awwww, what?
[14:19:37] <wboykinm> Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ maverick-updates/main libssl-dev amd64 0.9.8o-1ubuntu4.4
[14:19:37] <wboykinm> 403 Forbidden
[14:19:37] <wboykinm> Err http://security.ubuntu.com/ubuntu/ maverick-security/main libssl-dev amd64 0.9.8o-1ubuntu4.4
[14:19:37] <wboykinm> 404 Not Found [IP: 91.189.92.190 80]
[14:19:37] <wboykinm> Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_0.9.8o-1ubuntu4.4_amd64.deb 404 Not Found [IP: 91.189.92.190 80]
[14:19:37] <wboykinm> N: Ignoring file '50unattended-upgrades.rej' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
[14:19:37] <wboykinm> N: Ignoring file '50unattended-upgrades.orig' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
[14:19:37] <wboykinm> E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
[14:19:39] <PubMapBot> Sorry wboykinm, that's not unique, or not recognized as a commit.
[14:19:46] <wboykinm> thanks, pubmapbot
[14:19:54] <wboykinm> i'll keep that in mind
[14:19:57] <zwarg> heh. At least it apologized
[14:20:28] <zwarg> try an "apt-get update" first
[14:20:32] <zwarg> maybe the servers have changed
[14:20:39] <wboykinm> that's not going to kill the AMI?
[14:21:30] <wboykinm> hey, looks like that worked.
[14:21:36] <wboykinm> going back up the tunnel . . .
[14:23:20] <wboykinm> dev worked, numpy is going . . .
[14:23:25] <zwarg> whoo
[14:23:43] <wboykinm> zwarg: my documentation attempts are out the window.
[14:24:00] <zwarg> What are you attempting to document?
[14:24:30] <wboykinm> how to go from the GA AMI to a municipal case. hee hee.
[14:25:21] <zwarg> I think the issue was compounded by how old the software was on that version
[14:25:34] <wboykinm> yeah, maverick. woot.
[14:25:41] <wboykinm> scipy is going now
[14:26:40] <zwarg> cool
[14:35:32] <wboykinm> okay, scipy is in now.
[14:35:50] <zwarg> try that 'pip install -r requirements.txt' again
[14:35:59] <zwarg> it should install the remaining requirements
[14:36:13] <wboykinm> running
[14:38:43] <wboykinm> zwarg: done
[14:38:48] <wboykinm> try setup again?
[14:38:55] <zwarg> Yes, try it again.
[14:40:47] <wboykinm> zwarg: hey, we made it to shp2pqsql . . .
[14:41:18] <zwarg> That would be really odd, since we don't use that tool.
[14:41:43] <wboykinm> or whatever is converting the shapefile
[14:41:53] <zwarg> That's good!
[14:41:53] <wboykinm> zwarg: error thrown!
[14:41:53] <wboykinm> Error: An error occured during rendering: 'css/reset.css' could not be found in the COMPRESS_ROOT '/projects/DistrictBuilder/django/publicmapping/static-media' or with staticfiles.
[14:43:16] <wboykinm> zwarg: but then it said "compressing" and dumped me back at the prompt.
[14:43:21] <wboykinm> lemme try the url
[14:43:52] <wboykinm> zwarg: internal server error
[14:44:52] <zwarg> Staticfiles is newer than 1.1. Check your settings.py.in file, and compare it to https://github.com/PublicMapping/DistrictBuilder/blob/v2.0-rc/django/publicmapping/settings.py.in
[14:45:03] <zwarg> They should be identical
[14:45:14] <wboykinm> wherezat?
[14:45:16] <zwarg> Then look at settings.py, to see if COMPRESS_ROOT was set
[14:45:28] <wboykinm> okay got it
[14:48:05] <wboykinm> zwarg: they are identical
[14:49:35] <zwarg> Can you run "python manage.py comress" +
[14:49:36] <zwarg> ?
[14:51:49] <wboykinm> Error: Offline compressiong is disabled. Set COMPRESS_OFFLINE or use the --force to override
[14:52:06] <zwarg> "python manage.py compress -f"
[14:52:28] <wboykinm> Error: An error occured during rendering: 'css/reset.css' could not be found in the COMPRESS_ROOT '/projects/DistrictBuilder/django/publicmapping/static-media' or with staticfiles.
[14:54:22] <zwarg> is there a 'static-media' folder in django/publicmapping?
[14:54:56] <wboykinm> yup. static and staic-media
[14:55:13] <wboykinm> cd css
[14:55:14] <wboykinm> ls
[14:55:21] <wboykinm> ah hell there i go again
[14:55:29] <zwarg> what are their properties? Can you as a user, write to those folders?
[14:55:54] <wboykinm> they're all root:
[14:55:55] <wboykinm> drwxr-xr-x 2 root root 4096 2012-09-20 18:41 css
[14:56:25] <zwarg> are you running compress as root
[14:56:28] <zwarg> and setup as root?
[14:57:31] <wboykinm> everything as root
[14:58:00] <wboykinm> since "ubuntu" isn't a well-connected fellow
[14:58:43] <zwarg> can you post your settings.py file?
[15:04:40] <wboykinm> zwarg: sorry that took awhile: https://gist.github.com/3757722
[15:09:39] <zwarg> 1) Set <Project temp=""> to an absolute dir in your config.xml
[15:11:29] <zwarg> It looks like you have a trailing slash on your <Project root=""> setting. Remove that.
[15:12:34] <zwarg> And verify that your project root is actually "/projects/DistrictBuilder", and there are no typos
[15:13:00] <wboykinm> project root as in "where the .git file is"?
[15:13:14] <zwarg> yes
[15:14:09] <wboykinm> zwarg: should i repeat the params on project temp like sessionquota etc?
[15:15:11] <wboykinm> zwarg: and a dumb question: does this need a closing "/"?
[15:15:12] <wboykinm> <Project temp="/projects/temp" sessionquota="5"
[15:15:12] <wboykinm> sessiontimeout="15">
[15:16:53] <zwarg> That looks good
[15:17:11] <zwarg> make sure that's r/w by everybody
[15:17:26] <zwarg> technically just apache & celery, but everyone just to be safe
[15:17:49] <wboykinm> chmod a+x?
[15:19:16] <wboykinm> a+w. having a slow day here
[15:19:32] <zwarg> a+w
[15:19:51] <wboykinm> run setup again?
[15:22:50] <wboykinm> zwarg: going for it
[15:23:27] <wboykinm> The data XML file could not be parsed.
[15:23:27] <wboykinm> ../../docs/config.xml:255:19:FATAL:PARSER:ERR_TAG_NAME_MISMATCH: Opening and ending tag mismatch: Project line 170 and DistrictBuilder
[15:23:27] <wboykinm> ../../docs/config.xml:256:1:FATAL:PARSER:ERR_TAG_NOT_FINISHED: Premature end of data in tag DistrictBuilder line 2
[15:24:16] <wboykinm> zwarg: looks like it needs a closer of some sort
[15:26:20] <wboykinm> ../../docs/config.xml:253:1:FATAL:PARSER:ERR_DOCUMENT_END: Extra content at the end of the document
[15:26:20] <wboykinm> Configuration could not be validated.
[15:27:36] <wboykinm> zwarg: It seems to think I'm closing the parent <DistrictBuilder> tag by adding the RootDir and TempDir tags
[15:32:09] <zwarg> can you post the full config again?
[15:34:20] <wboykinm> zwarg: https://gist.github.com/3757883
[15:36:47] <zwarg> You have two <Project> elements.
[15:37:07] <zwarg> move the temp attribute into the one with the root attribute
[15:38:20] <wboykinm> aha!
[15:39:26] <wboykinm> zwarg: and we're back through the xml read
[15:39:33] <wboykinm> into the shape import
[15:40:13] <wboykinm> zwarg: oy.
[15:40:14] <wboykinm> Error: An error occured during rendering: 'css/reset.css' could not be found in the COMPRESS_ROOT '/projects/DistrictBuilder/django/publicmapping/static-media' or with staticfiles.
[15:41:09] <zwarg> dang. I don't recall seeing that before
[15:41:12] <wboykinm> zwarg: it's tru; that files' not there.
[15:42:27] <zwarg> what if you run the command "python manage.py collectstatic"
[15:42:27] <wboykinm> zwarg: oh hey, but it IS in the COMPRESS_ROOT/static/css directory
[15:42:46] <wboykinm> disctinct from static-media/css
[15:43:11] <zwarg> I think I know what's happening -- what's the output of the above 'collectstatic' command?
[15:43:39] <wboykinm> i just hit "this will overwrite existing files"
[15:43:43] <wboykinm> should i do it?
[15:43:51] <zwarg> yes
[15:44:06] <wboykinm> 0 copied, 199 unmodified
[15:45:20] <zwarg> hrm.
[15:45:28] <wboykinm> zwarg: any idea what up there?
[15:45:30] <zwarg> is there now anything in the static-media folder?
[15:45:52] <wboykinm> there were always a bunch of media folders
[15:46:00] <wboykinm> just not the reset.css file
[15:46:22] <wboykinm> zwarg: still not there
[15:46:27] <wboykinm> should i just copy it?
[15:46:56] <zwarg> if you 'ls static-media/css' you don't see it?
[15:47:08] <zwarg> is it also missing from 'ls static/css'?
[15:47:18] <zwarg> (from the django/publicmapping dir)
[15:48:22] <wboykinm> no, it's in static/css but not static-media/css
[15:48:41] --> GitHub25 (~GitHub25@sh2.rs.github.com) has joined #districtbuilder
[15:48:41] <GitHub25> [DistrictBuilder] dzwarg pushed 1 new commit to v2.0-rc: https://github.com/PublicMapping/DistrictBuilder/commit/1ed6a5f79b889322058e440c844bf631b781e2d4
[15:48:41] <GitHub25> [DistrictBuilder/v2.0-rc] Handled files that are missing all subject data. - David Zwarg
[15:48:41] <-- GitHub25 (~GitHub25@sh2.rs.github.com) has left #districtbuilder
[15:53:50] <zwarg> hm, this is definitely a bug
[15:54:09] <zwarg> you can copy everything from redistricting/static/* into static-media
[15:54:11] <zwarg> (recursive)
[15:54:27] <zwarg> the 'collectstatic' command is supposed to look in that folder, too, but it's not.
[15:54:33] <zwarg> I'm looking into that now...
[15:56:09] <wboykinm> zwarg: thanks. i'll run it again.
[16:05:23] <wboykinm> zwarg: next up on the train:
[16:05:26] <wboykinm> zwarg: Error: errors happened while running xgettext on __init__.py
[16:05:26] <wboykinm> /bin/sh: xgettext: not found
[16:06:53] <zwarg> "apt-get install gettext"
[16:09:03] <wboykinm> zwarg: got that one tacked onto the dep list?
[16:09:31] <zwarg> I do now. ;)
[16:10:19] <wboykinm> zwarg: whoops - BARD wants some attention: https://gist.github.com/3758056
[16:22:25] <wboykinm> zwarg: also, how many azavea folks work in the cambridge office?
[16:22:46] <zwarg> just myself for now
[16:23:35] <zwarg> still looking at that staticfiles bug...
[16:24:11] <wboykinm> zwarg: right on.
[16:32:27] <zwarg> okay, you need to run setup.py in phases
[16:32:45] <zwarg> the way you're running it, it tries to do absolutely everything, which it does not need to do
[16:32:53] <zwarg> look at the INSTALL doc for the switches.
[16:33:19] <zwarg> You've created a DB and imported the geolevels, so you'll probably want to:
[16:33:29] <zwarg> 1) create the views: -V
[16:33:42] <zwarg> 2) configure geoserver: -G
[16:34:11] <zwarg> Create the templates (based on the districtindex file): -T
[16:35:36] <wboykinm> zwarg: I've run them all, and gotten this at the end of each: AttributeError: 'NoneType' object has no attribute 'get'
[16:35:58] <wboykinm> zwarg: but it's not obvious that it's failed
[16:36:19] <zwarg> any more information? can you post the full output? Are you running with -v2?
[16:37:25] <wboykinm> i replaced that tag. i'll give it a shot
[16:39:57] <wboykinm> zwarg: I get some variation on this for all of them: https://gist.github.com/3758214
[16:42:06] <zwarg> is this still your config? https://gist.github.com/3757883
[16:42:23] <wboykinm> zwarg: no changes that i know of.
[16:42:51] <wboykinm> zwarg: with the exception of the <project> tag nesting
[16:43:08] <zwarg> right...
[16:46:53] <zwarg> ah! add the attribute 'default="true"' to your lone <Subject tag>
[16:47:07] <zwarg> Like line 114 of https://github.com/PublicMapping/DistrictBuilder/blob/v2.0-rc/docs/config.dist.xml
[16:48:56] <wboykinm> zwarg: looks good for -V. moving on
[16:54:19] <wboykinm> zwarg: geoserver configuration cleaned, but it's hanging on that for a bit
[16:54:34] <zwarg> yes, that's normal
[16:58:44] --> GitHub124 (~GitHub124@sh3.rs.github.com) has joined #districtbuilder
[16:58:44] <GitHub124> [DistrictBuilder] dzwarg pushed 1 new commit to v2.0-rc: https://github.com/PublicMapping/DistrictBuilder/commit/bc0c199293d441c5d766b42ff76704190e48b233
[16:58:44] <GitHub124> [DistrictBuilder/v2.0-rc] Added STATICFILES_DIRS for publicmapping app. - David Zwarg
[16:58:44] <-- GitHub124 (~GitHub124@sh3.rs.github.com) has left #districtbuilder
[16:59:30] <wboykinm> zwarg: okay, it's through the -t tag. any recommendations for th next step?
[17:00:36] <wboykinm> zwarg: should i go straight to running the servers?
[17:04:45] <zwarg> I think you can spool up the servers now, yes
[17:04:51] <zwarg> apache & celery
[17:05:41] <wboykinm> python no?
[17:06:10] <zwarg> It runs as a WSGI app, via apache
[17:06:45] <wboykinm> nice
[17:11:03] <zwarg> It will help to turn DEBUG=True in settings.py when you run into problems with the web app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment