*** zara_the_lemur__ has quit IRC | 03:25 | |
*** diablo_rojo_phon has quit IRC | 03:30 | |
*** openstackgerrit has joined #storyboard | 05:33 | |
openstackgerrit | Tristan Cacqueray proposed openstack-infra/storyboard: Support MariaDB in the migration scripts https://review.openstack.org/427028 | 05:33 |
---|---|---|
*** jtomasek_ has joined #storyboard | 07:26 | |
*** bethwhite has joined #storyboard | 09:14 | |
*** jtomasek_ has quit IRC | 10:06 | |
*** bethwhite has quit IRC | 10:47 | |
Zara | oh, mariadb, interesting! | 10:49 |
Zara | I'm currently looking into supporting more dbs (starting with other sql dbs, though) | 10:49 |
Zara | today's plan is to spin up some other sql db (probably postgresql) and try to point storyboard at it, and see what breaks | 11:13 |
Zara | I'm not too sure if it's best to use a fresh instance for this or if I should point my existing storyboard instance (currently pointing at a mysql db) at it. | 11:14 |
SotK | either will work just the same I expect, since it'll be a fresh db either way | 11:15 |
Zara | okay, I wasn't sure if there could be some weirdness running both dbs simultaneously. | 11:16 |
Zara | just showing my ignorance :) | 11:16 |
*** bethwhite has joined #storyboard | 11:21 | |
*** jtomasek_ has joined #storyboard | 12:08 | |
*** jtomasek_ has quit IRC | 12:28 | |
*** jtomasek_ has joined #storyboard | 12:32 | |
*** alexismonville has joined #storyboard | 12:33 | |
* Zara is currently trying to convert the create-mysql-storyboard-db instructions to postgresql ones | 12:56 | |
Zara | ubuntu@zara-storyboard:~$ psql -U root -W; | 12:56 |
Zara | Password for user root: | 12:56 |
Zara | psql: FATAL: Peer authentication failed for user "root" | 12:56 |
Zara | well that was fun; 'night, all. | 12:56 |
* Zara searches around and gathers she should edit a config file | 12:57 | |
*** jtomasek_ has quit IRC | 13:01 | |
*** alexismonville has left #storyboard | 13:14 | |
Zara | so I'm not expecting this to work yet | 13:36 |
Zara | http://paste.openstack.org/show/597026/ | 13:36 |
Zara | is where I'm at atm | 13:37 |
Zara | although I have manually installed psycopg2 so am wondering if it's not being found in my venv, or if it's something else | 13:37 |
SotK | try adding it to requirements.txt and removing .tox/venv | 13:38 |
Zara | thanks, will give that a go | 13:38 |
Zara | http://paste.openstack.org/show/597032/ is where I'm at atm, not sure if it's my config or not. | 14:29 |
Zara | connection = postgresql+psycopg2://postgres@127.0.0.1:3306/storyboard | 14:29 |
Zara | is what I have as my line atm; mostly a guess | 14:29 |
pedroalvarez | maybe checking the connection from a different script, something like http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#special-reflection-options | 14:42 |
Zara | ah, thanks | 14:43 |
Zara | I suspect my config is very wrong so that should help | 14:43 |
pedroalvarez | i didn's spot anything obvious, other than there is no password specified | 14:45 |
Zara | yeah, I tried giving it one and it didn't make a difference, but I might've messed up the user or all sorts of other things. | 14:46 |
Zara | + I'm not expecting it to work properly yet *anyway* | 14:46 |
Zara | just not sure exactly what the 'right' error will look like :D | 14:47 |
pedroalvarez | have you run the db migration scripts? | 14:49 |
Zara | I think maybe it's the port | 14:50 |
Zara | yay, it was | 14:51 |
Zara | it's still failing but cool | 14:51 |
Zara | (now it wants a password, my user does not have a password, I don't yet know how to give it a password) | 14:52 |
* Zara finally gets the right syntax for it (she thinks) and tries again | 14:57 | |
Zara | I guess we have liftoff! | 14:58 |
SotK | \o/ | 14:58 |
Zara | don't get too carried away. http://paste.openstack.org/show/597039/ | 14:59 |
SotK | have you run the migrations? | 14:59 |
Zara | not yet | 14:59 |
Zara | at least not as far as I know? | 15:00 |
SotK | that'll be why it can't find the projects relation then | 15:00 |
Zara | (just ran default tox command) | 15:00 |
Zara | I'm just happy it's connecting | 15:00 |
Zara | so tox -e venv "storyboard-db-manage --config-file ./etc/storyboard.conf upgrade head" | 15:00 |
SotK | oh, huh | 15:01 |
Zara | oh no | 15:01 |
Zara | I mean that's what I'm about to do now | 15:01 |
Zara | sorry | 15:01 |
SotK | oh good | 15:01 |
Zara | that was confusing of me | 15:01 |
Zara | :P | 15:01 |
Zara | I was just doing tox -e venv "storyboard-api --config-file ./etc/storyboard.conf" before | 15:01 |
SotK | phew | 15:02 |
Zara | (figured I should add that context for the logs ) | 15:02 |
Zara | and now http://paste.openstack.org/show/597042/ | 15:10 |
Zara | at a glance, I notice it mentions comments, and I know our comments are mysql-specific | 15:10 |
Zara | so... migration 17... | 15:11 |
Zara | april 2014 | 15:13 |
Zara | https://github.com/openstack-infra/storyboard/blob/master/storyboard/db/migration/alembic_migrations/versions/017_timeline_events.py | 15:15 |
SotK | its probably possible to fix that migration somehow | 15:15 |
SotK | (may involve fixing earlier ones) | 15:16 |
SotK | upon learning about how foreign keys work in postgres with sqlalchemy | 15:16 |
Zara | yeah | 15:16 |
Zara | I just started searching | 15:16 |
* Zara is reminded to merge 42702 | 15:19 | |
openstackgerrit | Merged openstack-infra/storyboard: Support MariaDB in the migration scripts https://review.openstack.org/427028 | 15:33 |
Zara | hm, seems DROP FOREIGN KEY is a mysqlism while DROP CONSTRAINTS is the more usual variant... but this code does say drop_constraint | 15:58 |
SotK | 'ALTER TABLE comments DROP CONSTRAINT comments_ibfk_1' in that log suggests it is being translated correctly too | 15:59 |
SotK | 'constraint "comments_ibfk_1" of relation "comments" does not exist' makes me think that maybe the migration which creates the foreign key is the broken one | 15:59 |
Zara | yeah | 16:05 |
* Zara discovers we never had a 009 migration | 16:13 | |
Zara | it goes 8, 10 | 16:13 |
SotK | inspired by windows | 16:14 |
Zara | okay... so I think maybe it's the very first migration that should be making the foreign key... | 16:15 |
Zara | I'm looking at | 16:16 |
Zara | sa.ForeignKeyConstraint(['author_id'], ['users.id'], ), | 16:16 |
Zara | sa.ForeignKeyConstraint(['story_id'], ['stories.id'], ), | 16:16 |
Zara | sa.PrimaryKeyConstraint('id'), | 16:16 |
Zara | vs | 16:17 |
Zara | sa.ForeignKeyConstraint(['assignee_id'], ['users.id'], | 16:17 |
Zara | name='tasks_ibfk_1'), | 16:17 |
Zara | sa.ForeignKeyConstraint(['milestone_id'], ['milestones.id'], | 16:17 |
Zara | name='tasks_ibfk_2'), | 16:17 |
Zara | sa.ForeignKeyConstraint(['project_id'], ['projects.id'], | 16:17 |
Zara | name='tasks_ibfk_3'), | 16:17 |
Zara | sa.ForeignKeyConstraint(['story_id'], ['stories.id'], | 16:17 |
Zara | name='tasks_ibfk_4'), | 16:17 |
Zara | sa.PrimaryKeyConstraint('id'), | 16:17 |
Zara | for tasks, above it | 16:17 |
SotK | that looks like it may be problematic | 16:17 |
Zara | :D | 16:17 |
Zara | as spotted in 001_initial_version.py | 16:18 |
Zara | before migration 17, comments are only mentioned in 001 and 007 | 16:19 |
Zara | and I don't think 007 touches on this | 16:19 |
Zara | (https://github.com/openstack-infra/storyboard/blob/master/storyboard/db/migration/alembic_migrations/versions/007_is_active_in_comments.py ) | 16:20 |
SotK | probably "comments_ibfk_1" is the default for mysql but not postgres | 16:20 |
Zara | yeah, maybe. I've tried just putting that in the first migration; guess we'll see what happens | 16:22 |
Zara | haha, this time it got to migration 18 | 16:23 |
SotK | \o/ | 16:24 |
Zara | bit of an ironic one... | 16:24 |
Zara | http://paste.openstack.org/show/597049/ | 16:24 |
SotK | :D | 16:25 |
Zara | this is going to be one of those things where I wonder how anything ever worked | 16:27 |
SotK | because mysql does magic | 16:27 |
Zara | :) | 16:27 |
Zara | I don't know what this command *should* look like... | 16:39 |
SotK | it reads like for some reason the task_priority enum isn't being created | 16:44 |
Zara | I'm gonna look at the earlier storyboard_priority one to see if I can spot a difference | 16:45 |
Zara | hm, the other example is op.create_table(foo, bar, sa.Column('priority'...)) but this one is op.add_column(sa.Column('priority'...)) | 16:51 |
Zara | so maybe it needs something saying which table? | 16:51 |
Zara | (though it does have 'tasks' as the first parameter, so.) | 16:51 |
Zara | yeah I *think the issue is that it's going `'priority', enums['task_priority'], nullable=True)` | 16:55 |
Zara | and it expects the first two things to be name, then type | 16:55 |
Zara | so maybe enum, not enums['task_priority'] | 16:56 |
SotK | enums['task_priority'] is a type (sa.Enum, created by the function above) | 16:56 |
SotK | I'm not entirely sure why it doesn't work | 16:56 |
SotK | http://stackoverflow.com/questions/14845203/altering-an-enum-field-using-alembic | 16:58 |
SotK | http://stackoverflow.com/questions/37848815/sqlalchemy-postgresql-enum-does-not-create-type-on-db-migrate also related but not a useful fix for us | 16:59 |
Zara | I'm trying to work out why it would be fine with the syntax for version 001 but not for version 018 | 17:02 |
*** diablo_rojo has joined #storyboard | 17:05 | |
Zara | ah I think maybe it needs to be named 'priority' | 17:07 |
Zara | like storyboard_priority = sa.Enum( | 17:07 |
Zara | 'Undefined', 'Low', 'Medium', 'High', 'Critical', | 17:07 |
Zara | name='priority') | 17:07 |
Zara | the 'name' at the bottom | 17:08 |
Zara | or not :( | 17:09 |
*** diablo_rojo has quit IRC | 17:24 | |
Zara | migration 012 might be a better comparison | 17:25 |
openstackgerrit | Zara proposed openstack-infra/storyboard: Fix db migration 001 so migration 017 works https://review.openstack.org/427331 | 17:47 |
Zara | still have no idea what's wrong with migration 18 but at least that won't get lost, now | 17:49 |
openstackgerrit | Zara proposed openstack-infra/storyboard: Fix db migration 001 so migration 017 works https://review.openstack.org/427331 | 17:52 |
Zara | it's like it's expanding enums['foo'] to 'foo' | 18:02 |
* Zara has no idea why it hates her and everything she stands for; will look more tomorrow. | 18:06 | |
*** diablo_rojo_phon has joined #storyboard | 18:11 | |
*** SpamapS has quit IRC | 19:39 | |
SotK | oh dear, this user migration bug is more complicated than I first thought | 19:55 |
* SotK wonders what a "Launchpad maintenance user" is | 19:59 | |
*** zara_the_lemur__ has joined #storyboard | 20:00 | |
* zara_the_lemur__ doesn't know; any docs? | 20:01 | |
* zara_the_lemur__ finds nothing searching internet | 20:02 | |
SotK | I also found nothing | 20:02 |
zara_the_lemur__ | someone in #infra might now | 20:03 |
zara_the_lemur__ | now? | 20:03 |
zara_the_lemur__ | know | 20:03 |
*** diablo_rojo_phon has quit IRC | 22:00 | |
*** jeblair has quit IRC | 22:16 | |
*** jeblair has joined #storyboard | 22:22 | |
*** diablo_rojo has joined #storyboard | 22:27 | |
*** diablo_rojo has quit IRC | 22:54 | |
*** diablo_rojo_phon has joined #storyboard | 23:55 |
Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!