|
I'm working on getting our StackExchange site migrated over to OSQA. I've successfully made it through the migration (using a sync from SVN yesterday evening) with only two problems.
Once worked around those problems, I ran into another one I don't know how to resolve: I can't log into any migrated accounts using OpenID. By default I was, after migration, logged into the account of one of the admins (not me). Then I logged out out of that admin account and tried to log into my account. But when I try to log in with the OpenID mapped to my StackExchange account, OSQA sees it as a new account and tries to create a new account for me. Any idea how to fix this without re-running the migration? And if I have to re-run the migration, any suggestions for how to work around the problem after migration, so I can log in? If it matters, my account on the StackExchange site is using myOpenID as a provider. |
|
First of all I need to explain your possible problems:
Check the database in the table forum_authkeyuserassociation, if there's any map between your user id and your open id. If not, you can add it safely, and you can be sure it will work. forum_authkeyuserassociation does contain an association between my (migrated) user account and one of my openid URLs. But my Alternate OpenID URL association is not present. Is this expected?
(01 Sep '10, 15:33)
Justin Grant
What wasn't expected to me is the existence of the alternate openid provider :) Is the first time I heard of it, in the dumps I had to annalyze, there wasn't, or I didn't notice the alternate openid field. Which is kind of natural, if you look closely to a dump file (specially Users.xml) you'll that the tag for a given field is ommited if the field is empty, and you're the first one to ever miss it. But if you know the name of the field in the xml file (or want to send a copy to us) well add that to the importer, is a 5 minute addition and we can put it in trunk asap.
(01 Sep '10, 21:24)
Hernani Cerq... ♦♦
The element name in the XML is "OpenIdAlt".
(01 Sep '10, 23:27)
Justin Grant
1
Also, about #2 above: is it expected that there will be an entry with id=1 in the DB? My DB (populated using the instructions on http://wiki.osqa.net/display/docs/Setting+up+a+development+environment+on+Windows) only had one row in the forum_user table prior to the SX import.
(01 Sep '10, 23:31)
Justin Grant
Yes, in a completely fresh database, that one user should have id 1.
(02 Sep '10, 07:33)
Hernani Cerq... ♦♦
I created a fresh DB twice (in postgres) and in neither case did my first user account end up with ID=1, even though I think I only had one user in the forum_user table before migration. I suspect this may be caused by failed attempts at initial user creation, because (on some DBMS's at least) failed transactions still increment the sequence counter even if the resulting rows aer rolled back. In any case, seems like the right solution is to adjust the logic to use the current user ID, not a hard-coded "1".
(02 Sep '10, 20:18)
Justin Grant
Almost correct :), in some rdbms (most of them actually) the indices are maintained by sequences. In the case of a failed transaction the sequence won't increment, what happens is that when you create for example a record with an assigned id of 1, and then delete that record, and create a new one, even though you deleted object #1, the sequence nextval is still 2, so the new record will be assigned an id of 2. But if the database is completely fresh (not just emptying the tables, but actually dumping and creating a new one) the user id will be 1, unless weird stuff is happening. Regarding the solution you propose, there are two issues. First, we would have to adjust other logic not related with the importer, and second of all, imagine that in your dump there is already user number 15, which happens to be the id of the user you're logged in with. Then we would have a collision of ids. And id 1 is perfect in this case because is almost a guarantee that is a non-existent id in the dump.
(02 Sep '10, 20:36)
Hernani Cerq... ♦♦
showing 5 of 7
show 2 more comments
|