Error while upgrading to 1.2

Hi there,

I tried to update Mautic from 1.1 to 1.2 by using “php console mautic:update:apply” which appeared to have completed just fine. But apparently not as Mautic is no longer working and I get the following error:



[LogicException]

Trying to register two bundles with the same name “MauticCloudStorageBundle”



Any ideas?



Thanks,

Martin

Hi there,
I tried to update Mautic from 1.1 to 1.2 by using “php console mautic:update:apply” which appeared to have completed just fine. But apparently not as Mautic is no longer working and I get the following error:

[LogicException]
Trying to register two bundles with the same name “MauticCloudStorageBundle”

Any ideas?

Thanks,
Martin

Old files weren’t deleted probably and now they are causing conflicts. You can try to remove them one by one (the one in addons folder should be removed) or backup files, delete them, upload fresh files and upload your config and data back as described in http://johnlinhart.com/blog/uh-oh-mautic-upgrade-was-not-successful .

Thanks Escopecz,
I will try this.

Regards,
Martin

@escopecz

Thanks for your blog post. I followed it and managed to get to the dashboard.

However, I cannot seem to get past the dashboard now. No matter what I click, nothing happens and I see this warning right below the dashboard map:

I downloaded the Mautic error_log and I’m getting this error:

[quote][22-Sep-2015 13:35:34 America/Chicago] PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/php54/lib/php/extensions/no-debug-non-zts-20100525/imagick.so’ - /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/imagick.so: undefined symbol: zend_new_interned_string in Unknown on line 0
[22-Sep-2015 13:35:34 America/Chicago] PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20090626[/quote]

Any thoughts on a next step?

Disregard the errors above. They disappeared once PHP was upgraded to 5.4. Apparently the htaccess file was calling for 5.3.

All is well.

I hit that error above. I did a clean install of 1.2 and then restored a backup of my database, but when I did a migration, I got errors from that:

[ps10514]$ php -v
PHP Warning:  Module 'imap' already loaded in Unknown on line 0
PHP 5.6.10 (cli) (built: Jun 15 2015 23:10:22)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
[ps10514]$ php app/console doctrine:migrations:migrate --env=prod
PHP Warning:  Module 'imap' already loaded in Unknown on line 0

                   Mautic Migrations


WARNING! You are about to execute a database migration that could result in schema changes and data lost. Are you sure you wish to continue? (y/n)y
Migrating up to 20150901000000 from 20150718000000

 ++ migrating 20150724000000

    -> ALTER TABLE oauth1_consumers CHANGE consumerKey consumer_key VARCHAR(255) NOT NULL, CHANGE consumerSecret consumer_secret VARCHAR(255) NOT NULL
    -> ALTER TABLE oauth1_access_tokens DROP FOREIGN KEY FK_C33AC86237FDBD6D
    -> DROP INDEX IDX_C33AC86237FDBD6D ON oauth1_access_tokens
    -> ALTER TABLE oauth1_access_tokens DROP FOREIGN KEY FK_C33AC862A76ED395
    -> DROP INDEX IDX_C33AC862A76ED395 ON oauth1_access_tokens
    -> ALTER TABLE oauth1_access_tokens CHANGE consumer_id consumer_id INT NOT NULL, CHANGE user_id user_id INT NOT NULL, CHANGE expiresat expires_at BIGINT DEFAULT NULL
    -> ALTER TABLE oauth1_access_tokens ADD CONSTRAINT FK_C33AC86237FDBD6D FOREIGN KEY (consumer_id) REFERENCES oauth1_consumers (id) ON DELETE CASCADE
    -> CREATE INDEX IDX_C33AC86237FDBD6D ON oauth1_consumers (id)
    -> ALTER TABLE oauth1_access_tokens ADD CONSTRAINT FK_C33AC862A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE
    -> CREATE INDEX IDX_C33AC862A76ED395 ON oauth1_access_tokens (user_id)
    -> ALTER TABLE oauth1_request_tokens DROP FOREIGN KEY FK_80F3C6EA37FDBD6D
    -> DROP INDEX IDX_80F3C6EA37FDBD6D ON oauth1_request_tokens
    -> ALTER TABLE oauth1_request_tokens CHANGE consumer_id consumer_id INT NOT NULL, CHANGE expiresat expires_at BIGINT NOT NULL
    -> ALTER TABLE oauth1_request_tokens ADD CONSTRAINT FK_80F3C6EA37FDBD6D FOREIGN KEY (consumer_id) REFERENCES oauth1_consumers (id) ON DELETE CASCADE
    -> CREATE INDEX IDX_80F3C6EA37FDBD6D ON oauth1_consumers (id)
    -> ALTER TABLE oauth2_clients CHANGE name name VARCHAR(255) NOT NULL
    -> ALTER TABLE oauth2_accesstokens CHANGE expires_at expires_at BIGINT DEFAULT NULL
    -> ALTER TABLE oauth2_refreshtokens CHANGE expires_at expires_at BIGINT DEFAULT NULL
    -> ALTER TABLE oauth2_authcodes CHANGE expires_at expires_at BIGINT DEFAULT NULL
    -> ALTER TABLE campaigns CHANGE name name VARCHAR(255) NOT NULL
    -> ALTER TABLE campaign_events CHANGE name name VARCHAR(255) NOT NULL
    -> ALTER TABLE campaign_lead_event_log DROP FOREIGN KEY FK_B7420BA1696C06D6
    -> DROP INDEX IDX_B7420BA1696C06D6 ON campaign_lead_event_log
    -> ALTER TABLE campaign_lead_event_log CHANGE ipaddress_id ip_id INT DEFAULT NULL
    -> ALTER TABLE campaign_lead_event_log ADD CONSTRAINT FK_B7420BA1A03F5E9F FOREIGN KEY (ip_id) REFERENCES ip_addresses (id)
    -> CREATE INDEX IDX_B7420BA1A03F5E9F ON campaign_lead_event_log (ip_id)
    -> ALTER TABLE audit_log CHANGE ip_address ip_address VARCHAR(45) NOT NULL
    -> ALTER TABLE ip_addresses CHANGE ip_address ip_address VARCHAR(45) NOT NULL
    -> ALTER TABLE email_donotemail CHANGE date_added date_added DATETIME NOT NULL
    -> ALTER TABLE emails CHANGE name name VARCHAR(255) NOT NULL, CHANGE email_type email_type LONGTEXT DEFAULT NULL
    -> ALTER TABLE email_assets_xref DROP FOREIGN KEY FK_CA3157785DA1941
    -> ALTER TABLE email_assets_xref DROP FOREIGN KEY FK_CA315778A832C1C9
    -> ALTER TABLE email_assets_xref ADD CONSTRAINT FK_CA3157785DA1941 FOREIGN KEY (asset_id) REFERENCES assets (id) ON DELETE CASCADE
    -> ALTER TABLE email_assets_xref ADD CONSTRAINT FK_CA315778A832C1C9 FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE CASCADE
    -> ALTER TABLE email_stats CHANGE retry_count retry_count INT DEFAULT NULL
    -> ALTER TABLE forms ADD COLUMN render_style bool DEFAULT NULL
    -> ALTER TABLE form_actions CHANGE name name VARCHAR(255) NOT NULL
    -> ALTER TABLE form_fields CHANGE form_id form_id INT NOT NULL
Migration 20150724000000 failed during Execution. Error An exception occurred while executing 'ALTER TABLE form_fields CHANGE form_id form_id INT NOT NULL':

SQLSTATE[HY000]: General error: 1832 Cannot change column 'form_id': used in a foreign key constraint 'FK_7C0B37265FF69B7D'



 [DoctrineDBALDBALException]
 An exception occurred while executing 'ALTER TABLE form_fields CHANGE form_id form_id INT NOT NULL':
 SQLSTATE[HY000]: General error: 1832 Cannot change column 'form_id': used in a foreign key constraint 'FK_7C0B37265FF69B7D'






 [PDOException]
 SQLSTATE[HY000]: General error: 1832 Cannot change column 'form_id': used in a foreign key constraint 'FK_7C0B37265FF69B7D'



doctrine:migrations:migrate [--write-sql] [--dry-run] [--query-time] [--configuration[="..."]] [--db-configuration[="..."]] [--em[="..."]] [version]

Seems that we’re missing a constraint that needs to be dropped. Not sure how most managed to avoid this so it must be something unique relatively unique that is triggering it.

If you have a back up, try applying the code change in https://github.com/mautic/mautic/pull/1007, restore your database backup then run the migrations command again.

See if that gets you past the issue.