Error: ZipArchive::open(): Argument #1 ($filename) cannot be empty in ZipArchive->open()

Created on 8 February 2023, almost 2 years ago
Updated 10 February 2024, 9 months ago

Problem/Motivation

When uploading a SCORM file, then saving the content it's attached to, the user gets a white screen and this error is added to the log:

ZipArchive::open(): Argument #1 ($filename) cannot be empty in ZipArchive->open() (line 25 of /var/www/web/modules/contrib/opigno_scorm/src/OpignoScorm.php) 

(full error message attached)

The same SCORM file is uploaded and displays correctly on a local dev environment. The only major difference is we're using a different file stream than `public://`. We're using Azure Blob Storage (Microsoft Azure's answer to Amazon S3) with the stream `azblob://`.

In `file_managed`, the SCORM zip file is there and the file has been successfully uploaded to Azure Blob Storage. So it's hard to say why the filename would be null.

In addition, if the local dev environment is switched from `public://` to `azblob://`, that local environment starts throwing the same error when saving content with a SCORM file attached. So the problem is almost certainly related to file streams.

Steps to reproduce

  1. Have a site with Azure Blob Storage (or S3?) setup
  2. Setup a content type with an Opigno SCORM file field
  3. Go to Admin → Content → Add content → [ content type ]
  4. Drag a SCORM file onto the SCORM file field setup in (2)
  5. Press Save

Proposed resolution

Debug why exactly the $filename being passed to ZipArche::open() is null (or false, or whatever).

Finding if this problem is reproducible with Amazon S3, or even `private://`, should help rule out the file streams question.

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇨🇦Canada Liam McDermott

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024