/srv/irclogs.ubuntu.com/2013/02/05/#launchpad-dev.txt

StevenKwgrant:00:01
StevenK(Pdb) p hasattr(item, 'file')00:01
StevenKTrue00:01
StevenK(Pdb) p hasattr(item, 'filename')00:01
StevenKTrue00:01
wgrantStevenK: Is the filename non-empty?00:01
StevenKNope00:01
StevenKIt's None00:01
wgrantAha00:02
wgrantSo00:02
wgrantCompare the requests that are sent00:02
StevenKI wonder about lazr/restful/_bytestorage.py00:09
wgrantStevenK: That's a Resource00:11
wgrantNot relevant here00:11
wgrant(though you should probably also test it, it's probably fine as it will just use the raw body)00:12
=== slank is now known as slank_away
StevenKBLEH02:55
StevenKThe traceback does not show lazr.restful's call02:56
StevenKJust the WSGI and the zope publisher02:56
wgrantWhich traceback?02:57
StevenKThe pdb I have in zope.publisher.browser02:58
StevenKI was hoping to get a clue what called it02:58
wgrantThat's before lazr.restful, usually02:58
StevenKOh, then what forms this request?02:58
wgrantStevenK: lazr.restful interprets the request02:59
wgrantAfter it gets through the normal Zope request stuff, which eventually decides that it's an API request03:00
StevenKSo it could be launchpadlib itself, then?03:01
wgrantStevenK: Right, I'd examine the POST request it makes03:03
wgrantUsing httplib2.debuglevel03:03
=== tumbleweed_ is now known as tumbleweed
StevenKhttplib2.debuglevel seems to be working great. Not.03:55
wgrantStevenK: You need to set it before you instantiate the launchpad object03:56
StevenKOh03:56
StevenKwgrant: http://pastebin.ubuntu.com/1611158/03:57
StevenKThat looks wrong already03:57
wgrantYeah, there's the problem03:59
StevenKSo it could be lazr.restfulclient?04:00
wgrantIt is, yes.04:01
wgrantSo we ideally want to fix it and work around on the server side too04:01
wgrantAlthough I'm not quite sure what lazr.restfulclient can do04:01
wgrantIt doesn't necessarily have a filename04:01
wgrantIt may be better to see if addReleaseFile can somehow obtain the request, and get the file out somewhat manually04:02
wgrantOr we could make lazr.restful do that04:02
StevenKI was thinking we could change lazr.restfulclient to set a filename of 'bytestream' or something like that04:03
wgrantWe have to do something server-side anyway04:04
StevenKWhat are you thinking?04:04
wgrantWe need to either fix lazr.restfulclient to send the header and fix the server to reject the request if the content is a unicode, thus making everyone upgrade... or we can fix lazr.restfulclient for the future and make the server grab the str directly from the request, bypassing the decoded value04:06
StevenKSounds like you prefer the second option.04:09
wgrantWe want to avoid breaking clients if we can.04:09
StevenKwgrant: Does that bug have enough branches linked to it?04:12
wgrantNo04:13
wgrantI could link the 5-10 I landed before I started linking things if you want :)04:13
StevenKHaha04:13
StevenKwgrant: QA and deployment, or what is your plan?04:14
wgrantStevenK: Hahahaa no deploying now would be suicide04:15
StevenKThere is still stuff to land?04:15
wgrantThere's about a dozen indices to go04:15
wgrantWorking through the last few pages now04:15
StevenKRight04:16
StevenKHmm, now. How to get at the request04:18
StevenK(Pdb) p request04:28
StevenK<lp.services.webapp.servers.LaunchpadTestRequest instance URL=http://launchpad.dev>04:28
wgrantdid you use get_current_browser_request()?04:30
StevenKYeah04:31
StevenKStill trying to figure out what I want to pull out from it04:31
wgrantYeah, I'm not quite sure04:31
wgrantLook at how BrowserRequest.__processInput gets stuff04:32
StevenKThat iterates over items()04:32
StevenKI think04:32
StevenKBut items() for these LTRs is not helpful04:32
wgrantOr it might no longer be helpful04:33
wgrantIt's possible that it gets consumed04:33
StevenKIt looks to play with self._environ, and then throws that to ZopeFieldStorage04:34
StevenKrequest._environ has stuff in it, but nothing of any use04:34
wgrantIt doesn't use request.read()?04:35
wgrantThe FieldStorage itself might do that04:35
StevenK*** AttributeError: AttributeError("'LaunchpadTestRequest' object has no attribute 'read'",)04:35
wgrantWell, it's something like that04:36
wgrantMaybe request.body.read()04:37
wgrantAnyway, can you obtain the ZFS?04:37
StevenKI don't think the ZFS is saved anywhere04:38
StevenKSo I think the answer is no04:38
wgrant:(04:39
wgrantAlso, if I was to come up with a list of good ideas, reading the file into RAM would not appear on it04:40
StevenKBah, RAM is cheap04:40
StevenK:-P04:40
StevenKwgrant: http://pastebin.ubuntu.com/1611231/ not sure if the request is actually helpful04:55
wgrantStevenK: The environment won't be useful for the request body, no04:57
StevenKBut that's what ZFS is pulling from04:57
wgrantOh04:58
wgrantThere's extra stuff in there04:58
wgrantwsgi.input04:58
StevenK(Pdb) p request.form['field.filecontent']04:58
StevenK<zope.publisher.browser.FileUpload object at 0x2abb382f71d0>04:58
wgrantThat sounds like it was correctly submitted, and to +addownloadfile, not the API04:59
StevenKWhich it was, yes04:59
StevenK(Pdb) p request.form['file_content']05:01
StevenKu'\x1f\...'05:01
StevenKRight, broken like hell05:01
StevenKwgrant: It's broken in request.items() too05:03
wgrantNaturally.05:03
wgrantthat just iterates over the form items, doesn't it?05:03
wgrantNot the raw request data05:03
StevenKThen where would that be hiding?05:04
wgrantIn _environ. I assume ZFS parses that05:05
StevenK(Pdb) p request._environ['wsgi.input'].read()05:05
StevenK''05:05
StevenKNot so helpful05:06
wgrantseek(0)05:06
StevenKContent-Disposition: form-data; name="file_content"\n\n\x1f...05:08
wgrantRight :)05:08
wgrantYou might be able to use ZopeFieldStorage to parse it more easily and get the raw content without parsing the MIME yourself05:08
StevenKSo it's broken everywhere?05:08
wgrantHmm?05:09
StevenKBut that is from the MIME?05:09
wgrantWhat's wrong with it?05:09
StevenKAnd it looks encoded already05:09
wgrantIt's a bytestring05:09
wgrantWhich is what we want05:09
wgrant\x1f isn't an obvious test, since it's ASCII.05:09
wgrantSo decoding it as UTF-8 won't break05:09
wgrantBut that looks fine to me05:09
StevenKname="file_content"\n\n\x1f\x8b\x08\x00\xcc\x03\x0fQ\x00\x03\xed\xce1\x12\x82@05:10
StevenKStill looks okay?05:10
wgrantNothing in there looks like a U+FFFD05:10
wgrantSo indeed05:10
wgrantCompare it to the data you gave it?05:10
StevenKDon't know how to get it in that format05:11
wgrantHmm?05:11
wgrantWhat format?05:11
wgrantThat's just the raw bytes05:11
wgrant(but \x-escaped because you're repr()ing the str)05:11
StevenKIt's a tarball, so ...05:12
wgrantopen('foo.tar').read()[:20]05:12
StevenKAh05:13
StevenKIt is identical05:13
wgrantGood :)05:13
wgrantIt would be a matter of great concern if it did not05:14
StevenKHeh05:14
StevenKSo I want to rely on _environ['wsgi.input'] ? Seems like an awful hack05:14
wgrantIt is a terrible revolting hack05:14
wgrantBut if Zope doesn't give us another way to get it, then we have little choice05:15
StevenKZFS is just cgi.FieldStorage05:22
StevenK... which is nicely undocumented05:22
=== cyclicflux_ is now known as CyclicFlux
* StevenK stabs cgi.FieldStorage05:48
StevenKwgrant: http://pastebin.ubuntu.com/1611421/05:57
wgrantStevenK: Isn't that unicodeness check around the wrong way?06:03
wgrantWe want to reretrieve it if *has* been decoded06:03
wgrant(we also want to run this past gary_poster or benji)06:03
StevenKYeah06:04
StevenKFixed06:04
wgrantAlso, that's really awful and I hope you pay for your crimes.06:05
wgrantBut it looks quite effective06:05
StevenKHahaha06:05
StevenKI really don't want to use it06:05
StevenKwgrant: The other half of that branch is the _decode resurrection06:06
wgrantRight06:07
adeuringgood morning08:52
lifelesshttp://webnumbr.com/launchpad-critical-bugs is looking pretty good10:17
czajkowskinot bad for only having two people on there :)10:19
jmlheh10:23
jmlstill more evidence against using centralized allocation of scarce resources to meet inexhaustible demand?10:24
czajkowskiwgrant: StevenK if either of ye are about I'd apprecite some help on answers trying to catch up from being off and some of them need yer help10:25
czajkowskiplease10:25
czajkowskihttps://bugs.launchpad.net/launchpad/+bug/1108790  bug or not a bug also10:26
_mup_Bug #1108790: Ubuntu-launchpad uses google-analytics by default <Launchpad itself:New> < https://launchpad.net/bugs/1108790 >10:26
lifelessczajkowski: well it has flattened off recently10:27
lifelessczajkowski: but yeah10:28
lifelessjml: possibly eveidence that changing things when the system is unstable leads to more instability10:29
jmllifeless: heh, maybe10:29
wgrantlifeless: Hmmm?10:29
wgrantlifeless: We know from the lpstats graphs that the number of incoming bugs did not change significantly10:30
wgrantWe're just less hopeless at closing them10:30
lifelesswgrant: presumably all the low hanging fruit :)10:30
lifelesswgrant: have you repeated the root cause analysis flacoste did?10:31
wgrantlifeless: No10:31
lifelesswgrant: that was fairly conclusive that most criticals were self inflicted :)10:31
lifelessIIRC10:31
=== Ursinha is now known as Ursinha-afk
lifelesswgrant: how long is buildbot now?10:51
wgrantlifeless: 38 minutesish10:53
=== Ursinha-afk is now known as Ursinha
czajkowskihmm I still need to write up post fosdem review11:01
czajkowskican I have another 4 hours in todays day please11:01
StevenKczajkowski: Sure, if you have four hours less sleep.11:09
czajkowskiI am already running on low from the weekend of brussels, beer and geeks = late night chats and catch up11:10
czajkowskiwas great fun11:10
czajkowskithough I thnk I've had enough waffles to last me till next year11:10
=== Ursinha is now known as Ursinha-afk
=== Ursinha-afk is now known as Ursinha
lifelessczajkowski: amen :)11:13
czajkowskiheh11:14
czajkowskiit was very good this year , lifeless you ever been?11:14
lifelessczajkowski: no, I haven't. I was at LCA though - same week :)11:15
czajkowskiah not been there, this is a little closer for me to get to11:16
czajkowskialthough there was a large USA attendees who all flew in for the weekend11:17
czajkowskiplus RMS arrived11:17
czajkowskialhtough he was banned/asked not to attend the legal sessions11:17
lifelessROTFL11:20
lifelessI probably shouldn't be so amused.11:20
lifelessBut still, I am.11:20
czajkowskiso was I when I heard11:21
czajkowskithere was much running around keeping him away from perople it seems11:21
czajkowskihe's now in ireland11:21
lifelessman on a mission11:21
czajkowskito aleniate a lot of people11:22
cjwatsonwgrant: Did you get a chance to look at bpph-phase?11:28
=== Ursinha is now known as Ursinha-afk
=== Ursinha-afk is now known as Ursinha
=== Ursinha is now known as Ursinha-afk
=== Ursinha-afk is now known as Ursinha
=== yofel_ is now known as yofel
=== slank_away is now known as slank
=== deryck is now known as deryck[lunch]
=== slank is now known as slank_away
=== slank_away is now known as slank
=== deryck[lunch] is now known as deryck
=== slank is now known as slank_away
=== slank_away is now known as slank
StevenKwgrant: https://code.launchpad.net/~stevenk/launchpad/unexport-updatepreviewdiff/+merge/14674423:46
wgrantStevenK: https://code.launchpad.net/~wgrant/launchpad/setupCompleteBuilds-nonspecific/+merge/14675123:53
wgrantStevenK: r=me23:54
StevenKwgrant: Can't getSpecificJobs die as pointless now?23:54
wgrantStevenK: No23:55
wgrantStevenK: You need to get the specific jobs for Archive:+builds and Builder:+history23:55
wgrantBecause the underlying queries just give you BuildFarmJobs, so you need to translate them.23:55
StevenKRight23:56
StevenKwgrant: r=me23:57
wgrantStevenK: Thanks23:57
StevenKAnd Firefox hangs for 30 seconds because I dared to close a tab that contained Flash23:57
=== slank is now known as slank_away

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