Twitter integration errors

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 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 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 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 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 #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 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 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 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 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 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 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 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 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:

Hi there,

There is a known issue 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?

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

1 Like

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] [–]

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

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”.

1 Like