Redmine repository browser error upon upgrading to 3.0.1 - "Column 'address' in where clause is ambiguous"
Added by the fury about 10 years ago
I've moved my Redmine install from an old Windows server, running Redmine 2.6, to a new Ubuntu server, running Redmine 3.0.1. Migration worked pretty smoothly, I lost a few plugins that haven't been updated for 3.0 yet, but 'sall good. Everything seems to work so far except for the repository browser. I've updated the repository table, pointing to the new location of the git repository, since I didn't want to commit to running back through the history and re-linking all the issues where we forgot to reference the issue number from the commit.
I have also added a new reference to an existing repository on the server so that I can access it from git which is hooked up to Redmine authentication. I set it up through passenger/grack as described in HowTo_configure_Redmine_for_advanced_git_integration.
However, I am getting this error when trying to browse the repository I just added.
Started GET "/projects/projectname/settings/repositories" for ipaddress at 2015-04-08 21:23:11 -0400
Processing by ProjectsController#settings as HTML
Parameters: {"id"=>"projectname", "tab"=>"repositories"}
Current user: me (id=11)
Rendered projects/_form.html.erb (14.4ms)
Rendered projects/_edit.html.erb (15.7ms)
Rendered projects/settings/_modules.html.erb (5.9ms)
Rendered projects/settings/_members.html.erb (133.5ms)
Rendered projects/settings/_versions.html.erb (8.2ms)
Rendered projects/settings/_issue_categories.html.erb (1.8ms)
Rendered projects/settings/_wiki.html.erb (1.6ms)
Rendered projects/settings/_repositories.html.erb (6.5ms)
Rendered projects/settings/_boards.html.erb (14.6ms)
Rendered projects/settings/_activities.html.erb (12.1ms)
Rendered common/_tabs.html.erb (205.0ms)
Rendered projects/settings.html.erb within layouts/base (205.7ms)
Rendered plugins/redmine_wiki_extensions/app/views/wiki_extensions/_html_header.html.erb (0.4ms)
Rendered plugins/redmine_wiki_extensions/app/views/wiki_extensions/_body_bottom.html.erb (0.4ms)
Completed 200 OK in 241ms (Views: 223.6ms | ActiveRecord: 7.4ms)
Started GET "/projects/_projectname_/repository" for 70.60.56.210 at 2015-04-08 21:23:13 -0400
Processing by RepositoriesController#show as HTML
Parameters: {"id"=>"repositoryname"}
Current user: me (id=11)
Mysql2::Error: Column 'address' in where clause is ambiguous: SELECT DISTINCT `users`.* FROM `users` INNER JOIN `email_addresses` ON `email_addresses`.`user_id` = `users`.`id` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND (LOWER IN ('my@email.address')) ORDER BY `users`.`id` ASC LIMIT 1
Completed 500 Internal Server Error in 3971msActiveRecord::StatementInvalid (Mysql2::Error: Column 'address' in where clause is ambiguous: SELECT DISTINCT `users`.* FROM `users` INNER JOIN `email_addresses` ON `email_addresses`.`user_id` = `users`.`id` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND (LOWER IN ('my@email.address')) ORDER BY `users`.`id` ASC LIMIT 1):
app/models/user.rb:445:in `find_by_mail'
app/models/repository.rb:324:in `find_committer_user'
app/models/changeset.rb:106:in `before_create_cs'
app/models/repository/git.rb:218:in `save_revision'
app/models/repository/git.rb:207:in `block (2 levels) in save_revisions'
app/models/repository/git.rb:204:in `block in save_revisions'
app/models/repository/git.rb:203:in `each'
app/models/repository/git.rb:203:in `save_revisions'
app/models/repository/git.rb:153:in `fetch_changesets'
app/controllers/repositories_controller.rb:114:in `show'
Given that the email address I spotted in there is the email address I associated with my commits to this repository, I'm guessing it's able to access the repository but is having a problem writing changesets to the database due to this ambiguity (i.e. find_by_mail is failing, so it can't find out to whom to associate the commit)
I take it I'd get this error if I added a new commit in the existing repository. I can currently browse the repository that was already there, because all of the changesets copied over in the database migration.
Any ideas? That address field in the users table doesn't appear to have anything stored in it - they're all NULLs. If I remove the column, however, things break pretty spectacularly, so it seems something is depending on it.
I only have three plugins installed, wiki_extensions and wiki_graphviz, and a plugin I made myself which has some extra wiki macros I use for some internal documentation. As far as I know, none of these want to use an address field in the users table.
Replies (2)
RE: Redmine repository browser error upon upgrading to 3.0.1 - "Column 'address' in where clause is ambiguous"
-
Added by Leonel Iturralde about 10 years ago
why does your table users have a column 'address' ? Mine looks like this (redmine-3.0.1)
Captura1.PNG (13.9 KB) Captura1.PNG |
RE: Redmine repository browser error upon upgrading to 3.0.1 - "Column 'address' in where clause is ambiguous"
-
Added by the fury about 10 years ago
Looks like this must be left over from the redmine_people plugin I installed previously but did not uninstall before upgrading to 3.0.1. Oops.
I removed the offending fields and manually edited the schema.rb to remove them, since I couldn't use the plugins migrate task to migrate it to version 0.
Thanks!