# Error mautic segments update

**URL:** <https://forum.mautic.org/t/error-mautic-segments-update/7542>\
**Category:** Product Support\
**Created:** [February 15, 2017, 4:36pm UTC](https://forum.mautic.org/t/error-mautic-segments-update/7542 "2017-02-15T16:36:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![webfuncional](https://avatars.discourse-cdn.com/v4/letter/w/3da27b/32.png) [@webfuncional](https://forum.mautic.org/u/webfuncional)\
**Post date:** [February 15, 2017, 4:36pm UTC](https://forum.mautic.org/t/error-mautic-segments-update/7542/1 "2017-02-15T16:36:34Z")

</div>

Hello,  
  
  
  
When I execute the command to update segments:  
  
  
  
/usr/bin/php-cli -q /home/myuser/my.subdomain/app/console mautic:segments:update  
  
  
  
The proccess stops with an error and it does not update all segments. Below you can see the result of the command. Can you help me with this issue?  
  
  
  
myuser@server [~]# /usr/bin/php-cli -q /home/myuser/my.subdomain/app/console mautic:segments:update  
  
Rebuilding contacts for segment 1  
  
0 total contact(s) to be added in batches of 300  
  
total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 21  
  
0 total contact(s) to be added in batches of 300  
  
total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 2  
  
0 total contact(s) to be added in batches of 300  
  
total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 20  
  
0 total contact(s) to be added in batches of 300  
  
total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 3  
  
0 total contact(s) to be added in batches of 300  
  
0 total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 63  
  
0 total contact(s) to be added in batches of 300  
  
total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 65  
  
0 total contact(s) to be added in batches of 300  
  
0 total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 64  
  
0 total contact(s) to be added in batches of 300  
  
0 total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 76  
  
0 total contact(s) to be added in batches of 300  
  
0 total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 75  
  
0 total contact(s) to be added in batches of 300  
  
0 total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 77  
  
0 total contact(s) to be added in batches of 300  
  
0 total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 58  
  
0 total contact(s) to be added in batches of 300  
  
total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 72  
  
0 total contact(s) to be added in batches of 300  
  
total contact(s) to be removed in batches of 300  
  
0 contact(s) affected  
  
  
  
Rebuilding contacts for segment 15  
  
  
  
  
  
[DoctrineDBALExceptionSyntaxErrorException]  
  
An exception occurred while executing ‘SELECT count(l.id) as lead\_count, ma  
  
x(l.id) as max\_id FROM mautic\_leads l LEFT JOIN mautic\_lead\_lists\_leads ll  
  
ON (ll.leadlist\_id = 15) AND (ll.lead\_id = l.id) AND (ll.date\_added \<= ‘201  
  
7-02-15 16:27:54’) WHERE (()) AND (ll.lead\_id IS NULL)’:  
  
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i  
  
n your SQL syntax; check the manual that corresponds to your MariaDB server  
  
version for the right syntax to use near ‘)) AND (ll.lead\_id IS NULL)’ at  
  
line 1  
  
  
  
  
  
  
  
[DoctrineDBALDriverPDOException]  
  
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i  
  
n your SQL syntax; check the manual that corresponds to your MariaDB server  
  
version for the right syntax to use near ‘)) AND (ll.lead\_id IS NULL)’ at  
  
line 1  
  
  
  
  
  
  
  
[PDOException]  
  
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i  
  
n your SQL syntax; check the manual that corresponds to your MariaDB server  
  
version for the right syntax to use near ‘)) AND (ll.lead\_id IS NULL)’ at  
  
line 1  
  
  
  
  
  
mautic:segments:update [-b|–batch-limit [BATCH-LIMIT]] [-m|–max-contacts [MAX-CONTACTS]] [-i|–list-id [LIST-ID]] [-f|–force] [-t|–timeout TIMEOUT] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [-n|–no-interaction] [-s|–shell] [-e|–env ENV]   
  
  
  
Kind regards,  
  
Bruno

---

<div class="post-metadata">

**Author:** ![webfuncional](https://avatars.discourse-cdn.com/v4/letter/w/3da27b/32.png) [@webfuncional](https://forum.mautic.org/u/webfuncional)\
**Post date:** [February 15, 2017, 4:36pm UTC](https://forum.mautic.org/t/error-mautic-segments-update/7542/2 "2017-02-15T16:36:34Z")

</div>

Hello,

When I execute the command to update segments:

/usr/bin/php-cli -q /home/myuser/my.subdomain/app/console mautic:segments:update

The proccess stops with an error and it does not update all segments. Below you can see the result of the command. Can you help me with this issue?

myuser@server [~]# /usr/bin/php-cli -q /home/myuser/my.subdomain/app/console mautic:segments:update  
Rebuilding contacts for segment 1  
0 total contact(s) to be added in batches of 300  
total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 21  
0 total contact(s) to be added in batches of 300  
total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 2  
0 total contact(s) to be added in batches of 300  
total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 20  
0 total contact(s) to be added in batches of 300  
total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 3  
0 total contact(s) to be added in batches of 300  
0 total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 63  
0 total contact(s) to be added in batches of 300  
total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 65  
0 total contact(s) to be added in batches of 300  
0 total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 64  
0 total contact(s) to be added in batches of 300  
0 total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 76  
0 total contact(s) to be added in batches of 300  
0 total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 75  
0 total contact(s) to be added in batches of 300  
0 total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 77  
0 total contact(s) to be added in batches of 300  
0 total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 58  
0 total contact(s) to be added in batches of 300  
total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 72  
0 total contact(s) to be added in batches of 300  
total contact(s) to be removed in batches of 300  
0 contact(s) affected

Rebuilding contacts for segment 15

[DoctrineDBALExceptionSyntaxErrorException]  
An exception occurred while executing ‘SELECT count(l.id) as lead\_count, ma  
x(l.id) as max\_id FROM mautic\_leads l LEFT JOIN mautic\_lead\_lists\_leads ll  
ON (ll.leadlist\_id = 15) AND (ll.lead\_id = l.id) AND (ll.date\_added \<= ‘201  
7-02-15 16:27:54’) WHERE (()) AND (ll.lead\_id IS NULL)’:  
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i  
n your SQL syntax; check the manual that corresponds to your MariaDB server  
version for the right syntax to use near ‘)) AND (ll.lead\_id IS NULL)’ at  
line 1

[DoctrineDBALDriverPDOException]  
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i  
n your SQL syntax; check the manual that corresponds to your MariaDB server  
version for the right syntax to use near ‘)) AND (ll.lead\_id IS NULL)’ at  
line 1

[PDOException]  
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i  
n your SQL syntax; check the manual that corresponds to your MariaDB server  
version for the right syntax to use near ‘)) AND (ll.lead\_id IS NULL)’ at  
line 1

mautic:segments:update [-b|–batch-limit [BATCH-LIMIT]] [-m|–max-contacts [MAX-CONTACTS]] [-i|–list-id [LIST-ID]] [-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] [–]

Kind regards,  
Bruno

---

<div class="post-metadata">

**Author:** ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/regis/32/25_2.png) [@regis](https://forum.mautic.org/u/regis)\
**Post date:** [March 12, 2017, 10:29pm UTC](https://forum.mautic.org/t/error-mautic-segments-update/7542/3 "2017-03-12T22:29:16Z")

</div>

Does anyone know anything about this error?  
Thanks!

---

<div class="post-metadata">

**Author:** ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/regis/32/25_2.png) [@regis](https://forum.mautic.org/u/regis)\
**Post date:** [March 13, 2017, 4:22pm UTC](https://forum.mautic.org/t/error-mautic-segments-update/7542/4 "2017-03-13T16:22:08Z")

</div>

Thanks! And do you know how can I locate this invalid character and fix the problem?

---

<div class="post-metadata">

**Author:** ![webfuncional](https://avatars.discourse-cdn.com/v4/letter/w/3da27b/32.png) [@webfuncional](https://forum.mautic.org/u/webfuncional)\
**Post date:** [March 14, 2017, 2:48pm UTC](https://forum.mautic.org/t/error-mautic-segments-update/7542/5 "2017-03-14T14:48:01Z")

</div>

> [@21263:@MxyzptlkFishStix](#):
>
> Check the emails in the particular segment(s) that is(are) giving you an issue. You might find something there. If not, fill a bug over on Mautic Github page.

Thank you for your help. I checked the segment looking for invalid characters but couldn’t find anything. So I filled a bug on Mautic Github page. Hope they can help me solve this issue.

Kind regards,  
Bruno

---

<div class="post-metadata">

**Author:** ![marogalli](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@marogalli](https://forum.mautic.org/u/marogalli)\
**Post date:** [July 25, 2017, 11:33am UTC](https://forum.mautic.org/t/error-mautic-segments-update/7542/6 "2017-07-25T11:33:43Z")

</div>

Hello, is there any solution for this issue @MxyzptlkFishStix ?

Aprecciate your help

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [July 25, 2017, 11:44am UTC](https://forum.mautic.org/t/error-mautic-segments-update/7542/7 "2017-07-25T11:44:53Z")

</div>

@MxyzptlkFishStix Didn’t we handle the error with the `WHERE (())` some weeks ago? I cannot find it in the forum.
