# 2.6.1 Upgrade lots of "500" erros and campaigns NOT working

**URL:** <https://forum.mautic.org/t/2-6-1-upgrade-lots-of-500-erros-and-campaigns-not-working/7598>\
**Category:** Product Support\
**Created:** [February 20, 2017, 3:14am UTC](https://forum.mautic.org/t/2-6-1-upgrade-lots-of-500-erros-and-campaigns-not-working/7598 "2017-02-20T03:14:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![raymondkent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raymondkent/32/412_2.png) [@raymondkent](https://forum.mautic.org/u/raymondkent)\
**Post date:** [February 20, 2017, 3:14am UTC](https://forum.mautic.org/t/2-6-1-upgrade-lots-of-500-erros-and-campaigns-not-working/7598/1 "2017-02-20T03:14:59Z")

</div>

Hi there,  
  
  
  
I upgraded from 2.5.1 - (which was actually working fine with the campaigns working perfectly) to 2.6.1.  
  
  
  
I updated via the mautic dashboard.  
  
  
  
I am now getting LOTS of “Um I think I broke” 500 server errors at almost every screen. Campaigns are no longer working - but they were before.  
  
  
  
Here is a copy of the error if I run using the manual PHP file to run the processes  
  
I have run the schema update and it says it is fine.  
  
  
  
  
  
Executing console mautic:campaigns:trigger  
  
  
  
Triggering events for campaign 1  
  
Triggering first level events  
  
0 total events(s) to be processed in batches of 100  
  
0 event(s) executed  
  
  
  
Triggering scheduled events  
  
  
  
[DoctrineDBALExceptionInvalidFieldNameException]  
  
An exception occurred while executing ‘SELECT COUNT(c0\_.id) AS sclr\_0 FROM campaign\_lead\_event\_log c0\_ WHERE c0\_.campaign\_id = 1 AND c0\_.is\_scheduled = ? AND c0\_.trigger\_date \<= ?’ with params [1, “2017-02-20 02:23:27”]:  
  
SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘c0\_.id’ in ‘field list’  
  
  
  
[DoctrineDBALDriverPDOException]  
  
SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘c0\_.id’ in ‘field list’  
  
  
  
[PDOException]  
  
SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘c0\_.id’ in ‘field list’  
  
  
  
mautic:campaigns:trigger [-i|–campaign-id [CAMPAIGN-ID]] [-l|–batch-limit [BATCH-LIMIT]] [-m|–max-events [MAX-EVENTS]] [-f|–force] [-t|–timeout TIMEOUT] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [-n|–no-interaction] [-s|–shell] [-e|–env ENV]  
  
  
  
Here is a screen grab of the “campaign\_lead\_event\_log” table and I can’t see a field called “cO.id”  
  
Do I rename one of the existing ones, or is it in the PHP script?  
  
  
  
[screen grab](https://www.dropbox.com/s/h8bsqldoiaau04i/Screenshot%202017-02-20%2014.20.11.jpeg?dl=0)  
  
  
  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
  
If I run the schema update I get this error message and have no idea how to fix it.  
  
  
  
Executing console doctrine:schema:update --dump-sql  
  
  
  
[DoctrineDBALSchemaSchemaException]  
  
There is no column with name ‘id’ on table ‘campaign\_lead\_event\_log’.  
  
  
  
doctrine:schema:update [-f|–force] ] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [-n|–no-interaction] [-s|–shell] [-e|–env ENV]  
  
  
  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
  
  
  
Here is the migration status:  
  
  
  
Executing console doctrine:migration:status  
  
== Configuration

> > Name: Mautic Migrations  
> >   
> > Database Driver: pdo\_mysql  
> >   
> > Database Name: [XXXXXX]\_dmpages  
> >   
> > Configuration Source: manually configured  
> >   
> > Version Table Name: migrations  
> >   
> > Version Column Name: version  
> >   
> > Migrations Namespace: MauticMigrations  
> >   
> > Migrations Directory: /home3/[XXXXXX]/public\_html/dmpages.com/m/app/migrations  
> >   
> > Previous Version: 2017-01-13 14:39:22 (20170113143922)  
> >   
> > Current Version: 2017-01-27 20:59:28 (20170127205928)  
> >   
> > Next Version: Already at latest version  
> >   
> > Latest Version: 2017-01-27 20:59:28 (20170127205928)  
> >   
> > Executed Migrations: 71  
> >   
> > Executed Unavailable Migrations: 4  
> >   
> > Available Migrations: 67  
> >   
> > New Migrations: 0  
> >   
> >   
> >   
> >   
> >   
> > I can see that there are database table errors, but I don’t know how to fix them.  
> >   
> >   
> >   
> > \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> >   
> > Also here is what happens after I manually ran the schema update using the " [your-mautic-url]/s/update/schema" command in the browser window  
> >   
> >   
> >   
> > [picture showing shema has been successfully updated](https://www.dropbox.com/s/93pkiouj70m6qkd/Screenshot%202017-02-20%2014.43.29.jpeg?dl=0)

---

<div class="post-metadata">

**Author:** ![raymondkent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raymondkent/32/412_2.png) [@raymondkent](https://forum.mautic.org/u/raymondkent)\
**Post date:** [February 20, 2017, 3:14am UTC](https://forum.mautic.org/t/2-6-1-upgrade-lots-of-500-erros-and-campaigns-not-working/7598/2 "2017-02-20T03:14:59Z")

</div>

Hi there,

I upgraded from 2.5.1 - (which was actually working fine with the campaigns working perfectly) to 2.6.1.

I updated via the mautic dashboard.

I am now getting LOTS of “Um I think I broke” 500 server errors at almost every screen. Campaigns are no longer working - but they were before.

Here is a copy of the error if I run using the manual PHP file to run the processes  
I have run the schema update and it says it is fine.

Executing console mautic:campaigns:trigger

Triggering events for campaign 1  
Triggering first level events  
0 total events(s) to be processed in batches of 100  
0 event(s) executed

Triggering scheduled events

[DoctrineDBALExceptionInvalidFieldNameException]  
An exception occurred while executing ‘SELECT COUNT(c0\_.id) AS sclr\_0 FROM campaign\_lead\_event\_log c0\_ WHERE c0\_.campaign\_id = 1 AND c0\_.is\_scheduled = ? AND c0\_.trigger\_date \<= ?’ with params [1, “2017-02-20 02:23:27”]:  
SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘c0\_.id’ in ‘field list’

[DoctrineDBALDriverPDOException]  
SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘c0\_.id’ in ‘field list’

[PDOException]  
SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘c0\_.id’ in ‘field list’

mautic:campaigns:trigger [-i|–campaign-id [CAMPAIGN-ID]] [–scheduled-only] [–negative-only] [-l|–batch-limit [BATCH-LIMIT]] [-m|–max-events [MAX-EVENTS]] [-f|–force] [-t|–timeout TIMEOUT] [-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] [–]

Here is a screen grab of the “campaign\_lead\_event\_log” table and I can’t see a field called “cO.id”  
Do I rename one of the existing ones, or is it in the PHP script?

[screen grab](https://www.dropbox.com/s/h8bsqldoiaau04i/Screenshot%202017-02-20%2014.20.11.jpeg?dl=0)

* * *

If I run the schema update I get this error message and have no idea how to fix it.

Executing console doctrine:schema:update --dump-sql

[DoctrineDBALSchemaSchemaException]  
There is no column with name ‘id’ on table ‘campaign\_lead\_event\_log’.

doctrine:schema:update [–complete] [–dump-sql] [-f|–force] [–em [EM]] [-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] [–]

* * *

Here is the migration status:

Executing console doctrine:migration:status  
== Configuration

```
>> Name: Mautic Migrations
>> Database Driver: pdo_mysql
>> Database Name: [XXXXXX]_dmpages
>> Configuration Source: manually configured
>> Version Table Name: migrations
>> Version Column Name: version
>> Migrations Namespace: MauticMigrations
>> Migrations Directory: /home3/[XXXXXX]/public_html/dmpages.com/m/app/migrations
>> Previous Version: 2017-01-13 14:39:22 (20170113143922)
>> Current Version: 2017-01-27 20:59:28 (20170127205928)
>> Next Version: Already at latest version
>> Latest Version: 2017-01-27 20:59:28 (20170127205928)
>> Executed Migrations: 71
>> Executed Unavailable Migrations: 4
>> Available Migrations: 67
>> New Migrations: 0

```

I can see that there are database table errors, but I don’t know how to fix them.

* * *

Also here is what happens after I manually ran the schema update using the " [your-mautic-url]/s/update/schema" command in the browser window

[picture showing shema has been successfully updated](https://www.dropbox.com/s/93pkiouj70m6qkd/Screenshot%202017-02-20%2014.43.29.jpeg?dl=0)

---

<div class="post-metadata">

**Author:** ![raymondkent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raymondkent/32/412_2.png) [@raymondkent](https://forum.mautic.org/u/raymondkent)\
**Post date:** [February 20, 2017, 11:25am UTC](https://forum.mautic.org/t/2-6-1-upgrade-lots-of-500-erros-and-campaigns-not-working/7598/3 "2017-02-20T11:25:29Z")

</div>

@MxyzptlkFishStix that’s a bloody good question - One that I asked myself throughout most of today, when I figured out the campaigns had stopped!

The alert came up in the dashboard recommending to update, so I figured I should. BIG mistake.

I backed up the previous version database, but after a couple of days more records are created, people have unsubscribed, others have joined and the whole database is different.

Also I have no idea how to actually ‘roll back’ to v2.5.1.

I did install the manual cron “.php” file and ran the commands from browser, but I get this error when running the doctrine:schema updates (both of them).

[DoctrineDBALSchemaSchemaException]  
There is no column with name ‘id’ on table ‘campaign\_lead\_event\_log’.

What shold the campaign\_lead\_event\_log table strucutre look like.

this is what my table looks like

[https://www.dropbox.com/s/h8bsqldoiaau04i/Screenshot%202017-02-20%2014.20.11.jpeg?dl=0](https://www.dropbox.com/s/h8bsqldoiaau04i/Screenshot%202017-02-20%2014.20.11.jpeg?dl=0)

And there is no field called “id” yet it appears the sql statement is looking for one.

So either the sql statement is incorrect or the data table is incorrect. Not sure which one is wrong or how to fix.

I do appreciate you taking the time to assist, unfortunately this time the steps have not worked. ☹

---

<div class="post-metadata">

**Author:** ![Svet\_Zitrka](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@Svet\_Zitrka](https://forum.mautic.org/u/Svet_Zitrka)\
**Post date:** [February 21, 2017, 2:44pm UTC](https://forum.mautic.org/t/2-6-1-upgrade-lots-of-500-erros-and-campaigns-not-working/7598/4 "2017-02-21T14:44:15Z")

</div>

We had a similar problem, first try this [https://johnlinhart.com/blog/uh-oh-mautic-upgrade-was-not-successful](https://johnlinhart.com/blog/uh-oh-mautic-upgrade-was-not-successful)

If not help, so execute SQL commands from this souboru [https://github.com/mautic/mautic/blob/staging/app/migrations/Version20170106102310.php](https://github.com/mautic/mautic/blob/staging/app/migrations/Version20170106102310.php)

---

<div class="post-metadata">

**Author:** ![raymondkent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raymondkent/32/412_2.png) [@raymondkent](https://forum.mautic.org/u/raymondkent)\
**Post date:** [February 22, 2017, 5:39am UTC](https://forum.mautic.org/t/2-6-1-upgrade-lots-of-500-erros-and-campaigns-not-working/7598/5 "2017-02-22T05:39:25Z")

</div>

Hi @svet zitrka,

I tried all of the Uh-Oh stuff and none of it worked.

I can see that the SQL commands is what I need as I can see the changes to the database tables that it is trying to make and correlates wiht the error I am seeing.

Unfortunately this has not worked - perhaps I have done it incorrectly?

Steps performed. (NOTE: I only have access to file manager via a cpanel)

1. I created a new file called “fix.php” in the root directory of my mautic installation i.e. [websiteurl/mautictoot]/fix.php
2. I copied the full SQL PHP script from githib url above and pasted into the “fix.php” and saved the file.
3. I then ran [websiteurl/mautictoot]/fix.php via web browser.
4. I received the following error.

Parse error: syntax error, unexpected ‘class’ (T\_CLASS), expecting identifier (T\_STRING) in /mautic\_root\_directory\_path/fix.php on line 23  
Could you please let me know if I have done something wrong.

This is lines 18-21 from the php file:

1. /\*\*
2. 
  - Auto-generated Migration: Please modify to your needs!

3. \*/
4. class Version20170106102310 extends AbstractMauticMigration

I tried replacing the “20170106102310” with my old and current CLASS versions (at seperate times) and I get the same error,

```
>> Previous Version: 20170113143922
>> Current Version: 20170127205928

```

Or is there a specific place where the “php” file should be placed in order to run correctly?

---

<div class="post-metadata">

**Author:** ![raymondkent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raymondkent/32/412_2.png) [@raymondkent](https://forum.mautic.org/u/raymondkent)\
**Post date:** [February 22, 2017, 11:09am UTC](https://forum.mautic.org/t/2-6-1-upgrade-lots-of-500-erros-and-campaigns-not-working/7598/6 "2017-02-22T11:09:10Z")

</div>

OK.  
Issue is now SOLVED.

Thanks to everyone for your ideas and support.

I ended up having to run the SQL query directly in the database using php myadmin. @escopecz showed me how to change the SQL in the php file so I cold run it directly in the database.

The query I ran was

ALTER TABLE [databaseprefix]\_campaign\_lead\_event\_log  
DROP PRIMARY KEY,  
ADD id INT AUTO\_INCREMENT NOT NULL,  
ADD PRIMARY KEY(id),  
ADD rotation INTEGER NOT NULL DEFAULT 1,  
ADD INDEX [databaseprefix]\_campaign\_log\_channel (channel, channel\_id, lead\_id),  
ADD UNIQUE INDEX [databaseprefix]\_campaign\_rotation (event\_id, lead\_id, rotation),  
DROP INDEX [databaseprefix]\_campaign\_leads,  
ADD INDEX [databaseprefix]\_campaign\_leads (campaign\_id, lead\_id, rotation),  
DROP INDEX [databaseprefix]\_event\_upcoming\_search,  
ADD INDEX [databaseprefix]\_campaign\_event\_upcoming\_search (is\_scheduled, lead\_id);

Once I ran this update directly in the database I was then able to use the [php script](https://gist.githubusercontent.com/ChgoChad/fe9950c628ad8169cd27a58ee64106e8/raw/87254db7c2c28ee0f90601d9230c7965c533cada/commands.php) to then do all of the doctrine updates - this time successfully!

I’m back on track.

Thanks again to @escopecz@MxyzptlkFishStix and @Svet Zitrka for your generous assistance.
