Skip to content

Mail sync not working due to charset issue. #13696

Description

@jkladola

Steps to reproduce

  1. while syncing mail account using mail:account:sync <account_id> throwing error like,

Sync failed for 30:INBOX: An exception occurred while executing a query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xF0\x9F\xA7\x91\xF0\x9F...' for column nextcloud.oc_mail_messages.subject at row 1

  1. After searching little bit I tried to change charset and collation in database manually and repairing next cloud instance, deleting and recreating mail account, non of it worked.

  2. only after adding "'dbdriveroptions' => array( 1002 => 'SET NAMES utf8mb4 COLLATE utf8mb4_general_ci' )," to nextcloud's config.php. Syncing started working.

So, I guess the issue might be either in mysql configuration is not connecting using utf8mb4 or either the pdo is not connected using utf8mb4.

I have already seen your earlier bug of 2020 but the issue is still persist, may be...

Pardon me for my bad English and/or less knowledge on mysql/pdo connections.

Expected behavior

Now syncing.

Actual behavior

Not Syncing.

Mail app version

5.12.0

Nextcloud version

34.0.4

Mailserver or service

Custom IMAP

Operating system

Debian, turnkey installation

PHP engine version

PHP 8.2

Nextcloud memory caching

Redis

Web server

Apache (supported)

Database

MariaDB

Additional info

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions