【问题标题】:OroCommerce Won't Sync with Incoming EmailsOroCommerce 不会与传入的电子邮件同步
【发布时间】:2021-07-22 10:12:54
【问题描述】:

无论我做什么,我都无法让 OroCommerce 与收到的电子邮件同步。我使用文档安装了 OroCommerce,我针对 utf8mb4 / unicode 优化了我的 mysql,我检查了我的 utf8mb4 的学说 dbal 设置,但根本没有电子邮件会同步。起初,我尝试使用 OroCrm 进行此操作,但我收到消息消费错误,这是 OroCommerce 没有给出这些问题的某种原因……或者可能只是每 30 多次重新安装一次。

无论如何,我在几年前发现的一篇帖子中提到尝试 bin/console oro:cron:imap-sync。这给了我一个线索,这就是为什么我尝试优化我的数据库并为 utf8mb4 正确设置所有设置(按照指南 @https://doc.oroinc.com/backend/setup/system-requirements/database-optimization/ 然后重新安装了 OroCommerce)。

这是我通过同步命令得到的当前错误集:

[myaccount@vegas crm]$ bin/console oro:cron:imap-sync
Resetting hanged email origins ...
Updated 0 row(s).
Finding an email origin ...
Found "my@email.com (vegas.myserver.net)" email origin. Id: 39.
Get folders enabled for sync...
Got 2 folder(s).
The folder "INBOX" is selected.
Previous max email UID "0"
Found 33 email(s).
The synchronization failed. Error: An exception occurred while executing 'INSERT INTO oro_email (serialized_data, created, subject, from_name, sent, importance, internaldate, is_head, message_id, multi_message_id, x_message_id, x_thread_id, refs, acceptLanguageHeader, body_synced, from_email_address_id, thread_id, email_body_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["Tjs=", "2021-04-29 03:14:09", "Your contacts in Senders Company \ud83d\udcc7", "Senders Name <senders@email.com>", "2021-03-12 16:00:07", 0, "2021-03-12 16:01:25", 1, "<20210312160007.1.FA8089C7D91E83BD@cio42337.sendersemail.com>", null, "", "", null, "", null, 107, null, null]:

SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xF0\x9F\x93\x87' for column 'subject' at row 1
The synchronization failed. Error: An exception occurred while executing 'INSERT INTO oro_email (serialized_data, created, subject, from_name, sent, importance, internaldate, is_head, message_id, multi_message_id, x_message_id, x_thread_id, refs, acceptLanguageHeader, body_synced, from_email_address_id, thread_id, email_body_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["Tjs=", "2021-04-29 03:14:09", "Your contacts in Senders Company \ud83d\udcc7", "Senders Name <senders@email.com>", "2021-03-12 16:00:07", 0, "2021-03-12 16:01:25", 1, "<20210312160007.1.FA8089C7D91E83BD@cio42337.sendersemail.com>", null, "", "", null, "", null, 107, null, null]:

SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xF0\x9F\x93\x87' for column 'subject' at row 1
Finding an email origin ...
Found "my@email.com (vegas.myserver.net)" email origin. Id: 39.
Exit because all origins have been synchronised.

In AbstractEmailSynchronizer.php line 622:
                                                                   
  The email synchronization failed for the following origins: 39.  
                                                               

我的服务器设置: CentOS Linux 版本 7.9.2009(核心) mysql版本:mysqld Ver 5.7.34 php 7.4.16 面板

我的.cnf:

[mysqld]
innodb_file_per_table = 0
wait_timeout = 28800
performance-schema=0
optimizer_search_depth=0
character-set-server=utfmb4
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
innodb_buffer_pool_size=134217728
max_allowed_packet=268435456
open_files_limit=40000
innodb_file_per_table=1


[client]
default-character-set = utf8mb4

任何可以帮助我的人,我将不胜感激。在过去的 3 天里,我一直在反复踢 orocommerce。有时我会遇到稍有不同的错误,但这个错误似乎非常一致,我很想通过安装阶段。

谢谢

【问题讨论】:

  • 您好,您使用的是哪个版本的应用程序?

标签: php symfony doctrine orocrm orocommerce


【解决方案1】:

首先,你的Mysql配置好像有错字:

character-set-server=utfmb4
character-set-server=utf8mb4

应该替换为

character-set-server=utf8mb4

一旦修复并重新启动 MySQL 服务器,请尝试通过运行以下 SQL 查询来检查配置值是否正确应用:

SHOW VARIABLES LIKE 'character_set_%';

如果编码不正确 - 您必须先修复配置。

另外,您可以尝试使用以下值更新应用程序配置(config/config.yml 文件),这应该强制执行默认编码:

doctrine:
    dbal:
        connections:
            default:
                options:
                    # PDO::MYSQL_ATTR_INIT_COMMAND
                    1002: 'SET NAMES utf8mb4, @@SESSION.optimizer_switch="block_nested_loop=off";'

无论如何,如果您在更改默认字符集之前创建了数据库,则数据库可能仍使用旧设置,您必须转换数据库编码,如下例所示: How to convert an entire MySQL database characterset and collation to UTF-8?

【讨论】:

    猜你喜欢
    • 2013-12-16
    • 1970-01-01
    • 1970-01-01
    • 2019-10-15
    • 1970-01-01
    • 1970-01-01
    • 2011-11-18
    • 1970-01-01
    • 2018-09-27
    相关资源
    最近更新 更多