-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hebrew (all RTL?) Language Error #5834
Comments
I find similar logs in other tickets. #4925 (comment) for example. |
I encountered this using Chinese, GB1803 0, |
Looks like \Horde_Mime_Part::getCharset is returning values that are not always compatible with PHP charsets, as it uses the Mime Header content type label to extract this information from an email. @xinstein can you post the complete error message please? |
@spacemule would you be able to send me an email as .eml attachment to [email protected] with hebrew content? I am currenly testing a fix, but I'm not sure just copy pasting a hebrew lorem ipsum is enough. |
I sent three as an attachment. They're from a domain that matches my username here in case they end up in spam. Thanks! |
@spacemule Thanks for the emails! I tested my changes with them and it looks ok. |
Who here is able to check out this branch here: #5882 and test the changes, too? |
@spacemule if you're not busy I would apprechiate if you could test these changes for me 🙏 @xinstein you too if possible |
This comment has been minimized.
This comment has been minimized.
@xinstein can you please send me your nextcloud.log to [email protected]? You can find it in your data folder. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@miaulalala I'm working on this now. Unfortunately, I'm not much of a web developer, and I cannot find the documentation to install this branch manually. I'm assuming it's occ app:install, but is it expecting a tarball or a filesystem directory? |
@spacemule simply git-cloning into the custom_apps folder will do. Also, I might have mis-stated my situation. The error message I encountered is the same as in the first post ( |
@spacemule xinstein is right. Do you know how to git clone the app? Then you can use git to checkout the branch |
@spacemule You might also need to chown the cloned folder to the user running the nextcloud instance |
@miaulalala I just installed the patch #5882 to see if the error is disappearing on my side (was in the cron job for me). I'll let you know after a while to be sure it does not come back. |
@miaulalala I cannot see anymore the error after applying the patch. And it appears again after removing the patch. But when the patch is active I still have sync error raised (not sure if this is related to the patch or not, but the stack does not mention the modified file by the patch). I am attaching the log in case it is relevant: Log of error raised (patch active){
"reqId": "j6fDPFnTgXCL2H4pYMt8",
"level": 3,
"time": "2022-02-02T15:25:06+00:00",
"remoteAddr": "",
"user": "--",
"app": "mail",
"method": "",
"url": "--",
"message": "Cron mail sync failed for account {accountId}",
"userAgent": "--",
"version": "22.2.3.0",
"exception": {
"Exception": "OCA\\Mail\\Exception\\ServiceException",
"Message": "Sync failed for 3:INBOX: syntax error, unexpected token \"use\", expecting \",\" or \";\"",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/custom_apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
"line": 135,
"function": "sync",
"class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
"type": "->",
"args": [
{
"__class__": "OCA\\Mail\\Account"
},
{
"id": 43,
"__class__": "OCA\\Mail\\Db\\Mailbox"
},
{
"__class__": "OC\\AppFramework\\ScopedPsrLogger"
},
42,
null,
false,
true
]
},
{
"file": "/var/www/html/custom_apps/mail/lib/BackgroundJob/SyncJob.php",
"line": 109,
"function": "syncAccount",
"class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
"type": "->",
"args": [
{
"__class__": "OCA\\Mail\\Account"
},
{
"__class__": "OC\\AppFramework\\ScopedPsrLogger"
}
]
},
{
"file": "/var/www/html/lib/public/BackgroundJob/Job.php",
"line": 79,
"function": "run",
"class": "OCA\\Mail\\BackgroundJob\\SyncJob",
"type": "->",
"args": [
{
"accountId": 3
}
]
},
{
"file": "/var/www/html/lib/public/BackgroundJob/TimedJob.php",
"line": 63,
"function": "execute",
"class": "OCP\\BackgroundJob\\Job",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
},
{
"__class__": "OC\\Log"
}
]
},
{
"file": "/var/www/html/cron.php",
"line": 127,
"function": "execute",
"class": "OCP\\BackgroundJob\\TimedJob",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
},
{
"__class__": "OC\\Log"
}
]
}
],
"File": "/var/www/html/custom_apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
"Line": 249,
"Previous": {
"Exception": "ParseError",
"Message": "syntax error, unexpected token \"use\", expecting \",\" or \";\"",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/lib/composer/composer/ClassLoader.php",
"line": 346,
"function": "Composer\\Autoload\\includeFile",
"args": [
"/var/www/html/custom_apps/mail/lib//Model/IMAPMessage.php"
]
},
{
"file": "/var/www/html/custom_apps/mail/lib/IMAP/MessageMapper.php",
"line": 249,
"function": "loadClass",
"class": "Composer\\Autoload\\ClassLoader",
"type": "->",
"args": [
"OCA\\Mail\\Model\\IMAPMessage"
]
},
{
"function": "OCA\\Mail\\IMAP\\{closure}",
"class": "OCA\\Mail\\IMAP\\MessageMapper",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/custom_apps/mail/lib/IMAP/MessageMapper.php",
"line": 256,
"function": "array_map",
"args": [
{
"__class__": "Closure"
},
[
"*** sensitive parameter replaced ***",
{
"__class__": "Horde_Imap_Client_Data_Fetch"
},
{
"__class__": "Horde_Imap_Client_Data_Fetch"
}
]
]
},
{
"file": "/var/www/html/custom_apps/mail/lib/IMAP/Sync/Synchronizer.php",
"line": 99,
"function": "findByIds",
"class": "OCA\\Mail\\IMAP\\MessageMapper",
"type": "->",
"args": [
{
"cacheFields": [
"HICenv",
"HICflags",
"HIChdrs",
"HICdate",
"HICsize",
"And 1 more entries, set log level to debug to see all entries"
],
"changed": true,
"statuscache": true,
"__class__": "Horde_Imap_Client_Socket"
},
"INBOX",
[
77205,
77206,
77208
]
]
},
{
"file": "/var/www/html/custom_apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
"line": 354,
"function": "sync",
"class": "OCA\\Mail\\IMAP\\Sync\\Synchronizer",
"type": "->",
"args": [
{
"cacheFields": [
"HICenv",
"HICflags",
"HIChdrs",
"HICdate",
"HICsize",
"And 1 more entries, set log level to debug to see all entries"
],
"changed": true,
"statuscache": true,
"__class__": "Horde_Imap_Client_Socket"
},
{
"__class__": "OCA\\Mail\\IMAP\\Sync\\Request"
},
8
]
},
{
"file": "/var/www/html/custom_apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
"line": 230,
"function": "runPartialSync",
"class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
"type": "->",
"args": [
{
"__class__": "OCA\\Mail\\Account"
},
{
"id": 43,
"__class__": "OCA\\Mail\\Db\\Mailbox"
},
{
"__class__": "OC\\AppFramework\\ScopedPsrLogger"
},
42,
null
]
},
{
"file": "/var/www/html/custom_apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
"line": 135,
"function": "sync",
"class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
"type": "->",
"args": [
{
"__class__": "OCA\\Mail\\Account"
},
{
"id": 43,
"__class__": "OCA\\Mail\\Db\\Mailbox"
},
{
"__class__": "OC\\AppFramework\\ScopedPsrLogger"
},
42,
null,
false,
true
]
},
{
"file": "/var/www/html/custom_apps/mail/lib/BackgroundJob/SyncJob.php",
"line": 109,
"function": "syncAccount",
"class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
"type": "->",
"args": [
{
"__class__": "OCA\\Mail\\Account"
},
{
"__class__": "OC\\AppFramework\\ScopedPsrLogger"
}
]
},
{
"file": "/var/www/html/lib/public/BackgroundJob/Job.php",
"line": 79,
"function": "run",
"class": "OCA\\Mail\\BackgroundJob\\SyncJob",
"type": "->",
"args": [
{
"accountId": 3
}
]
},
{
"file": "/var/www/html/lib/public/BackgroundJob/TimedJob.php",
"line": 63,
"function": "execute",
"class": "OCP\\BackgroundJob\\Job",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
},
{
"__class__": "OC\\Log"
}
]
},
{
"file": "/var/www/html/cron.php",
"line": 127,
"function": "execute",
"class": "OCP\\BackgroundJob\\TimedJob",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
},
{
"__class__": "OC\\Log"
}
]
}
],
"File": "/var/www/html/custom_apps/mail/lib/Model/IMAPMessage.php",
"Line": 57
},
"CustomMessage": "Cron mail sync failed for account {accountId}"
}
} |
Thanks everyone for testing this! @doc75 I'm not sure where that error is coming from, can you have a look at your /lib/Service/Sync/ImapToDbSynchronizer.php file and possibly copy&paste the |
Here is the content of the file ImapToDbSynchronizer.php: public function sync(Account $account,
Mailbox $mailbox,
LoggerInterface $logger,
int $criteria = Horde_Imap_Client::SYNC_NEWMSGSUIDS | Horde_Imap_Client::SYNC_FLAGSUIDS | Horde_Imap_Client::SYNC_VANISHEDUIDS,
array $knownUids = null,
bool $force = false,
bool $batchSync = false): void {
if ($mailbox->getSelectable() === false) {
return;
}
if ($force || ($criteria & Horde_Imap_Client::SYNC_NEWMSGSUIDS)) {
$logger->debug("Locking mailbox " . $mailbox->getId() . " for new messages sync");
$this->mailboxMapper->lockForNewSync($mailbox);
}
if ($force || ($criteria & Horde_Imap_Client::SYNC_FLAGSUIDS)) {
$logger->debug("Locking mailbox " . $mailbox->getId() . " for changed messages sync");
$this->mailboxMapper->lockForChangeSync($mailbox);
}
if ($force || ($criteria & Horde_Imap_Client::SYNC_VANISHEDUIDS)) {
$logger->debug("Locking mailbox " . $mailbox->getId() . " for vanished messages sync");
$this->mailboxMapper->lockForVanishedSync($mailbox);
}
try {
if ($force
|| $mailbox->getSyncNewToken() === null
|| $mailbox->getSyncChangedToken() === null
|| $mailbox->getSyncVanishedToken() === null) {
$logger->debug("Running initial sync for " . $mailbox->getId());
$this->runInitialSync($account, $mailbox, $logger);
} else {
try {
$logger->debug("Running partial sync for " . $mailbox->getId());
$this->runPartialSync($account, $mailbox, $logger, $criteria, $knownUids);
} catch (UidValidityChangedException $e) {
$logger->warning('Mailbox UID validity changed. Wiping cache and performing full sync for ' . $mailbox->getId());
$this->resetCache($account, $mailbox);
$logger->debug("Running initial sync for " . $mailbox->getId() . " after cache reset");
$this->runInitialSync($account, $mailbox, $logger);
} catch (MailboxDoesNotSupportModSequencesException $e) {
$logger->warning('Mailbox does not support mod-sequences error occured. Wiping cache and performing full sync for ' . $mailbox->getId(), [
'exception' => $e,
]);
$this->resetCache($account, $mailbox);
$logger->debug("Running initial sync for " . $mailbox->getId() . " after cache reset - no mod-sequences error");
$this->runInitialSync($account, $mailbox, $logger);
}
}
} catch (ServiceException $e) {
// Just rethrow, don't wrap into another exception
throw $e;
} catch (Throwable $e) {
throw new ServiceException('Sync failed for ' . $account->getId() . ':' . $mailbox->getName() . ': ' . $e->getMessage(), 0, $e);
} finally {
if ($force || ($criteria & Horde_Imap_Client::SYNC_VANISHEDUIDS)) {
$logger->debug("Unlocking mailbox " . $mailbox->getId() . " from vanished messages sync");
$this->mailboxMapper->unlockFromVanishedSync($mailbox);
}
if ($force || ($criteria & Horde_Imap_Client::SYNC_FLAGSUIDS)) {
$logger->debug("Unlocking mailbox " . $mailbox->getId() . " from changed messages sync");
$this->mailboxMapper->unlockFromChangedSync($mailbox);
}
if ($force || ($criteria & Horde_Imap_Client::SYNC_NEWMSGSUIDS)) {
$logger->debug("Unlocking mailbox " . $mailbox->getId() . " from new messages sync");
$this->mailboxMapper->unlockFromNewSync($mailbox);
}
}
if (!$batchSync) {
$this->dispatcher->dispatchTyped(
new SynchronizationEvent(
$account,
$this->logger
)
);
}
} |
@spacemule can you test the newest Mail (2.2.)? I tested today and this is what emails look like for me now: |
I don't have a nextcloud instance anymore, but I'd be happy to forward some emails.
…On February 13, 2023 5:46:23 PM GMT+02:00, Anna ***@***.***> wrote:
@spacemule can you test the newest Mail (2.2.)? I tested today and this is what emails look like for me now:
![image](https://user-images.githubusercontent.com/7427347/218504538-eb3a02fe-46dd-48de-8880-9ba01c344302.png)
--
Reply to this email directly or view it on GitHub:
#5834 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
Ok I'mm going to close this as fixed then. Feel free to open another ticket if you run into more issues. |
Expected behavior
Emails should sync and appear.
Actual behavior
Syncing is stuck indefinitely due to emails in my inbox that contain Hebrew. Folders without Hebrew sync fine.
Running occ mail:account:sync provides the following output:
Mail app
Mail app version: (see apps admin page, e.g. 0.5.3)
1.11.1
Mailserver or service: (e.g. Outlook, Yahoo, Gmail, Exchange,...)
Mailbox.org
Server configuration
Operating system: (e.g. Debian 8)
ppenSUSE MicroOS
Web server: (e.g. Apache, Nginx,...)
Nginx
Database: (e.g. MariaDB, SQLite or PostgreSQL)
MariaDB
PHP version: (e.g. 7.0)
Whatever is in the docker image nextcloud:fpm
Nextcloud Version: (see admin page, e.g. 13.0.2)
23.0.0.10
Client configuration
Browser: (e.g. Firefox 48)
Firefox 94.0.2
Operating system: (e.g. Arch Linux)
openSUSE Tumbleweed
Thanks!!
The text was updated successfully, but these errors were encountered: