nextcloud / nextcloud/files_emailviewer

EML file is opened as blank PDF (invalid or broken PDF file)

Open
#49 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug needs info
Dominant language
JavaScript
Stars
5
Forks
1
Avg merge
8h 44m
Merged PRs (30d)
5

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce
  1. Install files_emailviewer and all the required dependencies
  2. Upload EML file
  3. Open that file
Expected behaviour

The file should be opened correctly in the browser

Actual behaviour

An "empty" file is opened in the PDF viewer

Additional information

The conversion works when executed directly on the commandline, e.g. sudo -u www-data java -jar /opt/mail/emailconverter-3.0.0-all.jar test.eml

Server configuration

Web server: Nginx

Database: PostgreSQL

PHP version: 8.3

Nextcloud version: 30.0.6

Browser

Browser name: Doesn't matter

Browser version: 124/125/…

Browser log
/apps/files/:1 Refused to apply style from 'https://domain.de/apps/contacts/css/contacts-index.css?v=1ebaba34-0' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
previewUtils-BnCbNhwl.chunk.mjs:6 [WARN] viewer: Some mimes were ignored because they are not enabled in the server previews config Object
log @ previewUtils-BnCbNhwl.chunk.mjs:6
session-heartbeat.js:83 session heartbeat polling started
Settings.js:24 A setting with the same name is already registered
register @ Settings.js:24
/core/preview?fileId=1321&x=32&y=32&mimeFallback=true&v=60961a&a=0:1 
            
            
           Failed to load resource: the server responded with a status of 404 ()
Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'.
Error with Permissions-Policy header: Unrecognized feature: 'attribution-reporting'.
Error with Permissions-Policy header: Unrecognized feature: 'run-ad-auction'.
Error with Permissions-Policy header: Unrecognized feature: 'private-state-token-redemption'.
Error with Permissions-Policy header: Unrecognized feature: 'private-state-token-issuance'.
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'join-ad-interest-group'.
Error with Permissions-Policy header: Unrecognized feature: 'browsing-topics'.
 Ungültige oder beschädigte PDF-Datei

PDF.js v4.0.189 (build: 50f52b43a)
Message: The PDF file is empty, i.e. its size is zero bytes.
_otherError @ viewer.mjs:11807
pdf.mjs:16329 Uncaught (in promise) InvalidPDFException: The PDF file is empty, i.e. its size is zero bytes.
1321:1 Refused to apply style from 'https://domain.de/apps/contacts/css/contacts-index.css?v=1ebaba34-0' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'.
Error with Permissions-Policy header: Unrecognized feature: 'attribution-reporting'.
Error with Permissions-Policy header: Unrecognized feature: 'run-ad-auction'.
Error with Permissions-Policy header: Unrecognized feature: 'private-state-token-redemption'.
Error with Permissions-Policy header: Unrecognized feature: 'private-state-token-issuance'.
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'join-ad-interest-group'.
Error with Permissions-Policy header: Unrecognized feature: 'browsing-topics'.
 Ungültige oder beschädigte PDF-Datei

PDF.js v4.0.189 (build: 50f52b43a)
Message: The PDF file is empty, i.e. its size is zero bytes.
_otherError @ viewer.mjs:11807
_documentError @ viewer.mjs:11785
(anonymous) @ viewer.mjs:11713
pdf.mjs:16329 Uncaught (in promise) InvalidPDFException: The PDF file is empty, i.e. its size is zero bytes.
BaseExceptionClosure @ pdf.mjs:16329
266 @ pdf.mjs:16332
__webpack_require__ @ pdf.mjs:16738
(anonymous) @ pdf.mjs:15383
__webpack_require__.a @ pdf.mjs:16795
907 @ pdf.mjs:15338
__webpack_require__ @ pdf.mjs:16738
(anonymous) @ pdf.mjs:16836
Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'.
Error with Permissions-Policy header: Unrecognized feature: 'attribution-reporting'.
Error with Permissions-Policy header: Unrecognized feature: 'run-ad-auction'.
Error with Permissions-Policy header: Unrecognized feature: 'private-state-token-redemption'.
Error with Permissions-Policy header: Unrecognized feature: 'private-state-token-issuance'.
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'join-ad-interest-group'.
Error with Permissions-Policy header: Unrecognized feature: 'browsing-topics'.
app.js:1146 Ungültige oder beschädigte PDF-Datei

PDF.js v4.0.189 (build: 50f52b43a)
Message: The PDF file is empty, i.e. its size is zero bytes.
_otherError @ app.js:1146
util.js:466 Uncaught (in promise) InvalidPDFException

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the EML upload and opening flow in files_emailviewer, then inspect the /core/preview request and compare its result with the command-line emailconverter-3.0.0-all.jar conversion described in the report. Done means opening the uploaded EML in the browser produces a non-empty, valid PDF instead of the PDF.js empty-file error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript
Domain
backend, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.