Tuesday, 2017-01-31

*** zara_the_lemur__ has quit IRC03:25
*** diablo_rojo_phon has quit IRC03:30
*** openstackgerrit has joined #storyboard05:33
openstackgerritTristan Cacqueray proposed openstack-infra/storyboard: Support MariaDB in the migration scripts  https://review.openstack.org/42702805:33
*** jtomasek_ has joined #storyboard07:26
*** bethwhite has joined #storyboard09:14
*** jtomasek_ has quit IRC10:06
*** bethwhite has quit IRC10:47
Zaraoh, mariadb, interesting!10:49
ZaraI'm currently looking into supporting more dbs (starting with other sql dbs, though)10:49
Zaratoday's plan is to spin up some other sql db (probably postgresql) and try to point storyboard at it, and see what breaks11:13
ZaraI'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
SotKeither will work just the same I expect, since it'll be a fresh db either way11:15
Zaraokay, I wasn't sure if there could be some weirdness running both dbs simultaneously.11:16
Zarajust showing my ignorance :)11:16
*** bethwhite has joined #storyboard11:21
*** jtomasek_ has joined #storyboard12:08
*** jtomasek_ has quit IRC12:28
*** jtomasek_ has joined #storyboard12:32
*** alexismonville has joined #storyboard12:33
* Zara is currently trying to convert the create-mysql-storyboard-db instructions to postgresql ones12:56
Zaraubuntu@zara-storyboard:~$ psql -U root -W;12:56
ZaraPassword for user root:12:56
Zarapsql: FATAL:  Peer authentication failed for user "root"12:56
Zarawell that was fun; 'night, all.12:56
* Zara searches around and gathers she should edit a config file12:57
*** jtomasek_ has quit IRC13:01
*** alexismonville has left #storyboard13:14
Zaraso I'm not expecting this to work yet13:36
Zarahttp://paste.openstack.org/show/597026/13:36
Zarais where I'm at atm13:37
Zaraalthough I have manually installed psycopg2 so am wondering if it's not being found in my venv, or if it's something else13:37
SotKtry adding it to requirements.txt and removing .tox/venv13:38
Zarathanks, will give that a go13:38
Zarahttp://paste.openstack.org/show/597032/ is where I'm at atm, not sure if it's my config or not.14:29
Zaraconnection = postgresql+psycopg2://postgres@127.0.0.1:3306/storyboard14:29
Zarais what I have as my line atm; mostly a guess14:29
pedroalvarezmaybe checking the connection from a different script, something like http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#special-reflection-options14:42
Zaraah, thanks14:43
ZaraI suspect my config is very wrong so that should help14:43
pedroalvarezi didn's spot anything obvious, other than there is no password specified14:45
Zarayeah, 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
Zarajust not sure exactly what the 'right' error will look like :D14:47
pedroalvarezhave you run the db migration scripts?14:49
ZaraI think maybe it's the port14:50
Zarayay, it was14:51
Zarait's still failing but cool14: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 again14:57
ZaraI guess we have liftoff!14:58
SotK\o/14:58
Zaradon't get too carried away. http://paste.openstack.org/show/597039/14:59
SotKhave you run the migrations?14:59
Zaranot yet14:59
Zaraat least not as far as I know?15:00
SotKthat'll be why it can't find the projects relation then15:00
Zara(just ran default tox command)15:00
ZaraI'm just happy it's connecting15:00
Zaraso tox -e venv "storyboard-db-manage --config-file ./etc/storyboard.conf upgrade head"15:00
SotKoh, huh15:01
Zaraoh no15:01
ZaraI mean that's what I'm about to do now15:01
Zarasorry15:01
SotKoh good15:01
Zarathat was confusing of me15:01
Zara:P15:01
ZaraI was just doing tox -e venv "storyboard-api --config-file ./etc/storyboard.conf" before15:01
SotKphew15:02
Zara(figured I should add that context for the logs )15:02
Zaraand now http://paste.openstack.org/show/597042/15:10
Zaraat a glance, I notice it mentions comments, and I know our comments are mysql-specific15:10
Zaraso... migration 17...15:11
Zaraapril 201415:13
Zarahttps://github.com/openstack-infra/storyboard/blob/master/storyboard/db/migration/alembic_migrations/versions/017_timeline_events.py15:15
SotKits probably possible to fix that migration somehow15:15
SotK(may involve fixing earlier ones)15:16
SotKupon learning about how foreign keys work in postgres with sqlalchemy15:16
Zarayeah15:16
ZaraI just started searching15:16
* Zara is reminded to merge 4270215:19
openstackgerritMerged openstack-infra/storyboard: Support MariaDB in the migration scripts  https://review.openstack.org/42702815:33
Zarahm, seems DROP FOREIGN KEY is a mysqlism while  DROP CONSTRAINTS is the more usual variant... but this code does say drop_constraint15:58
SotK'ALTER TABLE comments DROP CONSTRAINT comments_ibfk_1' in that log suggests it is being translated correctly too15: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 one15:59
Zarayeah16:05
* Zara discovers we never had a 009 migration16:13
Zarait goes 8, 1016:13
SotKinspired by windows16:14
Zaraokay... so I think maybe it's the very first migration that should be making the foreign key...16:15
ZaraI'm looking at16: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
Zaravs16: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
Zarafor tasks, above it16:17
SotKthat looks like it may be problematic16:17
Zara:D16:17
Zaraas spotted in 001_initial_version.py16:18
Zarabefore migration 17, comments are only mentioned in 001 and 00716:19
Zaraand I don't think 007 touches on this16:19
Zara(https://github.com/openstack-infra/storyboard/blob/master/storyboard/db/migration/alembic_migrations/versions/007_is_active_in_comments.py )16:20
SotKprobably "comments_ibfk_1" is the default for mysql but not postgres16:20
Zarayeah, maybe. I've tried just putting that in the first migration; guess we'll see what happens16:22
Zarahaha, this time it got to migration 1816:23
SotK\o/16:24
Zarabit of an ironic one...16:24
Zarahttp://paste.openstack.org/show/597049/16:24
SotK:D16:25
Zarathis is going to be one of those things where I wonder how anything ever worked16:27
SotKbecause mysql does magic16:27
Zara:)16:27
ZaraI don't know what this command *should* look like...16:39
SotKit reads like for some reason the task_priority enum isn't being created16:44
ZaraI'm gonna look at the earlier storyboard_priority one to see if I can spot a difference16:45
Zarahm, the other example is op.create_table(foo, bar, sa.Column('priority'...)) but this one is op.add_column(sa.Column('priority'...))16:51
Zaraso maybe it needs something saying which table?16:51
Zara(though it does have 'tasks' as the first parameter, so.)16:51
Zarayeah I *think the issue is that it's going `'priority', enums['task_priority'], nullable=True)`16:55
Zaraand it expects the first two things to be name, then type16:55
Zaraso maybe enum, not enums['task_priority']16:56
SotKenums['task_priority'] is a type (sa.Enum, created by the function above)16:56
SotKI'm not entirely sure why it doesn't work16:56
SotKhttp://stackoverflow.com/questions/14845203/altering-an-enum-field-using-alembic16:58
SotKhttp://stackoverflow.com/questions/37848815/sqlalchemy-postgresql-enum-does-not-create-type-on-db-migrate also related but not a useful fix for us16:59
ZaraI'm trying to work out why it would be fine with the syntax for version 001 but not for version 01817:02
*** diablo_rojo has joined #storyboard17:05
Zaraah I think maybe it needs to be named 'priority'17:07
Zaralike     storyboard_priority = sa.Enum(17:07
Zara        'Undefined', 'Low', 'Medium', 'High', 'Critical',17:07
Zara        name='priority')17:07
Zarathe 'name' at the bottom17:08
Zaraor not :(17:09
*** diablo_rojo has quit IRC17:24
Zaramigration 012 might be a better comparison17:25
openstackgerritZara proposed openstack-infra/storyboard: Fix db migration 001 so migration 017 works  https://review.openstack.org/42733117:47
Zarastill have no idea what's wrong with migration 18 but at least that won't get lost, now17:49
openstackgerritZara proposed openstack-infra/storyboard: Fix db migration 001 so migration 017 works  https://review.openstack.org/42733117:52
Zarait'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 #storyboard18:11
*** SpamapS has quit IRC19:39
SotKoh dear, this user migration bug is more complicated than I first thought19:55
* SotK wonders what a "Launchpad maintenance user" is19:59
*** zara_the_lemur__ has joined #storyboard20:00
* zara_the_lemur__ doesn't know; any docs?20:01
* zara_the_lemur__ finds nothing searching internet20:02
SotKI also found nothing20:02
zara_the_lemur__someone in #infra might now20:03
zara_the_lemur__now?20:03
zara_the_lemur__know20:03
*** diablo_rojo_phon has quit IRC22:00
*** jeblair has quit IRC22:16
*** jeblair has joined #storyboard22:22
*** diablo_rojo has joined #storyboard22:27
*** diablo_rojo has quit IRC22:54
*** diablo_rojo_phon has joined #storyboard23:55

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