https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292015-04-28T04:41:17ZRedmineRedmine - Defect #19721: Upgrade from 2.6.4 to 3.0.2 fails with Mysql2::Error: Table 'email_addresses' already exists:https://www.redmine.org/issues/19721?journal_id=633862015-04-28T04:41:17ZToshi MARUYAMA
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs feedback</i></li></ul><p>I think your plugin created "email_addresses" table.</p> Redmine - Defect #19721: Upgrade from 2.6.4 to 3.0.2 fails with Mysql2::Error: Table 'email_addresses' already exists:https://www.redmine.org/issues/19721?journal_id=633982015-04-28T13:29:14ZDeoren Moor
<ul></ul><p>Toshi MARUYAMA wrote:</p>
<blockquote>
<p>I think your plugin created "email_addresses" table.</p>
</blockquote>
<p>Thank you for your feedback. We are running a vanilla installation with no plugins installed.</p>
<p>From the info page:</p>
<pre>
Redmine 2.6.4.stable.14227
Default administrator account changed True
Attachments directory writable True
Plugin assets directory writable (./public/plugin_assets) True
RMagick available (optional) True
ImageMagick convert available (optional) True
</pre>
<pre>
Environment:
Redmine version 2.6.4.stable.14227
Ruby version 1.8.7-p352 (2011-06-30) [i686-linux]
Rails version 3.2.21
Environment production
Database adapter MySQL
SCM:
Subversion 1.6.17
Git 1.7.9.5
Filesystem
Redmine plugins:
no plugin installed
</pre>
<p>Please let me know if I can provide further information.</p> Redmine - Defect #19721: Upgrade from 2.6.4 to 3.0.2 fails with Mysql2::Error: Table 'email_addresses' already exists:https://www.redmine.org/issues/19721?journal_id=633992015-04-28T13:38:49ZToshi MARUYAMA
<ul></ul><p>Thank you for your feedback.<br />If you have no idea who created "email_addresses" table,<br />you can drop or rename this table.<br />Ensure you have backup and table has no data.</p> Redmine - Defect #19721: Upgrade from 2.6.4 to 3.0.2 fails with Mysql2::Error: Table 'email_addresses' already exists:https://www.redmine.org/issues/19721?journal_id=634002015-04-28T13:42:01ZToshi MARUYAMA
<ul></ul><p>There is same post: <a class="message" href="https://www.redmine.org/boards/2/topics/46173">Redmine 3.0.1 from 2.6.0</a>.</p> Redmine - Defect #19721: Upgrade from 2.6.4 to 3.0.2 fails with Mysql2::Error: Table 'email_addresses' already exists:https://www.redmine.org/issues/19721?journal_id=634022015-04-28T13:53:36ZDeoren Moor
<ul></ul><p>Toshi MARUYAMA wrote:</p>
<blockquote>
<p>Thank you for your feedback.<br />If you have no idea who created "email_addresses" table,<br />You can drop or rename this table.<br />Ensure you have backup and table has no data.</p>
</blockquote>
<p>I checked and the table has 205 entries.</p>
<p><code>mysql> describe email_addresses;</code><br /><pre>
+------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| user_id | int(11) | NO | MUL | NULL | |
| address | varchar(255) | NO | | NULL | |
| is_default | tinyint(1) | NO | | 0 | |
| notify | tinyint(1) | NO | | 1 | |
| created_on | datetime | NO | | NULL | |
| updated_on | datetime | NO | | NULL | |
+------------+--------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)
</pre></p>
<p>It appears to contain valid email addresses for our users and is mapped to their user_id values.</p>
<p>I checked three other installations and didn't find the table listed. Could it have been created as part of a failed 2.6.3 to 3.0.1 migration? I thought I was careful to roll back all changes from that previous attempt, but maybe I missed something. I'll check the previous backups to see if I can pinpoint when the table was first created.</p> Redmine - Defect #19721: Upgrade from 2.6.4 to 3.0.2 fails with Mysql2::Error: Table 'email_addresses' already exists:https://www.redmine.org/issues/19721?journal_id=634032015-04-28T14:02:54ZToshi MARUYAMA
<ul></ul><p>It seems your entries were created by Redmine.<br /><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/tags/3.0.2/db/migrate/20150113211532_populate_email_addresses.rb">source:tags/3.0.2/db/migrate/20150113211532_populate_email_addresses.rb</a></p>
<p>I think there is inconsistency in "schema_migrations".<br /><a class="external" href="http://www.redmine.org/boards/2/topics/46173?r=46179#message-46179">http://www.redmine.org/boards/2/topics/46173?r=46179#message-46179</a></p> Redmine - Defect #19721: Upgrade from 2.6.4 to 3.0.2 fails with Mysql2::Error: Table 'email_addresses' already exists:https://www.redmine.org/issues/19721?journal_id=634042015-04-28T18:17:05ZDeoren Moor
<ul></ul><p>Thanks for the follow-up. I went back and compared a database backup taken the day before a previous failed 3.0.1 backup and the day after and found that is when the table first appeared. I was operating under a bad assumption that the <code>drop database</code> statement was present in the backup sql file. Thus I expected that when I imported the pre-upgrade backup file that it reverted the database to the former state.</p>
<p>Instead, the database was left with the old data and whatever new tables that were created prior to the failure. I'm going to restore a previous backup, list the tables and then restore to a recent backup and list the tables again. I'll diff them to see if there are any other tables still hanging around from the failed 3.0.1 upgrade.</p> Redmine - Defect #19721: Upgrade from 2.6.4 to 3.0.2 fails with Mysql2::Error: Table 'email_addresses' already exists:https://www.redmine.org/issues/19721?journal_id=634052015-04-28T18:37:58ZDeoren Moor
<ul></ul><p>Deoren Moor wrote:</p>
<blockquote>
<p>I'll diff them to see if there are any other tables still hanging around from the failed 3.0.1 upgrade.</p>
</blockquote>
<p>I just found the one table when I compared them.</p> Redmine - Defect #19721: Upgrade from 2.6.4 to 3.0.2 fails with Mysql2::Error: Table 'email_addresses' already exists:https://www.redmine.org/issues/19721?journal_id=634062015-04-29T01:37:15ZDeoren Moor
<ul></ul><p>I cloned the production box I tried to upgrade earlier and manually removed the <code>email_addresses</code> table. I then went back through the process from the beginning and am now running the 3.0.2 version of Redmine on the clone. I'm going to keep a copy of the clone around for a bit, so if you or any of the other devs would like me to run any tests against it let me know and I'll be happy to do so.</p> Redmine - Defect #19721: Upgrade from 2.6.4 to 3.0.2 fails with Mysql2::Error: Table 'email_addresses' already exists:https://www.redmine.org/issues/19721?journal_id=637002015-05-13T14:23:02ZAntoine Kolpacheque
<ul></ul><p>- Restore from dumpfile</p>
<p>- drop table email_addresses;</p>
<p>- bundle exec rake db:migrate RAILS_ENV=production</p> Redmine - Defect #19721: Upgrade from 2.6.4 to 3.0.2 fails with Mysql2::Error: Table 'email_addresses' already exists:https://www.redmine.org/issues/19721?journal_id=893152019-01-10T02:55:56ZMarius BÄ‚LTEANU
<ul><li><strong>Status</strong> changed from <i>Needs feedback</i> to <i>Closed</i></li><li><strong>Resolution</strong> set to <i>Invalid</i></li></ul><p>I'm closing this because is obsolete and there is nothing to do.</p>