# 500 error when removing contacts from campaign

**URL:** <https://forum.mautic.org/t/500-error-when-removing-contacts-from-campaign/11372>\
**Category:** Product Support\
**Created:** [October 13, 2019, 12:33pm UTC](https://forum.mautic.org/t/500-error-when-removing-contacts-from-campaign/11372 "2019-10-13T12:33:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![angelsguitar1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/angelsguitar1/32/841_2.png) [@angelsguitar1](https://forum.mautic.org/u/angelsguitar1)\
**Post date:** [October 13, 2019, 12:33pm UTC](https://forum.mautic.org/t/500-error-when-removing-contacts-from-campaign/11372/1 "2019-10-13T12:33:09Z")

</div>

**Your software**  
My Mautic version is: 2.15.3  
My PHP version is: 7.2.23

**Your problem**  
My problem is: When trying to remove some contacts from a campaign, I’m getting a 500 error.

These errors are showing in the log:

`[2019-10-13 08:28:22] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\SyntaxErrorException: "An exception occurred while executing 'REPLACE INTO mauag_campaign_lead_event_failed_log( `log\_id`, `date\_added`, `reason`) SELECT id, :dateAdded as date_added, :message as reason from mauag_campaign_lead_event_log WHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':dateAdded as date_added, :message as reason from mauag_campaign_lead_event_log ' at line 2" at /home/misbolet/marketing.angelsguitar.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 90 {"exception":"[object] (Doctrine\\DBAL\\Exception\\SyntaxErrorException(code: 0): An exception occurred while executing 'REPLACE INTO mauag_campaign_lead_event_failed_log( `log\_id`, `date\_added`, `reason`)\nSELECT id, :dateAdded as date_added, :message as reason from mauag_campaign_lead_event_log\nWHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation':\n\nYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':dateAdded as date_added, :message as reason from mauag_campaign_lead_event_log\n' at line 2 at /home/misbolet/marketing.angelsguitar.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:90, Doctrine\\DBAL\\Driver\\Mysqli\\MysqliException(code: 0): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':dateAdded as date_added, :message as reason from mauag_campaign_lead_event_log\n' at line 2 at /home/misbolet/marketing.angelsguitar.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:101)"} []`

Steps I have tried to fix the problem:

Tried to update database schema, but also shows an error and is unable to complete.

---

<div class="post-metadata">

**Author:** ![virgilwashere](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/virgilwashere/32/554_2.png) [@virgilwashere](https://forum.mautic.org/u/virgilwashere)\
**Post date:** [October 14, 2019, 6:35am UTC](https://forum.mautic.org/t/500-error-when-removing-contacts-from-campaign/11372/2 "2019-10-14T06:35:57Z")

</div>

> [@angelsguitar1](#):
>
> Steps I have tried to fix the problem:
> 
> Tried to update database schema, but also shows an error and is unable to complete.

Hi there,

Give this a go:

Click on the … … … … … … … … … … … down arrow to expand and make it readable here. ⬇

> [@Updating safely to 2.15.3](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/16):
>
> finishing the upgrade After running console mautic:update:apply you very much want to do a hard cache:clear by deleting the app/cache/prod directory. $ rm -rf ./app/cache/prod $ console cache:clear [image] $ console --version Mautic version 2.15.3 - app/prod That should give you a working login page (/s/login), but check the database mappings and schema. database schema checks migration status $ console doctrine:migrations:status == Configuration \>\> Name: …

---

<div class="post-metadata">

**Author:** ![angelsguitar1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/angelsguitar1/32/841_2.png) [@angelsguitar1](https://forum.mautic.org/u/angelsguitar1)\
**Post date:** [October 14, 2019, 3:45pm UTC](https://forum.mautic.org/t/500-error-when-removing-contacts-from-campaign/11372/3 "2019-10-14T15:45:58Z")

</div>

Hi @virgilwashere, Thanks for your reply.

I followed the recommendations, including clearing the cache and checking the database’s status. Seems that the database is in-sync:

```
[misbolet@spro4 app]$ php console doctrine:schema:update
Nothing to update - your database is already in sync with the current entity metadata.

```

However, I’m still getting the 500 error when trying to select several contacts and removing them from a campaign. Also, Mautic won’t allow me to turn off a campaign by directly editing a contact.

I did notice there are still migrations reported:

```
>> Available Migrations: 134
    >> New Migrations: 31

```

I’m quite new at Mautic so I’m not sure how to proceed in this case.

---

<div class="post-metadata">

**Author:** ![virgilwashere](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/virgilwashere/32/554_2.png) [@virgilwashere](https://forum.mautic.org/u/virgilwashere)\
**Post date:** [October 19, 2019, 2:58pm UTC](https://forum.mautic.org/t/500-error-when-removing-contacts-from-campaign/11372/4 "2019-10-19T14:58:10Z")

</div>

> [@angelsguitar1](#):
>
> I did notice there are still migrations reported:
> 
> ```auto
> >> Available Migrations: 134
> >> New Migrations: 31
> 
> ```
> 
> I’m quite new at Mautic so I’m not sure how to proceed in this case.

### Run migrations

#### dry run first

```auto
$ console doctrine:migrations:migrate --allow-no-migration --query-time --dry-run

                    Mautic Migrations

Executing dry run of migration up to 20190715065013 from 20190715065013

  ++ migrating 20190704154940

  ++ migrated (0.5s)

  ------------------------

  ++ finished in 0.5s
  ++ 1 migrations executed
  ++ 0 sql queries

```

#### real version

Swap `--dry-run` for `--no-interaction`

```auto
$ console doctrine:migrations:migrate --allow-no-migration --query-time --no-interaction
[2019-10-19 14:56:40]
[2019-10-19 14:56:40] Mautic Migrations
[2019-10-19 14:56:40]

[2019-10-19 14:56:40] Migrating up to 20190715065013 from 20190715065013
[2019-10-19 14:56:40]
  ++ migrating 20190704154940

[2019-10-19 14:56:41] Migration 20190704154940 was executed but did not result in any SQL statements.
[2019-10-19 14:56:41]
  ++ migrated (0.59s)
[2019-10-19 14:56:41]
  ------------------------

[2019-10-19 14:56:41] ++ finished in 0.59s
[2019-10-19 14:56:41] ++ 1 migrations executed
[2019-10-19 14:56:41] ++ 0 sql queries

```

Good luck!

Regards,

Virgil  
🇦🇺

---

<div class="post-metadata">

**Author:** ![angelsguitar1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/angelsguitar1/32/841_2.png) [@angelsguitar1](https://forum.mautic.org/u/angelsguitar1)\
**Post date:** [October 23, 2019, 2:06am UTC](https://forum.mautic.org/t/500-error-when-removing-contacts-from-campaign/11372/5 "2019-10-23T02:06:29Z")

</div>

Hi @virgilwashere.

I’m getting this after swapping `--dry-run` for` --no-interaction`:

```
[2019-10-23 02:04:03]
[2019-10-23 02:04:03] Mautic Migrations
[2019-10-23 02:04:03]

[2019-10-23 02:04:03] Migrating up to 20190715065013 from 20180220212444
[2019-10-23 02:04:03]
  ++ migrating 20180329185634

[2019-10-23 02:04:03] -> ALTER TABLE mauek_lead_event_log DROP FOREIGN KEY FK_EF546E0855458D
[2019-10-23 02:04:03] Migration 20180329185634 failed during Execution. Error An exception occurred while executing 'ALTER TABLE mauek_lead_event_log DROP FOREIGN KEY FK_EF546E0855458D':

Can't DROP 'FK_EF546E0855458D'; check that column/key exists

  [Doctrine\DBAL\Exception\DriverException]
  An exception occurred while executing 'ALTER TABLE mauek_lead_event_log DROP FOREIGN KEY FK_EF546E0855458D':

  Can't DROP 'FK_EF546E0855458D'; check that column/key exists

  [Doctrine\DBAL\Driver\Mysqli\MysqliException]
  Can't DROP 'FK_EF546E0855458D'; check that column/key exists

```

How should I proceed in this case?

---

<div class="post-metadata">

**Author:** ![virgilwashere](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/virgilwashere/32/554_2.png) [@virgilwashere](https://forum.mautic.org/u/virgilwashere)\
**Post date:** [October 25, 2019, 6:31pm UTC](https://forum.mautic.org/t/500-error-when-removing-contacts-from-campaign/11372/6 "2019-10-25T18:31:44Z")

</div>

> [@angelsguitar1](#):
>
> How should I proceed in this case?

The migration task wants to remove something that is’nt there.  
You haven’t by chance installed with _Softaculous_ have you?

Because the “solution” is to create the foreign key it’s looking for …

> <https://github.com/mautic/mautic/issues/6134#issuecomment-437827628>
>
> \*\*Please DO NOT report security vulnerabilities here. Send them to security@maut…ic.com instead.\*\*
> 
> What type of report is this:
> 
> | Q | A
> | ---| ---
> | Bug report? | Yes
> | Feature request? | No
> | Enhancement? | No
> 
> \## Description:
> Attempting to update from self-hosted Mautic 2.12.1 to 2.13.1 fails using both the in-app upgrade process and SSH command line upgrade script.
> 
> Environment: VPS cPanel Easy Apache 4, CentOS Linux release 7.5.1804 (Core)
> Installation of 2.12.1 was done via Softaculous installer and this is the first upgrade attempt.
> 
> \## If a bug:
> 
> | Q | A
> | --- | ---
> | Mautic version | 2.12.1
> | PHP version | 5.6.36
> 
> \### Steps to reproduce:
> 1. Click on the "Update now" notification in the Mautic notification UI
> 2. Observe error message is displayed for the "Processing Database Updates":
> !\[screenshot 2018-05-28 13 51 49\](https://user-images.githubusercontent.com/863419/40629704-0cd7f2e6-6282-11e8-995e-49c615d7e714.png)
> 3. Follow the command line update instructions posted here:
> \[Uh Oh, Mautic upgrade was not successful\](https://johnlinhart.com/blog/uh-oh-mautic-upgrade-was-not-successful)
> 4. Observe the errors produced when following command line session output:
> Command Line Output:
> \`\`\`
> \[~/www/mautic\]# php app/console cache:clear
> 
> // Clearing the cache for the prod environment with debug false                                                        
>                                                                                                                         
> \[OK\] Cache for the "prod" environment (debug=false) was successfully cleared.                                          
>                                                                                                                         
> \[~/www/mautic\]# php app/console mautic:update:find
> Great! You are running the current version of Mautic.
> 
> 
> \[~/www/mautic\]# php app/console doctrine:migration:status
> 
> == Configuration
> 
> \>\> Name: Mautic Migrations
> \>\> Database Driver: mysqli
> \>\> Database Name: afonseca\_mautic
> \>\> Configuration Source: manually configured
> \>\> Version Table Name: migrations
> \>\> Version Column Name: version
> \>\> Migrations Namespace: Mautic\\Migrations
> \>\> Migrations Directory: /home/afonseca/public\_html/mautic/app/migrations
> \>\> Previous Version: 2018-02-01 18:49:33 (20180201184933)
> \>\> Current Version: 2018-02-20 21:24:44 (20180220212444)
> \>\> Next Version: 2018-03-29 18:56:34 (20180329185634)
> \>\> Latest Version: 2018-04-19 14:59:34 (20180419145934)
> \>\> Executed Migrations: 103
> \>\> Executed Unavailable Migrations: 0
> \>\> Available Migrations: 109
> \>\> New Migrations: 6
> 
> \[~/www/mautic\]# php app/console doctrine:migration:migrate
>                                                          
> 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 20180419145934 from 20180220212444
> 
> ++ migrating 20180329185634
> 
> -\> ALTER TABLE lead\_event\_log DROP FOREIGN KEY FK\_753AF2E55458D
> Migration 20180329185634 failed during Execution. Error An exception occurred while executing 'ALTER TABLE lead\_event\_log DROP FOREIGN KEY FK\_753AF2E55458D':
> 
> Can't DROP 'FK\_753AF2E55458D'; check that column/key exists
> 
>                                                                                                          
> \[Doctrine\\DBAL\\Exception\\DriverException\]                                                              
> An exception occurred while executing 'ALTER TABLE lead\_event\_log DROP FOREIGN KEY FK\_753AF2E55458D':  
>                                                                                                          
> Can't DROP 'FK\_753AF2E55458D'; check that column/key exists                                            
>                                                                                                          
> 
>                                                                
> \[Doctrine\\DBAL\\Driver\\Mysqli\\MysqliException\]                
> Can't DROP 'FK\_753AF2E55458D'; check that column/key exists  
>                                                                
> 
> doctrine:migrations:migrate \[--write-sql\] \[--dry-run\] \[--query-time\] \[--allow-no-migration\] \[--configuration \[CONFIGURATION\]\] \[--db-configuration \[DB-CONFIGURATION\]\] \[--db DB\] \[--em EM\] \[--shard SHARD\] \[-h|--help\] \[-q|--quiet\] \[-v|vv|vvv|--verbose\] \[-V|--version\] \[--ansi\] \[--no-ansi\] \[-n|--no-interaction\] \[-s|--shell\] \[--process-isolation\] \[-e|--env ENV\] \[--no-debug\] \[--\] \<command\> \[\<version\>\]
> \`\`\`
> 
> \### Log errors: 
> 
> prod-2018-05-28.php
> \------------------------------------------------------------
> \`\`\`
> \[2018-05-28 20:51:04\] doctrine.DEBUG: SELECT COLUMN\_NAME AS Field, COLUMN\_TYPE AS Type, IS\_NULLABLE AS \`Null\`, COLUMN\_KEY AS \`Key\`, COLUMN\_DEFAULT AS \`Default\`, EXTRA AS Extra, COLUMN\_COMMENT AS Comment, CHARACTER\_SET\_NAME AS CharacterSet, COLLATION\_NAME AS Collation FROM information\_schema.COLUMNS WHERE TABLE\_SCHEMA = 'afonseca\_mautic' AND TABLE\_NAME = 'widgets' \[\] \[\]
> \[2018-05-28 20:51:04\] doctrine.DEBUG: SELECT DISTINCT k.\`CONSTRAINT\_NAME\`, k.\`COLUMN\_NAME\`, k.\`REFERENCED\_TABLE\_NAME\`, k.\`REFERENCED\_COLUMN\_NAME\` /\*!50116 , c.update\_rule, c.delete\_rule \*/ FROM information\_schema.key\_column\_usage k /\*!50116 INNER JOIN information\_schema.referential\_constraints c ON c.constraint\_name = k.constraint\_name AND c.table\_name = 'widgets' \*/ WHERE k.table\_name = 'widgets' AND k.table\_schema = 'afonseca\_mautic' /\*!50116 AND c.constraint\_schema = 'afonseca\_mautic' \*/ AND k.\`REFERENCED\_COLUMN\_NAME\` is not NULL \[\] \[\]
> \[2018-05-28 20:51:04\] doctrine.DEBUG: SELECT TABLE\_NAME AS \`Table\`, NON\_UNIQUE AS Non\_Unique, INDEX\_NAME AS Key\_name, SEQ\_IN\_INDEX AS Seq\_in\_index, COLUMN\_NAME AS Column\_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB\_PART AS Sub\_Part, PACKED AS Packed, NULLABLE AS \`Null\`, INDEX\_TYPE AS Index\_Type, COMMENT AS Comment FROM information\_schema.STATISTICS WHERE TABLE\_NAME = 'widgets' AND TABLE\_SCHEMA = 'afonseca\_mautic' \[\] \[\]
> \[2018-05-28 20:51:04\] doctrine.DEBUG: "ROLLBACK" \[\] \[\]
> \[2018-05-28 20:51:04\] doctrine.DEBUG: INSERT INTO migrations (version) VALUES (?) \["20160225000000"\] \[\]
> \[2018-05-28 20:51:04\] event.DEBUG: Notified event "console.terminate" to listener "Mautic\\CoreBundle\\EventListener\\ConsoleTerminateListener::onConsoleTerminate". \[\] \[\]
> \[2018-05-28 20:51:04\] event.DEBUG: Notified event "console.terminate" to listener "Symfony\\Bundle\\SwiftmailerBundle\\EventListener\\EmailSenderListener::onTerminate". \[\] \[\]
> \`\`\`
> 
> mautic\_prod-2018-05-28.php
> \------------------------------------------------------------
> \`\`\`
> \[2018-05-28 20:51:03\] mautic.CRITICAL: Uncaught PHP Exception Doctrine\\DBAL\\Exception\\InvalidFieldNameException: "An exception occurred while executing 'SELECT l0\_.id AS id\_0, l0\_.date\_added AS date\_added\_1, l0\_.client\_info AS client\_info\_2, l0\_.device AS device\_3, l0\_.device\_os\_name AS device\_os\_name\_4, l0\_.device\_os\_shortname AS device\_os\_shortname\_5, l0\_.device\_os\_version AS device\_os\_version\_6, l0\_.device\_os\_platform AS device\_os\_platform\_7, l0\_.device\_brand AS device\_brand\_8, l0\_.device\_model AS device\_model\_9, l0\_.device\_fingerprint AS device\_fingerprint\_10, l0\_.tracking\_id AS tracking\_id\_11, l0\_.lead\_id AS lead\_id\_12 FROM lead\_devices l0\_ WHERE l0\_.lead\_id = ? AND l0\_.tracking\_id IS NOT NULL' with params \[9598\]: Unknown column 'l0\_.tracking\_id' in 'field list'" at /home/afonseca/public\_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 71 {"exception":"\[object\] (Doctrine\\\\DBAL\\\\Exception\\\\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT l0\_.id AS id\_0, l0\_.date\_added AS date\_added\_1, l0\_.client\_info AS client\_info\_2, l0\_.device AS device\_3, l0\_.device\_os\_name AS device\_os\_name\_4, l0\_.device\_os\_shortname AS device\_os\_shortname\_5, l0\_.device\_os\_version AS device\_os\_version\_6, l0\_.device\_os\_platform AS device\_os\_platform\_7, l0\_.device\_brand AS device\_brand\_8, l0\_.device\_model AS device\_model\_9, l0\_.device\_fingerprint AS device\_fingerprint\_10, l0\_.tracking\_id AS tracking\_id\_11, l0\_.lead\_id AS lead\_id\_12 FROM lead\_devices l0\_ WHERE l0\_.lead\_id = ? AND l0\_.tracking\_id IS NOT NULL' with params \[9598\]:\\n\\nUnknown column 'l0\_.tracking\_id' in 'field list' at /home/afonseca/public\_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:71, Doctrine\\\\DBAL\\\\Driver\\\\Mysqli\\\\MysqliException(code: 0): Unknown column 'l0\_.tracking\_id' in 'field list' at /home/afonseca/public\_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:101)"} \[\]
> \[2018-05-28 13:51:58\] mautic.NOTICE: Doctrine\\DBAL\\Exception\\DriverException: An exception occurred while executing 'ALTER TABLE lead\_event\_log DROP FOREIGN KEY FK\_753AF2E55458D': Can't DROP 'FK\_753AF2E55458D'; check that column/key exists (uncaught exception) at /home/afonseca/public\_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115 while running console command \`doctrine:migrations:migrate\` \[\] \[\]
> \[2018-05-28 13:51:58\] mautic.ERROR: \[UPGRADE ERROR\] Exit code 1; Mautic Migrations \\ Migrating up to 20180419145934 from 20160225000000 \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ ++ migrating 20160615000000 \\ -\> DROP INDEX email\_date\_read ON email\_stats -\> CREATE INDEX email\_date\_read ON email\_stats (date\_read) \\ ++ migrated (0.68s) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ ++ migrating 20160630000001 \\ -\> ALTER TABLE leads ADD CONSTRAINT FK\_179045522298D193 FOREIGN KEY (stage\_id) REFERENCES stages (id) ON DELETE SET NULL -\> CREATE INDEX IDX\_179045522298D193 ON leads (stage\_id) \\ ++ migrated (2.08s) \\ ++ migrating 20160630000002 \\ -\> ALTER TABLE stages ADD CONSTRAINT FK\_2FA26A6412469DE2 FOREIGN KEY (category\_id) REFERENCES categories (id) ON DELETE SET NULL -\> CREATE INDEX IDX\_2FA26A6412469DE2 ON stages (category\_id) -\> ALTER TABLE leads DROP FOREIGN KEY FK\_E4E3B6E2298D193 \\ ++ migrated (0.88s) \\ ++ migrating 20160712000000 \\ -\> UPDATE lead\_fields SET properties = 'a:2:{s:9:"roundmode";s:1:"4";s:9:"precision";s:1:"2";}' WHERE alias = 'attribution' -\> ALTER TABLE stages DROP FOREIGN KEY FK\_D4C89D12469DE2 \\ ++ migrated (0.58s) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ ++ migrating 20160720000000 \\ -\> DELETE FROM lead\_utmtags WHERE utm\_campaign is null and utm\_content is null and utm\_medium is null and utm\_source is null and utm\_term is null \\ ++ migrated (0.5s) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ ++ migrating 20160726000001 \\ -\> ALTER TABLE emails ADD CONSTRAINT FK\_4C81E8529091A2FB FOREIGN KEY (translation\_parent\_id) REFERENCES emails (id) ON DELETE CASCADE -\> CREATE INDEX IDX\_4C81E8529091A2FB ON emails (translation\_parent\_id) -\> ALTER TABLE emails ADD CONSTRAINT FK\_4C81E85291861123 FOREIGN KEY (variant\_parent\_id) REFERENCES emails (id) ON DELETE CASCADE -\> CREATE INDEX IDX\_4C81E85291861123 ON emails (variant\_parent\_id) -\> ALTER TABLE pages ADD CONSTRAINT FK\_2074E5759091A2FB FOREIGN KEY (translation\_parent\_id) REFERENCES pages (id) ON DELETE CASCADE -\> CREATE INDEX IDX\_2074E5759091A2FB ON pages (translation\_parent\_id) -\> ALTER TABLE pages ADD CONSTRAINT FK\_2074E57591861123 FOREIGN KEY (variant\_parent\_id) REFERENCES pages (id) ON DELETE CASCADE -\> CREATE INDEX IDX\_2074E57591861123 ON pages (variant\_parent\_id) -\> ALTER TABLE dynamic\_content ADD CONSTRAINT FK\_20B9DEB29091A2FB FOREIGN KEY (translation\_parent\_id) REFERENCES dynamic\_content (id) ON DELETE CASCADE -\> CREATE INDEX IDX\_20B9DEB29091A2FB ON dynamic\_content (translation\_parent\_id) -\> ALTER TABLE dynamic\_content ADD CONSTRAINT FK\_20B9DEB291861123 FOREIGN KEY (variant\_parent\_id) REFERENCES dynamic\_content (id) ON DELETE CASCADE -\> CREATE INDEX IDX\_20B9DEB291861123 ON dynamic\_content (variant\_parent\_id) \\ ++ migrated (0.63s) \\ SS skipped (Reason: Schema includes this migration) \\ ++ migrating 20160731000000 \\ -\> update campaign\_lead\_event\_log log inner join campaign\_events events on log.event\_id = events.id set log.metadata = 'a:0:{}' where events.type = 'email.send' and log.metadata = 'a:2:{s:6:"failed";i:1;s:6:"reason";s:50:"mautic.notification.campaign.failed.not\_subscribed";}' -\> ALTER TABLE dynamic\_content DROP FOREIGN KEY FK\_8BC619709091A2FB -\> ALTER TABLE dynamic\_content DROP FOREIGN KEY FK\_8BC6197091861123 -\> ALTER TABLE emails DROP FOREIGN KEY FK\_63F74AAB9091A2FB -\> ALTER TABLE emails DROP FOREIGN KEY FK\_63F74AAB91861123 -\> ALTER TABLE pages DROP FOREIGN KEY FK\_39AA9B499091A2FB -\> ALTER TABLE pages DROP FOREIGN KEY FK\_39AA9B4991861123 \\ ++ migrated (0.61s) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ ++ migrating 20160926182807 \\ -\> insert into companies (companyname, is\_published) (SELECT DISTINCT TRIM(company), 1 from leads l left join companies c ON l.company = c.companyname where company IS NOT NULL and company \<\> '' and c.companyname is null) -\> insert into companies\_leads (company\_id, lead\_id, date\_added, manually\_added, manually\_removed) SELECT c.id, l.id, '2018-05-28 20:51:28', 0, 0 from leads l join companies c on c.companyname = l.company ON DUPLICATE KEY UPDATE company\_id = c.id; \\ ++ migrated (0.53s) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ ++ migrating 20161123225456 \\ Migration 20161123225456 was executed but did not result in any SQL statements. \\ ++ migrated (0.56s) \\ ++ migrating 20161124145649 \\ -\> ALTER TABLE lead\_frequencyrules CHANGE \`frequency\_number\` \`frequency\_number\` SMALLINT DEFAULT NULL; -\> ALTER TABLE lead\_frequencyrules CHANGE \`frequency\_time\` \`frequency\_time\` VARCHAR(25) DEFAULT NULL; \\ ++ migrated (0.51s) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ ++ migrating 20170108012944 \\ -\> ALTER TABLE push\_notifications CHANGE button button LONGTEXT NULL -\> ALTER TABLE dynamic\_content\_lead\_data DROP FOREIGN KEY FK\_C16B96AE55458D -\> ALTER TABLE dynamic\_content\_lead\_data CHANGE lead\_id lead\_id INT NOT NULL -\> ALTER TABLE dynamic\_content\_lead\_data ADD CONSTRAINT FK\_515B221B55458D FOREIGN KEY (lead\_id) REFERENCES leads (id) ON DELETE CASCADE \\ ++ migrated (0.55s) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ ++ migrating 20170127205928 \\ -\> UPDATE \`lead\_fields\` SET is\_fixed = 1, type = 'timezone', date\_modified = '2018-05-28 13:51:38' WHERE alias = 'timezone' -\> CREATE INDEX timezone\_search ON leads (timezone) \\ ++ migrated (0.65s) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ SS skipped (Reason: Schema includes this migration) \\ ++ migrating 20171208130606 \\ -\> ALTER TABLE lead\_devices ADD tracking\_id VARCHAR(255) DEFAULT NULL \\ ++ migrated (1.84s) \\ ++ migrating 20180105090000 \\ -\> ALTER TABLE pages CHANGE redirect\_url redirect\_url VARCHAR(2048) DEFAULT NULL; \\ ++ migrated (0.7s) \\ ++ migrating 20180117141613 \\ -\> ALTER TABLE tweets CHANGE text text VARCHAR(280) NOT NULL \\ ++ migrated (0.66s) \\ ++ migrating 20180201184933 \\ -\> ALTER TABLE assets ADD disallow TINYINT(1) NOT NULL; \\ ++ migrated (0.68s) \\ ++ migrating 20180220212444 \\ -\> ALTER TABLE pages ADD no\_index tinyint(1) DEFAULT NULL \\ ++ migrated (0.7s) \\ ++ migrating 20180329185634 \\ -\> ALTER TABLE lead\_event\_log DROP FOREIGN KEY FK\_753AF2E55458D Migration 20180329185634 failed during Execution. Error An exception occurred while executing 'ALTER TABLE lead\_event\_log DROP FOREIGN KEY FK\_753AF2E55458D': \\ Can't DROP 'FK\_753AF2E55458D'; check that column/key exists \\ \[Doctrine\\DBAL\\Exception\\DriverException\] An exception occurred while executing 'ALTER TABLE lead\_event\_log DROP FOREIGN KEY FK\_753AF2E55458D': \\ Can't DROP 'FK\_753AF2E55458D'; check that column/key exists \\ \[Doctrine\\DBAL\\Driver\\Mysqli\\MysqliException\] Can't DROP 'FK\_753AF2E55458D'; check that column/key exists \\ doctrine:migrations:migrate \[--write-sql\] \[--dry-run\] \[--query-time\] \[--allow-no-migration\] \[--configuration \[CONFIGURATION\]\] \[--db-configuration \[DB-CONFIGURATION\]\] \[--db DB\] \[--em EM\] \[--shard SHARD\] \[-h|--help\] \[-q|--quiet\] \[-v|vv|vvv|--verbose\] \[-V|--version\] \[--ansi\] \[--no-ansi\] \[-n|--no-interaction\] \[-s|--shell\] \[--process-isolation\] \[-e|--env ENV\] \[--no-debug\] \[--\] \<command\> \[\<version\>\] \\ \[\] \[\]
> \`\`\`

And I’d suggest using this SQL admin web interface if you don’t have one already setup.

> [https://www.adminer.org/latest-mysql-en.php](https://www.adminer.org/latest-mysql-en.php)  
> save it as **`adminer.php`**

Virgil

---

<div class="post-metadata">

**Author:** ![angelsguitar1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/angelsguitar1/32/841_2.png) [@angelsguitar1](https://forum.mautic.org/u/angelsguitar1)\
**Post date:** [October 25, 2019, 11:36pm UTC](https://forum.mautic.org/t/500-error-when-removing-contacts-from-campaign/11372/7 "2019-10-25T23:36:19Z")

</div>

> [@virgilwashere](#):
>
> You haven’t by chance installed with _Softaculous_ have you?

Yes, I used Softaculous. Seems like it wasn’t a good idea 😕

I do have PHPMyAdmin. However, I tried to follow the GitHub link you shared, but I’m getting this when executing the query:

`#1452 - Cannot add or update a child row: a foreign key constraint fails...`

Not sure what I might be doing wrong.

---

<div class="post-metadata">

**Author:** ![nathancyoung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nathancyoung/32/441_2.png) [@nathancyoung](https://forum.mautic.org/u/nathancyoung)\
**Post date:** [January 16, 2020, 6:13pm UTC](https://forum.mautic.org/t/500-error-when-removing-contacts-from-campaign/11372/8 "2020-01-16T18:13:24Z")

</div>

I’m experiencing the same error. I also initially installed on Softaculous.

If I install the next update directly, do you think that will fix the situation or is the missing piece from the Softaculous install always going to be missing?
