# Twitter integration errors

**URL:** https://forum.mautic.org/t/twitter-integration-errors/15427
**Category:** Product Support
**Created:** [July 29, 2020, 1:16am UTC](https://forum.mautic.org/t/twitter-integration-errors/15427 "2020-07-29T01:16:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bulgin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bulgin/32/1001_2.png) [@bulgin](https://forum.mautic.org/u/bulgin)
#### Post date: [July 29, 2020, 1:16am UTC](https://forum.mautic.org/t/twitter-integration-errors/15427/1 "2020-07-29T01:16:41Z")

</div>

**Your software**  
My Mautic version is:v3.0.1  
My PHP version is: 7.2.32

**Your problem**  
My problem is:  
Tried to test drive twitter integration and chose to follow @potus for lack of anything better. Multitude of log errors. No contacts created. See below.

These errors are showing in the log:  
Can’t show the errors because this forum software does not allow more than 10 mentions in one post, and there are mentions in twitter error logs. . . so replaced mentions with the phrase “at”.

Here are the logs:  
cuting Monitor Item 2  
Creating new lead  
**An exception occurred while executing 'INSERT INTO xxxxxxxx\_leads** (is\_published, date\_added, created\_by, created\_by\_user, date\_modified, modified\_by, modified\_by\_user, checked\_out, checked\_out\_by, checked\_out\_by\_user, points, last\_active, internal, social\_cache, date\_identified, preferred\_profile\_image, title, firstname, lastname, company, position, email, phone, mobile, address1, address2, city, state, zipcode, timezone, country, owner\_id, stage\_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [1, “2020-07-29 00:57:00”, null, " “, null, null, null, null, null, null, 0, “2020-07-29 00:56:56”, “a:0:{}”, “a:1:{s:7:“Twitter”;a:3:{s:7:“profile”;a:9:{s:13:“profileHandle”;s:15:“lobstahsinmaine”;s:4:“name”;s:53:”\ud83e\udd85 \ud83c\uddfa\ud83c\uddf8 \ud83d\udc38~Freedom Patriot~\ud83d\udc38 \ud83c\uddfa\ud83c\uddf8 \ud83e\udd85”;s:8:“location”;s:10:“Maine, USA”;s:11:“description”;s:58:“I support President Trump and America! #notabot #TRUMP2020”;s:3:“url”;s:0:"";s:9:“time\_zone”;s:0:"";s:4:“lang”;s:0:"";s:5:“email”;s:0:"";s:12:“profileImage”;s:69:“[https://pbs.twimg.com/profile\_images/1258087138895163392/-Iz84TYd.jpg";}s:8:“activity”;a:3:{s:6:“tweets”;a:10:{i:0;a:4:{s:5:“tweet”;s:53:"RT](https://pbs.twimg.com/profile_images/1258087138895163392/-Iz84TYd.jpg%22;%7Ds:8:%22activity%22;a:3:%7Bs:6:%22tweets%22;a:10:%7Bi:0;a:4:%7Bs:5:%22tweet%22;s:53:%22RT) atJonessense: Trump wore a mask and 2 days later…”;s:3:“url”;s:65:“[https://twitter.com/812428408735039492/status/1288277098499649541";s:11:“coordinates”;N;s:9:“published”;s:30:"Wed](https://twitter.com/812428408735039492/status/1288277098499649541%22;s:11:%22coordinates%22;N;s:9:%22published%22;s:30:%22Wed) Jul 29 00:56:09 +0000 2020”;}i:1;a:4:{s:5:“tweet”;s:35:“RT atDonaldJTrumpJr: It 100% should.”;s:3:“url”;s:65:“[https://twitter.com/812428408735039492/status/1288276632852205568";s:11:“coordinates”;N;s:9:“published”;s:30:"Wed](https://twitter.com/812428408735039492/status/1288276632852205568%22;s:11:%22coordinates%22;N;s:9:%22published%22;s:30:%22Wed) Jul 29 00:54:18 +0000 2020”;}i:2;a:4:{s:5:“tweet”;s:95:“RT atDilaraEsengil: oh i love love love love her!!! I love her accent too! God BLESS her! AMEN!”;s:3:“url”;s:65:“[https://twitter.com/812428408735039492/status/1288276535393255431";s:11:“coordinates”;N;s:9:“published”;s:30:"Wed](https://twitter.com/812428408735039492/status/1288276535393255431%22;s:11:%22coordinates%22;N;s:9:%22published%22;s:30:%22Wed) Jul 29 00:53:55 +0000 2020”;}i:3;a:4:{s:5:“tweet”;s:142:“RT atMalcolmOutLoud: Host Terry Beatley - STERILIZING CHILDREN, Transgender Pediatrics [https://t.co/hYvD6zY6lt](https://t.co/hYvD6zY6lt) #Liberty [https://t.co/jLSaLku\u2026";s:3:“url”;s:65:“https://twitter.com/812428408735039492/status/1288276295864979457”;s:11:“coordinates”;N;s:9:“published”;s:30:"Wed](https://t.co/jLSaLku%5Cu2026%22;s:3:%22url%22;s:65:%22https://twitter.com/812428408735039492/status/1288276295864979457%22;s:11:%22coordinates%22;N;s:9:%22published%22;s:30:%22Wed) Jul 29 00:52:58 +0000 2020”;}i:4;a:4:{s:5:“tweet”;s:113:“RT atHeatherChilders: .atJim\_Jordan\u2019s opening video of riots and violence- #BarrHearing \n [https://t.co/wlxubNMca3";s:3:“url”;s:65:“https://twitter.com/812428408735039492/status/1288276246741360641”;s:11:“coordinates”;N;s:9:“published”;s:30:"Wed](https://t.co/wlxubNMca3%22;s:3:%22url%22;s:65:%22https://twitter.com/812428408735039492/status/1288276246741360641%22;s:11:%22coordinates%22;N;s:9:%22published%22;s:30:%22Wed) Jul 29 00:52:46 +0000 2020”;}i:5;a:4:{s:5:“tweet”;s:146:“RT atJennaEllisEsq: BREAKING: atGenFlynn\u2019s attorney Sidney Powell\u2019s Twitter has been suspended for her tweet on hydroxychloroquine that Presi\u2026”;s:3:“url”;s:65:“[https://twitter.com/812428408735039492/status/1288276041790873600";s:11:“coordinates”;N;s:9:“published”;s:30:"Wed](https://twitter.com/812428408735039492/status/1288276041790873600%22;s:11:%22coordinates%22;N;s:9:%22published%22;s:30:%22Wed) Jul 29 00:51:58 +0000 2020”;}i:6;a:4:{s:5:“tweet”;s:142:“RT atTheCollectiveQ: Office of the Press Secretary\nFOR IMMEDIATE RELEASE\nJuly 28, 2020\n\nPRESIDENT DONALD J. TRUMP IS COMMITTED TO ENDING AME\u2026”;s:3:“url”;s:65:“[https://twitter.com/812428408735039492/status/1288276000657354752";s:11:“coordinates”;N;s:9:“published”;s:30:"Wed](https://twitter.com/812428408735039492/status/1288276000657354752%22;s:11:%22coordinates%22;N;s:9:%22published%22;s:30:%22Wed) Jul 29 00:51:48 +0000 2020”;}i:7;a:4:{s:5:“tweet”;s:58:“RT atSantaFeChix: Great win for Upstate NY !!! GO KODAK !!!”;s:3:“url”;s:65:“[https://twitter.com/812428408735039492/status/1288275916813225984";s:11:“coordinates”;N;s:9:“published”;s:30:"Wed](https://twitter.com/812428408735039492/status/1288275916813225984%22;s:11:%22coordinates%22;N;s:9:%22published%22;s:30:%22Wed) Jul 29 00:51:28 +0000 2020”;}i:8;a:4:{s:5:“tweet”;s:179:“RT atGoldfish6801: atBreaking911 Yea baby!\n\nBring the pharmaceuticals back to the States. \n\n\<span class=“emoji-outer emoji-sizer”\>\<span class=“emoji-inner emoji1f60a”\>\</span\>\</span\>”;s:3:“url”;s:65:“[https://twitter.com/812428408735039492/status/1288275640123371528";s:11:“coordinates”;N;s:9:“published”;s:30:"Wed](https://twitter.com/812428408735039492/status/1288275640123371528%22;s:11:%22coordinates%22;N;s:9:%22published%22;s:30:%22Wed) Jul 29 00:50:22 +0000 2020”;}i:9;a:4:{s:5:“tweet”;s:144:“RT atJujukitty3: atbalboa\_ad atBreaking911 Not only Hydroxychloroquine. None of our meds or food should come from China. They can\u2019t be trusted\u2026”;s:3:“url”;s:65:“[https://twitter.com/812428408735039492/status/1288275483302473728";s:11:“coordinates”;N;s:9:“published”;s:30:"Wed](https://twitter.com/812428408735039492/status/1288275483302473728%22;s:11:%22coordinates%22;N;s:9:%22published%22;s:30:%22Wed) Jul 29 00:49:44 +0000 2020”;}}s:6:“photos”;a:1:{i:0;a:1:{s:3:“url”;s:47:“[https://pbs.twimg.com/media/EeBiX0wXYAcxLfv.jpg";}}s:4:“tags”;a:2:{s:7:“Liberty”;a:2:{s:5:“count”;i:1;s:3:“url”;s:39:“https://twitter.com/search?q=%23Liberty”;}s:11:“BarrHearing”;a:2:{s:5:“count”;i:1;s:3:“url”;s:43:“https://twitter.com/search?q=%23BarrHearing”;}}}s:11:“lastRefresh”;s:19:"2020-07-29](https://pbs.twimg.com/media/EeBiX0wXYAcxLfv.jpg%22;%7D%7Ds:4:%22tags%22;a:2:%7Bs:7:%22Liberty%22;a:2:%7Bs:5:%22count%22;i:1;s:3:%22url%22;s:39:%22https://twitter.com/search?q=%23Liberty%22;%7Ds:11:%22BarrHearing%22;a:2:%7Bs:5:%22count%22;i:1;s:3:%22url%22;s:43:%22https://twitter.com/search?q=%23BarrHearing%22;%7D%7D%7Ds:11:%22lastRefresh%22;s:19:%222020-07-29) 00:56:59”;}}", “2020-07-29 00:57:00”, “Twitter”, null, “\ud83e\udd85 \ud83c\uddfa\ud83c\uddf8 \ud83d\udc38~Freedom Patriot~\ud83d\udc38 \ud83c\uddfa\ud83c\uddf8”, “\ud83e\udd85”, null, null, null, null, null, null, null, null, null, null, null, “Maine, USA”, null, null]:

**SQLSTATE[HY000]: General error: 1366 Incorrect string value: ‘\xF0\x9F\xA6\x85 \xF0…’** for column ‘social\_cache’ at row 1  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
Steps I have tried to fix the problem:

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [July 29, 2020, 6:22am UTC](https://forum.mautic.org/t/twitter-integration-errors/15427/2 "2020-07-29T06:22:30Z")

</div>

Hi there,

There is a [known issue](https://github.com/mautic/mautic/issues/6617#issuecomment-560334720) when you are not using the database encoding `utf8mb4` and the collation type of `utf8mb4_unicode_ci`- can you confirm what you’re currently using with your database?

---

<div class="post-metadata">

### Author: ![bulgin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bulgin/32/1001_2.png) [@bulgin](https://forum.mautic.org/u/bulgin)
#### Post date: [July 29, 2020, 2:16pm UTC](https://forum.mautic.org/t/twitter-integration-errors/15427/3 "2020-07-29T14:16:13Z")

</div>

It _was_ the wrong encoding and I’ve since changed. Thank you for the information, much appreciated!

---

<div class="post-metadata">

### Author: ![bulgin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bulgin/32/1001_2.png) [@bulgin](https://forum.mautic.org/u/bulgin)
#### Post date: [July 30, 2020, 6:39pm UTC](https://forum.mautic.org/t/twitter-integration-errors/15427/4 "2020-07-30T18:39:44Z")

</div>

> [@Solved by rcheesley in post #2](#):
>
> database encoding utf8mb4

Hmmm… issues still persisting after changing collation and encoding as recommended. Running /bin/console mautic:social:monitoring  
still getting following errors. this time with a much reduced search set:

/usr/bin/ea-php72 /home/xxxxxx/public\_html/xxxxxxxxxx.com/bin/console mautic:social:monitoring  
Executing Monitor Item 6  
No new tweets  
Result Code: 0  
Executing Monitor Item 7  
No new tweets  
Result Code: 0  
Executing Monitor Item 8  
No new tweets  
Result Code: 0  
Executing Monitor Item 9  
No new tweets  
Result Code: 0  
Executing Monitor Item 10  
Updating existing lead ID #7279 (xxxxxxx)  
Creating new lead  
Creating new lead  
Creating new lead  
Creating new lead  
Creating new lead  
Creating new lead  
Creating new lead  
Creating new lead  
Creating new lead  
An exception occurred while executing ‘INSERT INTO xxxxxx\_leads (is\_published, date\_added, created\_by, created\_by\_user, date\_modified, modified\_by, modified\_by\_user, checked\_out, checked\_out\_by, checked\_out\_by\_user, points, last\_active, internal, social\_cache, date\_identified, preferred\_profile\_image, title, firstname, lastname, company, position, email, phone, mobile, address1, address2, city, state, zipcode, timezone, country, owner\_id, stage\_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [1, “2020-07-30 18:21:28”, null, " ", null, null, null, null, null, null, 0, “2020-07-29 22:41:56”, “a:0:{}”, “a:1:{s:7:"Twitter";a:3:{s:7:"profile";a:9:{s:13:"profileHandle";s:13:"BrilliantTech";s:4:"name";s:9:"Brilliant";s:8:"location";s:13:"San Mateo, CA";s:11:"description";s:145:"Transform any house or apartment into an easy-to-use\nsmart home with the Brilliant Smart Home System. We make Home Controls, Switches, and Plugs.";s:3:"url";s:23:"https://t.co/YPhoG9mqln";s:9:"time\_zone";s:0:"";s:4:"lang";s:0:"";s:5:"email";s:0:"";s:12:"profileImage";s:69:"https://pbs.twimg.com/profile\_images/1015367856173666304/usuEyt0T.jpg";}s:8:"activity";a:3:{s:6:"tweets";a:10:{i:0;a:4:{s:5:"tweet";s:142:"#ICYMI Yesterday we announced the Brilliant Command Center as a #multifamily property solution. Check out the artic\u2026 https://t.co/viFep0WpdZ";s:3:"url";s:65:"https://twitter.com/814211380349833216/status/1288605706778681344";s:11:"coordinates";N;s:9:"published";s:30:"Wed Jul 29 22:41:56 +0000 2020";}i:1;a:4:{s:5:"tweet";s:142:"RT ATResideo: As part of the Brilliant Command Center and Brilliant Smart Apartment System, ATBrilliantTech will soon be compatible with #Res\u2026";s:3:"url";s:65:"https://twitter.com/814211380349833216/status/1288252062266830850";s:11:"coordinates";N;s:9:"published";s:30:"Tue Jul 28 23:16:40 +0000 2020";}i:2;a:4:{s:5:"tweet";s:144:"Today we\u2019re excited to announce the launch of our new smart apartment platform for #multifamily properties. Now dev\u2026 https://t.co/QCbvBPPhAn";s:3:"url";s:65:"https://twitter.com/814211380349833216/status/1288251939877085184";s:11:"coordinates";N;s:9:"published";s:30:"Tue Jul 28 23:16:11 +0000 2020";}i:3;a:4:{s:5:"tweet";s:128:"RT ATlewis345: But these are like the smartest lightswitch ever \ud83e\udd2f! Few more to install. ATBrilliantTech https://t.co/mTMKXDZJ4K";s:3:"url";s:65:"https://twitter.com/814211380349833216/status/1287459280270921728";s:11:"coordinates";N;s:9:"published";s:30:"Sun Jul 26 18:46:26 +0000 2020";}i:4;a:4:{s:5:"tweet";s:142:"Brilliant CEO, Aaron Emigh, joined ATHomeTechPodcast for a discussion about how his upbringing shaped his perspectiv\u2026 https://t.co/D823iGs6fr";s:3:"url";s:65:"https://twitter.com/814211380349833216/status/1286811597063610368";s:11:"coordinates";N;s:9:"published";s:30:"Fri Jul 24 23:52:47 +0000 2020";}i:5;a:4:{s:5:"tweet";s:232:"For the latest in Brilliant happenings and #smarthome topics, the Brilliant Newsroom is a resource for all! \<span class="emoji-outer emoji-sizer"\>\<span class="emoji-inner emoji1f4a1"\>\</span\>\</span\>\>\>\u2026 https://t.co/bzwb9tkKFX";s:3:"url";s:65:"https://twitter.com/814211380349833216/status/1286372624294191105";s:11:"coordinates";N;s:9:"published";s:30:"Thu Jul 23 18:48:27 +0000 2020";}i:6;a:4:{s:5:"tweet";s:142:"RT ATI\_AM\_ODG: My smart cave just got smarter with ATBrilliantTech and their amazing home smart panel. #Brilliant #mybrilliant https://t.co/X\u2026";s:3:"url";s:65:"https://twitter.com/814211380349833216/status/1285292025299034112";s:11:"coordinates";N;s:9:"published";s:30:"Mon Jul 20 19:14:33 +0000 2020";}i:7;a:4:{s:5:"tweet";s:142:"Can you really gain full control of your entire home by swapping your light switch with Brilliant? YES! Check out t\u2026 https://t.co/4mA9ueMofp";s:3:"url";s:65:"https://twitter.com/814211380349833216/status/1285214719213735941";s:11:"coordinates";N;s:9:"published";s:30:"Mon Jul 20 14:07:21 +0000 2020";}i:8;a:4:{s:5:"tweet";s:135:"You asked, we listened. It’s here. \n\nStart shopping Brilliant on ATamazon today \>\> https://t.co/fBHSBrcog1 https://t.co/pQsJgLPwlr";s:3:"url";s:65:"https://twitter.com/814211380349833216/status/1283431347017613313";s:11:"coordinates";N;s:9:"published";s:30:"Wed Jul 15 16:00:52 +0000 2020";}i:9;a:4:{s:5:"tweet";s:143:"RT ATlukedimarco: I haven\u2019t been excited about a smart home device in a while but this ATBrilliantTech light switch is officially my new fav\u2026";s:3:"url";s:65:"https://twitter.com/814211380349833216/status/1282836443983949824";s:11:"coordinates";N;s:9:"published";s:30:"Tue Jul 14 00:36:56 +0000 2020";}}s:6:"photos";a:2:{i:0;a:1:{s:3:"url";s:47:"https://pbs.twimg.com/media/Edv3GNoXkAAQ1YF.jpg";}i:1;a:1:{s:3:"url";s:47:"https://pbs.twimg.com/media/Ec-qAPJWkAI8vyG.jpg";}}s:4:"tags";a:5:{s:5:"ICYMI";a:2:{s:5:"count";i:1;s:3:"url";s:37:"https://twitter.com/search?q=%23ICYMI";}s:11:"multifamily";a:2:{s:5:"count";i:2;s:3:"url";s:43:"https://twitter.com/search?q=%23multifamily";}s:9:"smarthome";a:2:{s:5:"count";i:1;s:3:"url";s:41:"https://twitter.com/search?q=%23smarthome";}s:9:"Brilliant";a:2:{s:5:"count";i:1;s:3:"url";s:41:"https://twitter.com/search?q=%23Brilliant";}s:11:"mybrilliant";a:2:{s:5:"count";i:1;s:3:"url";s:43:"https://twitter.com/search?q=%23mybrilliant";}}}s:11:"lastRefresh";s:19:"2020-07-30 18:21:27";}}”, “2020-07-30 18:21:28”, “Twitter”, null, null, “Brilliant”, null, null, null, null, null, null, null, null, null, null, null, “San Mateo, CA”, null, null]:

**SQLSTATE[HY000]: General error: 1366 Incorrect string value: ‘\xF0\x9F\xA4\xAF! …’ for column** ‘social\_cache’ at row 1  
Creating new lead  
The EntityManager is closed.  
Creating new lead  
The EntityManager is closed.

**In ORMException.php line 144:**

The EntityManager is closed.

mautic:social:monitoring [-i|–mid [MID]] [–batch-size BATCH-SIZE] [–query-count [QUERY-COUNT]] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–]

 ![database encoding collation](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/a9a6d9c3b375e3a177c0f78c929806e427ef5cbe.png)

---

<div class="post-metadata">

### Author: ![bulgin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bulgin/32/1001_2.png) [@bulgin](https://forum.mautic.org/u/bulgin)
#### Post date: [July 31, 2020, 12:53am UTC](https://forum.mautic.org/t/twitter-integration-errors/15427/5 "2020-07-31T00:53:03Z")

</div>

SOLVED:  
This post explained how to change the tables. Using phpmyadmin didn’t work. Needed to run the mysql commands listed in this link.

Specifically posted by @spdustin:

[https://github.com/mautic/mautic/issues/6007#issuecomment-384444879](https://github.com/mautic/mautic/issues/6007#issuecomment-384444879)

Running the following SQL against the Mautic database fixes the emoji issue with the Twitter plugin:

ALTER TABLE `leads`  
CONVERT TO CHARACTER SET utf8mb4  
COLLATE utf8mb4\_unicode\_ci;  
ALTER TABLE `leads`  
CHANGE social\_cache social\_cache LONGTEXT  
CHARACTER SET utf8mb4;

You may have to change the table name as per your setup. For example, some setups have pre-pended the table name with the user, so for example, the table listed above in the sql command as “leads” could in fact be, on your install, “name-of-user\_leads”.
