PDF viewer will show “Stream must have data” or PDF error as PDF cannot be viewed or PDF cannot be displayed or PDF missing by visitor when trying to view or download a PDF, the error may shown : “An error occurred while loading the PDF” you’re not alone. Many of the OJS Hosting that use general-purpose hosting may encounter this issue. At openjournaltheme.com or OJT Team, we often receive requests for such issues from our clients to address this issues.
This issue is commonly related to file corruption or improper file uploads. This may be caused by improper OJS migration or the result of an OJS upgrade that is not finalized. Fortunately, the fix is usually straightforward. In this post, we’ll walk you through why this happens and how to resolve it quickly.
Table of Contents
What Does the Error PDF “Stream must have data” Mean?
This message “An error occurred while loading the PDF” actually inform that PDF file error typically occurs when:
- A PDF file was uploaded but has no content (0 bytes in size).
- There was an interruption during the file upload process.
- The file record exists in the database, but the actual PDF file is missing from the server’s
files_dir
.
In simple terms, OJS/OMP is trying to stream a PDF that doesn’t really exist, exists but is empty or file cannot be accessed due to the permission error.
How to Fix PDF error with message “Stream must have data” or “An error occurred while loading the PDF”
Here are the steps to the PDF error no stream of data fix the PDF error:
1. Check File Existence and Size
- Go to your
files_dir
(defined inconfig.inc.php
). - Navigate to the path where the submission file should be located.
- Verify that the file:
- Exists.
- Has a size greater than 0 bytes.
If the PDF file is missing or empty, proceed to the next step.
2. Re-upload the PDF
If the file is corrupted or missing, the best approach is to fix this PDF error that is shown “An error occurred while loading the PDF” :
- Login as Editor or Journal Manager.
- Go to the submission having the issue.
- Navigate to the Publication > Galleys or Production > Publication Formats tab (depending on whether you’re using OJS or OMP).
- Delete the problematic PDF galley or publication format.
- Re-upload a fresh, working PDF file.
3. Clear Cache
After re-uploading:
- Go to Administration > Clear Data Caches.
- Clear the template and data caches to ensure OJS/OMP reflects the updated file correctly.
4. Check File Permissions
Make sure the uploaded files of the pdf are readable by the web server:
chmod -R 755 /path/to/files_dir
chown -R www-data:www-data /path/to/files_dir # (use correct user/group for your server)
If you need to know about reading about creating correct permission you can access this list of command.
5. Look at the Logs (Optional)If the problem persists:
- Check your PHP error log or
error_log
in your server. - Also look at OJS/OMP logs for clues.
How to Prevent “Stream Must have data” Error in the Future
While the “Stream must have data” error might seem like a minor or common issue to some users, it can actually be a red flag that the OJS installation is not being properly maintained. Sometime you may see the error that “An error occurred while loading the PDF”.
The PDF file is the core element of any published article—it serves as the primary evidence of a researcher’s or lecturer’s contribution to academic discourse. When this file is lost and no backup is available, the consequences go beyond technical inconvenience. It can undermine the credibility of the journal, especially in the eyes of authors who rely on these publications to support their academic credentials, apply for promotions, or fulfill institutional requirements.
In such cases, a missing or corrupted PDF is not just a broken link—it is a lost opportunity, a broken trust, and potentially a reputational risk for the journal.
At OpenJournalTheme.com and through our OJT Team OJS Hosting services, we take this issue seriously and prevent it before it happens. All of our OJS/OMP hosting packages come with automated, periodic backups that are securely stored on external servers. This means that every critical component of your journal—including uploaded files, submission data, and the database itself—is backed up regularly and safely replicated on a separate server environment.
By implementing this safeguard, we ensure that your publishing workflow is not only smooth and reliable but also resilient against unexpected failures. This level of protection helps journals maintain their integrity, protect their authors’ work, and build long-term trust with their contributors and readers.
If you’re running an OJS journal, don’t wait for an error to remind you how valuable your data is. Let OJT team Hosting take care of your technical stability so you can focus on growing your journal.
Conclusion
The “Stream must have data” error can be frustrating, but it’s usually a sign of a missing or corrupted PDF. By re-uploading the file and checking your server paths, you can restore normal functionality quickly. Keep your file uploads clean and your system maintained to avoid this issue in the future.
Need help fixing OJS/OMP issues?
We offer expert support for OJS/OMP setup, customization, OJS hosting and maintenance. Get in touch!
Let me know if you want this tailored for a specific version of OJS or need screenshots added.