hatnote/montage

Error with a specific user

Kristian87 opened this issue · 4 comments

As reported in the discussion on Commons, I found a problem during the creation of a second round for the voting process of WLE in Italy.

The warning was the following:
Internal server error: <ExceptionInfo [sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one_or_none()] (31 frames, last=Callpoint('one_or_none', 2698, 'sqlalchemy.orm.query', '/data/project/montage/www/python/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py', 72, ' "Multiple rows were found for one_or_none()")'))>

The same happend with a second campaign, and at the end I found that the problem disappeared (and I could therefore create the round) if I did not include among the jurors the User:Settimioma. It's very strange, because this user took part at Round 1, without any problem by my side as coordinator.

Thank you for your help, and I hope you can fix this bug.
Cristian

That's a new one for me! @slaporte have you seen this one before?

I confirm I see this for /v1/admin/round/379/edit, and appears to be a result of more than one User entry having the same username.

@Kristian87 It looks like User:SettimioMa (capital M), instead of User:Settimioma was added at one point. I just removed the capital M user, so your immediate problem should be fixed. You should not see any errors if you want to add User:Settimioma back to the round again.

@mahmoud So, MediaWiki usernames are case sensitive, but this line is not (I think thanks to our db settings, which may be different on labs than in my local test setup). I think we'll need to change it to something like:

user = rdb_session.query(User).filter(username == func.binary(username)).one_or_none()

I'm kinda curious how this is handled in MediaWiki?

I'm still not 100% sure how User:SettimioMa got past get_or_create_user, to be honest. It happened on 2018-07-02 21:46:25, and you can see the related errors in api_exec.

@slaporte thank you! Settimio (the real) don't know how it happens, but he can manage both users. I will suggest him to ask here and resolve the problem forever: https://meta.wikimedia.org/wiki/Steward_requests/Username_changes
I hope that this thread helped you to fix this type of bug.
Thank you for the interest, and hear form you soon.
Cristian