Failed to process email (Very long message ID or empty attachment name) #152

Open
opened 2026-04-05 16:16:46 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @prinsss on 10/14/2025

Describe the bug

I've encountered some errors when importing emails using IMAP connector. (See logs below)

The EISDIR seems to be caused by empty attachment.filename (IDK why).

1e048fdbc1/packages/backend/src/services/IngestionService.ts (L375)

And the ENAMETOOLONG might be caused by really really long email.id.

1e048fdbc1/packages/backend/src/services/IngestionService.ts (L342)

These cases are quite rare (2 errors out of 10000+ imported emails), but it would be nice if we could improve the robustness of the importer. :)

To Reproduce

  1. Add an ingestion with IMAP, connecting to Gmail
  2. Wait until the importing process is done
  3. Open the logs with docker logs and see these error messages

Expected behavior

Emails should be imported and archived.

Screenshots

N/A

System:

  • Open Archiver Version: 0.3.4

Relevant logs:

[0] [0] [18:32:23.888] ERROR (289):
[0] [0]     message: "Failed to process email <46123456-6227-a6c9-555c-43a0eebe3ae9@f1.octv.ne.jp> for source b9a22256-a261-45a4-b212-506f919cac02"
[0] [0]     emailId: "<46123456-6227-a6c9-555c-43a0eebe3ae9@f1.octv.ne.jp>"
[0] [0]     ingestionSourceId: "b9a22256-a261-45a4-b212-506f919cac02"
[0] [0]     error: {
[0] [0]       "errno": -21,
[0] [0]       "code": "EISDIR",
[0] [0]       "syscall": "open",
[0] [0]       "path": "/var/data/open-archiver/open-archiver/Gmail-Test-b9a22256-a261-45a4-b212-506f919cac02/attachments"
[0] [0]     }

[0] [0] [18:32:56.982] ERROR (289):
[0] [0]     message: "Failed to process email <w587b151f6273cjj7law0d1f5r21p3r4.152612345654474588335246430595610876123456912460304838481531102190886833335672608463744108218437425109543101362771365875607549876234867177214581628116786431560851138856687036299-.0107994435357728996742320466665776475818308083872457790736492070617-w587b151f6273cjj7law0d1f5r21p3r4@un039.annewall.me.uk> for source b9a22256-a261-45a4-b212-506f919cac02"
[0] [0]     emailId: "<w587b151f6273cjj7law0d1f5r21p3r4.152612345654474588335246430595610876123456912460304838481531102190886833335672608463744108218437425109543101362771365875607549876234867177214581628116786431560851138856687036299-.0107994435357728996742320466665776475818308083872457790736492070617-w587b151f6273cjj7law0d1f5r21p3r4@un039.annewall.me.uk>"
[0] [0]     ingestionSourceId: "b9a22256-a261-45a4-b212-506f919cac02"
[0] [0]     error: {
[0] [0]       "errno": -36,
[0] [0]       "code": "ENAMETOOLONG",
[0] [0]       "syscall": "open",
[0] [0]       "path": "/var/data/open-archiver/open-archiver/Gmail-Test-b9a22256-a261-45a4-b212-506f919cac02/emails/[Gmail]/所有邮件<w587b151f6273cjj7law0d1f5r21p3r4.152612345654474588335246430595610876123456912460304838481531102190886833335672608463744108218437425109543101362771365875607549876234867177214581628116786431560851138856687036299-.0107994435357728996742320466665776475818308083872457790736492070617-w587b151f6273cjj7law0d1f5r21p3r4@un039.annewall.me.uk>.eml"
[0] [0]     }
*Originally created by @prinsss on 10/14/2025* **Describe the bug** I've encountered some errors when importing emails using IMAP connector. (See logs below) The `EISDIR` seems to be caused by empty `attachment.filename` (IDK why). https://github.com/LogicLabs-OU/OpenArchiver/blob/1e048fdbc1d0e60b35a6c633309acd14927a6824/packages/backend/src/services/IngestionService.ts#L375 And the `ENAMETOOLONG` might be caused by really really long `email.id`. https://github.com/LogicLabs-OU/OpenArchiver/blob/1e048fdbc1d0e60b35a6c633309acd14927a6824/packages/backend/src/services/IngestionService.ts#L342 These cases are quite rare (2 errors out of 10000+ imported emails), but it would be nice if we could improve the robustness of the importer. :) **To Reproduce** 1. Add an ingestion with IMAP, connecting to Gmail 2. Wait until the importing process is done 3. Open the logs with `docker logs` and see these error messages **Expected behavior** Emails should be imported and archived. **Screenshots** N/A **System:** - Open Archiver Version: 0.3.4 **Relevant logs:** ``` [0] [0] [18:32:23.888] ERROR (289): [0] [0] message: "Failed to process email <46123456-6227-a6c9-555c-43a0eebe3ae9@f1.octv.ne.jp> for source b9a22256-a261-45a4-b212-506f919cac02" [0] [0] emailId: "<46123456-6227-a6c9-555c-43a0eebe3ae9@f1.octv.ne.jp>" [0] [0] ingestionSourceId: "b9a22256-a261-45a4-b212-506f919cac02" [0] [0] error: { [0] [0] "errno": -21, [0] [0] "code": "EISDIR", [0] [0] "syscall": "open", [0] [0] "path": "/var/data/open-archiver/open-archiver/Gmail-Test-b9a22256-a261-45a4-b212-506f919cac02/attachments" [0] [0] } [0] [0] [18:32:56.982] ERROR (289): [0] [0] message: "Failed to process email <w587b151f6273cjj7law0d1f5r21p3r4.152612345654474588335246430595610876123456912460304838481531102190886833335672608463744108218437425109543101362771365875607549876234867177214581628116786431560851138856687036299-.0107994435357728996742320466665776475818308083872457790736492070617-w587b151f6273cjj7law0d1f5r21p3r4@un039.annewall.me.uk> for source b9a22256-a261-45a4-b212-506f919cac02" [0] [0] emailId: "<w587b151f6273cjj7law0d1f5r21p3r4.152612345654474588335246430595610876123456912460304838481531102190886833335672608463744108218437425109543101362771365875607549876234867177214581628116786431560851138856687036299-.0107994435357728996742320466665776475818308083872457790736492070617-w587b151f6273cjj7law0d1f5r21p3r4@un039.annewall.me.uk>" [0] [0] ingestionSourceId: "b9a22256-a261-45a4-b212-506f919cac02" [0] [0] error: { [0] [0] "errno": -36, [0] [0] "code": "ENAMETOOLONG", [0] [0] "syscall": "open", [0] [0] "path": "/var/data/open-archiver/open-archiver/Gmail-Test-b9a22256-a261-45a4-b212-506f919cac02/emails/[Gmail]/所有邮件<w587b151f6273cjj7law0d1f5r21p3r4.152612345654474588335246430595610876123456912460304838481531102190886833335672608463744108218437425109543101362771365875607549876234867177214581628116786431560851138856687036299-.0107994435357728996742320466665776475818308083872457790736492070617-w587b151f6273cjj7law0d1f5r21p3r4@un039.annewall.me.uk>.eml" [0] [0] } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OpenArchiver#152