*** pleia2_ is now known as pleia2 | 01:04 | |
*** zara_the_lemur__ has quit IRC | 03:45 | |
*** diablo_rojo has quit IRC | 04:01 | |
*** AJaeger has left #storyboard | 07:34 | |
*** bethwhite has joined #storyboard | 10:43 | |
Zara | short of other ideas, I tried making a fresh db for mysql with the same migration script I'm using for postgres. I don't get the 500 error, so I'm fairly sure it's not getting a 500 from struggling to parse anything in the database. | 12:12 |
---|---|---|
SotK | is the 500 just from stories or does it happen with tasks too? | 12:28 |
Zara | it's actually the tasks (but it shows up when posting a story since it automatically creates tasks) | 12:28 |
Zara | the stories do post | 12:28 |
SotK | oh yeah, your paste says that, sorry :) | 12:29 |
SotK | can you GET a story that you've created? | 12:31 |
Zara | well I've left walls of text in here, so easy to miss a detail like that | 12:31 |
Zara | istr I could but I'll check | 12:31 |
Zara | ah, okay, so I can get the list of stories, but not any specific story | 12:33 |
Zara | I get the same error when I try to browse to a specific story | 12:33 |
Zara | and get sent back to the dashboard | 12:33 |
SotK | I thought you might | 12:33 |
SotK | if you comment out the if statement in storyboard/db/api/stories.py at line 50 to 52, does it work? | 12:34 |
SotK | in fact, not there | 12:35 |
SotK | lines 63 and 64 are the relevant bit | 12:35 |
Zara | confirmed that line 50-52 doesn't do it :P | 12:35 |
Zara | ooh, now I get a different error | 12:36 |
* Zara goes to paste | 12:37 | |
Zara | http://paste.openstack.org/show/597940/ | 12:38 |
openstackgerrit | Merged openstack-infra/storyboard master: Prepare for using standard python tests https://review.openstack.org/427589 | 12:40 |
SotK | \o/ | 12:41 |
* SotK thinks that http://stackoverflow.com/a/25193282 could be related to the first problem | 12:42 | |
SotK | we do a union when checking the story permissions | 12:42 |
SotK | https://github.com/openstack-infra/storyboard/blob/master/storyboard/db/api/base.py#L437 | 12:42 |
Zara | ahh, okay. I thought something needed casting but had no idea what or where | 12:42 |
Zara | or if it only thought something needed casting because it was misinterpreting a different instruction | 12:43 |
SotK | that stackoverflow problem looks similar, but I'm not sure how we'd implement the casting it seems to expect | 12:43 |
Zara | postgres fork where we comment out everything and there are no permissions =D | 12:44 |
Zara | the second one is weird | 12:45 |
Zara | DBError: (ProgrammingError) operator does not exist: subscriptions_target_type ~~ unknown | 12:45 |
Zara | LINE 8: ...iptions.user_id = 1 AND subscriptions.target_type LIKE '%wor... | 12:45 |
Zara | ^ | 12:45 |
Zara | HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. | 12:45 |
Zara | since 'like' is a thing | 12:45 |
Zara | I'm guessing it's the enums that are confusing it | 12:45 |
Zara | sa.Column('target_type', sa.Enum('task', 'story', 'project', 'project_group', 'worklist', name='subscriptions_target_type'), nullable=True), | 12:46 |
SotK | seems like a sensible guess | 12:48 |
Zara | and so then this isn't working right: http://paste.openstack.org/show/597944/ | 12:48 |
Zara | (I think that's the relevant code anyway) | 12:48 |
Zara | supported types are a dict | 12:49 |
Zara | SUPPORTED_TYPES = { | 12:49 |
Zara | 'project': models.Project, | 12:49 |
Zara | 'project_group': models.ProjectGroup, | 12:49 |
Zara | 'story': models.Story, | 12:49 |
Zara | 'task': models.Task, | 12:49 |
Zara | 'worklist': models.Worklist | 12:49 |
Zara | } | 12:49 |
Zara | maybe it just hates all dicts | 12:49 |
Zara | I'm happy, anyway, there's something to work with now | 12:52 |
Zara | thank you :) | 12:52 |
SotK | looking at the endpoint it shouldn't use the dict there though, since I assume that part of the query is caused by https://github.com/openstack-infra/storyboard/blob/master/storyboard/db/api/worklists.py#L106 | 12:55 |
SotK | I think the "LIKE" must be coming from https://github.com/openstack-infra/storyboard/blob/master/storyboard/db/api/base.py#L77 | 12:57 |
Zara | oh, I wonder if it wants a 'WHERE' first | 12:59 |
Zara | LINE 8: ...iptions.user_id = 1 AND subscriptions.target_type LIKE '%wor... | 12:59 |
Zara | so AND WHERE | 12:59 |
Zara | I think it might be treating 'subscriptions.target_type' as the operator | 12:59 |
SotK | the WHERE is earlier in the query | 12:59 |
Zara | hm, I wonder if it's still counting it. | 13:00 |
Zara | DBError: (ProgrammingError) operator does not exist: subscriptions_target_type ~~ unknown | 13:00 |
SotK | the ~~ operator there is LIKE aiui, and it is saying it doesn't have a LIKE operator for the two types | 13:01 |
SotK | maybe only the unknown thing on the rhs needs to have an explicit cast | 13:02 |
Zara | oh, right, I hadn't seen the tilde notation for that before | 13:02 |
Zara | \nWHERE subscriptions.user_id = %(user_id_1)s AND subscriptions.target_type LIKE %(target_type_1)s) | 13:03 |
Zara | is a bit more context for that bit | 13:03 |
Zara | huh, this also seems to start stories at id 10 | 14:24 |
Zara | (instead of 1 or 01) | 14:24 |
Zara | just noting it in case it hints at anything else | 14:25 |
*** diablo_rojo has joined #storyboard | 16:10 | |
*** openstackgerrit has quit IRC | 16:35 | |
*** diablo_rojo has quit IRC | 16:38 | |
* Zara wonders why theres cast_value in user preferences | 17:08 | |
Zara | *there's | 17:08 |
Zara | or rather, trying to work out exactly how it works | 17:11 |
*** Guest34099 has quit IRC | 17:32 | |
Zara | I think I did it | 18:07 |
* Zara dies | 18:07 | |
Zara | not working out how that bit works, I gave up on that, but how to do a cast for this code in a way that postgres understands in sqlalchemy | 18:07 |
Zara | will send a wip patch shortly | 18:10 |
*** diablo_rojo has joined #storyboard | 18:15 | |
Zara | hm I don't think my workaround is quite right. it lets me create a story but then I can't view it, though I can view others that I couldn't view before. maybe I've got the wrong type. | 18:17 |
Zara | (I'm getting 500: GET /api/v1/worklists: 'FullText' object has no attribute '_has_bind_expression' after casting to FullText) | 18:18 |
Zara | but it's getting further now, and does POST the task, it just then can't GET the task (so I can GET only the stories with no tasks) | 18:24 |
Zara | (this is with the 'comment out permissions query' workaround) | 18:25 |
SotK | oh dear | 18:26 |
SotK | does our fulltext thing have mysql specific stuff in? | 18:27 |
*** openstackgerrit has joined #storyboard | 18:29 | |
openstackgerrit | Zara proposed openstack-infra/storyboard master: Hacky WIP to provide postgresl support for StoryBoard https://review.openstack.org/430395 | 18:29 |
Zara | this is imported from sqlalchemy so shouldn't, but we do have a mysql specific text type somewhere as well | 18:30 |
Zara | there's the patch, anyway. | 18:30 |
Zara | with a long commit message... | 18:30 |
Zara | I've kept it as one commit so it's easier to see everything in one place while it's all so hacky. | 18:30 |
Zara | (once it's all split out nicely, sotk should be coauthor for the models.py change, haha ) | 18:34 |
* Zara disappears for a bit | 18:34 | |
Zara | I'm not sure if it should be FullText, that was just the one that worked the most of the things I tried | 18:57 |
Zara | so maybe I'm just casting to the wrong type | 18:58 |
Zara | (I also tried String and UnicodeText since they seemed text-y) | 18:58 |
Zara | those didn't work. | 18:59 |
Zara | maybe this is a thing that should be used: https://www.postgresql.org/docs/8.3/static/datatype-textsearch.html | 19:01 |
*** zara_the_lemur__ has joined #storyboard | 19:16 | |
diablo_rojo | SotK, where is that migration repo? I was going to try to make headway on the mapping branches to tags today | 19:42 |
SotK | diablo_rojo: http://git.openstack.org/cgit/openstack-infra/storyboard/tree/storyboard/migrate | 19:43 |
SotK | I sent a patch which just adds every task to the master branch, https://review.openstack.org/#/c/423877/ | 19:44 |
SotK | that isn't good enough though, since some tasks are in other branches too on LP aiui | 19:44 |
SotK | in that case we need to add a task to each branch in SB too, creating the branches if need be | 19:45 |
diablo_rojo | Okay so my patch will be dependent on that one then? | 19:46 |
SotK | dependent on it, or you can just take over it if you like | 19:47 |
diablo_rojo | If your patch works and all that I can just modify it :) | 19:49 |
Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!