Skip to content

Error: ZipArchive::open(): Using empty file as ZipArchive is deprecated #27064

Closed

Description

@antiuser

Steps to reproduce

  1. Open Log file and watch "Error: ZipArchive::open(): Using empty file as ZipArchive is deprecated at /var/www/lib/private/Archive/ZIP.php#51"

Expected behaviour

Open Log file without this error :)

Actual behaviour

Error: ZipArchive::open(): Using empty file as ZipArchive is deprecated at /var/www/lib/private/Archive/ZIP.php#51

Server configuration

Operating system:
Debian 9 x64

Web server:
nginx

Database:
mysql

PHP version:
php 8.0

Nextcloud version: (see Nextcloud admin page)
21.0.2

Updated from an older Nextcloud/ownCloud or fresh install:
21.0.1

Activity

  1. added
    0. Needs triage
    on May 21, 2021
  2. szaimen commented on May 22, 2021

    @szaimen
    Contributor

    Hi, thanks for your report! Please post at least your config.php file to make debugging possible. Thanks!

  3. added a commit that references this issue on May 22, 2021
    f60e7d3
  4. solracsf commented on May 22, 2021

    @solracsf
    Member

    Mind to try #27075?

  5. added
    1. to develop
    and removed
    0. Needs triage
    on May 22, 2021
  6. added
    2. developing
    and removed
    1. to develop
    on May 22, 2021
  7. changed the title [-]Deprecated ZIP function[/-] [+]Error: `ZipArchive::open()`: Using empty file as ZipArchive is deprecated[/+] on May 23, 2021
  8. antiuser commented on May 24, 2021

    @antiuser
    Author

    @szaimen

    Hi, thanks for your report! Please post at least your config.php file to make debugging possible. Thanks!

    Hi! Sorry for late answer

    <?php
    $CONFIG = array (
      'instanceid' => '',
      'passwordsalt' => '',
      'secret' => '',
      'trusted_domains' => 
      array (
        0 => '',
        1 => '',
        2 => '',
        3 => '',
      ),
      'datadirectory' => '/var/www/data',
      'skeletondirectory' => '',
      'templatedirectory' => '/var/www/core/skeleton/Templates/',
      'dbtype' => 'mysql',
      'version' => '21.0.2.1',
      'overwrite.cli.url' => '',
      'dbname' => 'nextcloud',
      'dbhost' => 'db2.local',
      'dbport' => '',
      'dbtableprefix' => 'oc_',
      'mysql.utf8mb4' => true,
      'dbuser' => 'nextcloud',
      'dbpassword' => '',
      'installed' => true,
      'maintenance' => false,
      'theme' => '',
      'default_language' => 'ru',
      'mail_domain' => '',
      'mail_from_address' => 'nextcloud',
      'mail_smtpmode' => 'smtp',
      'mail_smtpsecure' => 'tls',
      'mail_smtphost' => 'smtp.ru',
      'mail_smtpauthtype' => 'LOGIN',
      'mail_sendmailmode' => 'smtp',
      'mail_smtpauth' => 1,
      'mail_smtpname' => '',
      'mail_smtppassword' => '',
      'memcache.local' => '\\OC\\Memcache\\APCu',
      'memcache.distributed' => '\\OC\\Memcache\\Memcached',
      'memcached_servers' => 
      array (
        0 => 
        array (
          0 => 'localhost',
          1 => 11211,
        ),
      ),
      'filelocking.enabled' => 'true',
      'redis' => 
      array (
        'host' => '/var/run/redis/redis.sock',
        'port' => 0,
        'timeout' => 0.0,
      ),
      'loglevel' => 2,
      'updater.release.channel' => 'stable',
      'has_rebuilt_cache' => true,
      'ldapIgnoreNamingRules' => false,
      'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
      'default_phone_region' => 'RU',
    );
    
  9. szaimen commented on May 24, 2021

    @szaimen
    Contributor

    @antiuser thanks for your config.php file! Please test if the patch that @acsfer provided in #27075 fixes your issue, thanks!

  10. added a commit that references this issue on Aug 15, 2021
    7ec8255
  11. added a commit that references this issue on Aug 31, 2021
    781e936
  12. pawanrai9999 commented on Nov 12, 2021

    @pawanrai9999

    @szaimen @acsfer
    I had the same error in Nextcloud 22.
    And using fix #27075 solved this issue.
    I have made patch directly in source code.

    Thank You

    {"reqId":"v4mep9qvkcJP6f87mdTR","level":3,"time":"2021-11-12T03:22:50+00:00","remoteAddr":"25.65.85.22","user":"admin","app":"PHP","method":"GET","url":"/core/preview?fileId=85162&x=32&y=32","message":"ZipArchive::open(): Using empty file as ZipArchive is deprecated at /var/www/html/lib/private/Archive/ZIP.php#51","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.0.2","exception":{"Exception":"Error","Message":"ZipArchive::open(): Using empty file as ZipArchive is deprecated at /var/www/html/lib/private/Archive/ZIP.php#51","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[8192,"ZipArchive::open(): Using empty file as ZipArchive is deprecated","/var/www/html/lib/private/Archive/ZIP.php",51]},{"file":"/var/www/html/lib/private/Archive/ZIP.php","line":51,"function":"open","class":"ZipArchive","type":"->","args":["/tmp/oc_tmp_JpaHhF",1]},{"file":"/var/www/html/lib/private/Preview/Bundled.php","line":41,"function":"__construct","class":"OC\\Archive\\ZIP","type":"->","args":["/tmp/oc_tmp_JpaHhF"]},{"file":"/var/www/html/lib/private/Preview/OpenDocument.php","line":44,"function":"extractThumbnail","class":"OC\\Preview\\Bundled","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},"Thumbnails/thumbnail.png"]},{"file":"/var/www/html/lib/private/Preview/GeneratorHelper.php","line":62,"function":"getThumbnail","class":"OC\\Preview\\OpenDocument","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},2048,2048]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":245,"function":"getThumbnail","class":"OC\\Preview\\GeneratorHelper","type":"->","args":[{"__class__":"OC\\Preview\\OpenDocument"},{"__class__":"OC\\Files\\Node\\File"},2048,2048]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":140,"function":"getMaxPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\SimpleFS\\SimpleFolder"},{"__class__":"OC\\Files\\Node\\File"},"application/vnd.oasis.opendocument.text",""]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":109,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},[{"width":32,"height":32,"crop":true,"mode":"fill"}],"application/vnd.oasis.opendocument.text"]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":189,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},32,32,true,"fill",null]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":169,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},32,32,true,"fill"]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":142,"function":"fetchPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},32,32,false,true,"fill"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[85162,32,32,false,true,"fill"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\PreviewController"},"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\PreviewController"},"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\PreviewController","getPreviewByFileId",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"core.Preview.getPreviewByFileId"}]},{"file":"/var/www/html/lib/base.php","line":1000,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/core/preview"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"id":"618dde0ac37e8"}

  13. added a commit that references this issue on Nov 12, 2021
    62d72f3
  14. benjaminsabatini commented on Dec 1, 2021

    @benjaminsabatini

    ... and it was not merged?

  15. by-erik commented on Jan 22, 2022

    @by-erik

    @szaimen @acsfer
    I also had the same problem. After I applied the patch #27075, the problem was solved.

    I use nextcloud 22.2.3.

  16. added a commit that references this issue on Jan 22, 2022
    a1b991e
  17. szaimen commented on Jan 23, 2023

    @szaimen
    Contributor

    Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!

    My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!

    If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+

  18. added
    0. Needs triage
    and removed
    2. developing
    on Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagebugneeds info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions