Skip to content

[Bug]: TarStreamer library is incompatible, downloads fail. #37745

Description

@AdamVenn

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

When downloading largeish folders (>90 files, subfolders, etc.) on MacOS, Nextcloud fails to create the tar file of the folder.

Nextcloud uses the TarStreamer library here:
https://github.com/owncloud/TarStreamer

But it is apparently not compatible with current versions of PHP:

owncloud/TarStreamer#23 (comment)

The library needs to be brought up to date in order to use Nextcloud with secure versions of PHP/MacOS.

Steps to reproduce

  1. Create a folder with 90 files in a subfolder
  2. Open a browser on MacOS
  3. Attempt to download the folder
  4. Receive a truncated tar file

Expected behavior

Receive a complete tar file of the folder.

Installation method

Community Manual installation with Archive

Nextcloud Server version

26

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated from a minor version (ex. 22.2.3 to 22.2.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "10.150.64.10",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "26.0.0.11",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "skeletondirectory": "\/var\/www\/skeleton",
        "trashbin_retention_obligation": "1, 2",
        "ldapUserCleanupInterval": "30",
        "log_type": "syslog",
        "logfile": "",
        "loglevel": 1,
        "syslog_tag": "Nextcloud",
        "enable_previews": false,
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "default_phone_region": "CA",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "filelocking.enabled": "true",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "dbindex": 0,
            "password": "***REMOVED SENSITIVE VALUE***",
            "timeout": 1.5
        },
        "maintenance": false,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory"
    }
}

List of activated Apps

Enabled:
  - activity: 2.18.0
  - admin_audit: 1.16.0
  - bruteforcesettings: 2.6.0
  - cloud_federation_api: 1.9.0
  - contacts: 5.2.0
  - dav: 1.25.0
  - federatedfilesharing: 1.16.0
  - files: 1.21.1
  - files_downloadactivity: 1.16.0
  - files_external: 1.18.0
  - files_pdfviewer: 2.7.0
  - files_rightclick: 1.5.0
  - files_sharing: 1.18.0
  - files_trashbin: 1.16.0
  - lookup_server_connector: 1.14.0
  - oauth2: 1.14.0
  - password_policy: 1.16.0
  - privacy: 1.10.0
  - provisioning_api: 1.16.0
  - related_resources: 1.1.0-alpha1
  - serverinfo: 1.16.0
  - settings: 1.8.0
  - text: 3.7.2
  - theming: 2.1.1
  - twofactor_backupcodes: 1.15.0
  - user_ldap: 1.16.0
  - viewer: 1.10.0
  - workflowengine: 2.8.0
Disabled:
  - circles: 26.0.0 (installed 22.1.1)
  - comments: 1.16.0 (installed 1.12.0)
  - contactsinteraction: 1.7.0 (installed 1.3.0)
  - dashboard: 7.6.0 (installed 7.2.0)
  - encryption: 2.14.0
  - federation: 1.16.0 (installed 1.12.0)
  - files_versions: 1.19.1 (installed 1.15.0)
  - firstrunwizard: 2.15.0 (installed 2.11.0)
  - group_everyone: 0.1.11 (installed 0.1.11)
  - logreader: 2.11.0 (installed 2.7.0)
  - nextcloud_announcements: 1.15.0 (installed 1.11.0)
  - notifications: 2.14.0 (installed 2.10.1)
  - photos: 2.2.0 (installed 1.4.0)
  - recommendations: 1.5.0 (installed 1.1.0)
  - sharebymail: 1.16.0 (installed 1.12.0)
  - support: 1.9.0 (installed 1.5.0)
  - survey_client: 1.14.0 (installed 1.10.0)
  - suspicious_login: 4.4.0
  - systemtags: 1.16.0 (installed 1.12.0)
  - twofactor_totp: 8.0.0-alpha.0
  - updatenotification: 1.16.0 (installed 1.15.0)
  - user_status: 1.6.0 (installed 1.2.0)
  - weather_status: 1.6.0 (installed 1.2.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Relevant log lines:

nc_msg_Exception
    TypeError
nc_msg_File
    /var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarHeader.php
nc_msg_Line
    72
nc_msg_Message
    decoct(): Argument #1 ($num) must be of type int, string given
nc_msg_Trace
    {file=/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarHeader.php, line=72, function=decoct},
    {file=/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarStreamer.php, line=200, function=getHeader, class=ownCloud\TarStreamer\TarHeader, type=->},
    {file=/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarStreamer.php, line=166, function=writeLongName, class=ownCloud\TarStreamer\TarStreamer, type=->},
    {file=/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarStreamer.php, line=102, function=initFileStreamTransfer, class=ownCloud\TarStreamer\TarStreamer, type=->},
    {file=/var/www/nextcloud/lib/private/Streamer.php, line=167, function=addFileFromStream, class=ownCloud\TarStreamer\TarStreamer, type=->},
    {file=/var/www/nextcloud/lib/private/Streamer.php, line=136, function=addFileFromStream, class=OC\Streamer, type=->},
    {file=/var/www/nextcloud/lib/private/Streamer.php, line=141, function=addDirRecursive, class=OC\Streamer, type=->},
    {file=/var/www/nextcloud/lib/private/legacy/OC_Files.php, line=217, function=addDirRecursive, class=OC\Streamer, type=->},
    {file=/var/www/nextcloud/apps/files/ajax/download.php, line=77, function=get, class=OC_Files, type=::},
    {file=/var/www/nextcloud/lib/private/Route/Route.php, line=155, args=[/var/www/nextcloud/apps/files/ajax/download.php], function=require_once},
    {function=OC\Route\{closure}, class=OC\Route\Route, type=->, args=[*** sensitive parameters replaced ***]},
    {file=/var/www/nextcloud/lib/private/Route/Router.php, line=324, function=call_user_func},
    {file=/var/www/nextcloud/lib/base.php, line=1055, function=match, class=OC\Route\Router, type=->},
    {file=/var/www/nextcloud/index.php, line=36, function=handleRequest, class=OC, type=::}






Full Logs:

application_name
    Nextcloud
facility
    user-level
facility_num
    1
level
    3
message
    {"reqId":"DxUGPZDJ1qX1WR8O81ll","level":3,"time":"2023-04-14T20:21:01+00:00","remoteAddr":"10.150.64.1","user":"***REMOVED SENSITIVE VALUE***","app":"index","method":"GET","url":"/index.php/apps/files/ajax/download.php?***REMOVED SENSITIVE VALUE***","message":"{\"Exception\":\"TypeError\",\"Message\":\"decoct(): Argument #1 ($num) must be of type int, string given\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarHeader.php\",\"line\":72,\"function\":\"decoct\"},{\"file\":\"/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarStreamer.php\",\"line\":200,\"function\":\"getHeader\",\"class\":\"ownCloud\\\\TarStreamer\\\\TarHeader\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarStreamer.php\",\"line\":166,\"function\":\"writeLongName\",\"class\":\"ownCloud\\\\TarStreamer\\\\TarStreamer\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarStreamer.php\",\"line\":102,\"function\":\"initFileStreamTransfer\",\"class\":\"ownCloud\\\\TarStreamer\\\\TarStreamer\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Streamer.php\",\"line\":167,\"function\":\"addFileFromStream\",\"class\":\"ownCloud\\\\TarStreamer\\\\TarStreamer\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Streamer.php\",\"line\":136,\"function\":\"addFileFromStream\",\"class\":\"OC\\\\Streamer\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Streamer.php\",\"line\":141,\"function\":\"addDirRecursive\",\"class\":\"OC\\\\Streamer\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/legacy/OC_Files.php\",\"line\":217,\"function\":\"addDirRecursive\",\"class\":\"OC\\\\Streamer\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/apps/files/ajax/download.php\",\"line\":77,\"function\":\"get\",\"class\":\"OC_Files\",\"type\":\"::\"},{\"file\":\"/var/www/nextcloud/lib/private/Route/Route.php\",\"line\":155,\"args\":[\"/var/www/nextcloud/apps/files/ajax/download.php\"],\"function\":\"require_once\"},{\"function\":\"OC\\\\Route\\\\{closure}\",\"class\":\"OC\\\\Route\\\\Route\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"/var/www/nextcloud/lib/private/Route/Router.php\",\"line\":324,\"function\":\"call_user_func\"},{\"file\":\"/var/www/nextcloud/lib/base.php\",\"line\":1055,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/index.php\",\"line\":36,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\"}],\"File\":\"/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarHeader.php\",\"Line\":72,\"CustomMessage\":\"--\"}","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0","version":"26.0.0.11"}
nc_app
    index
nc_level
    3
nc_message
    {"Exception":"TypeError","Message":"decoct(): Argument #1 ($num) must be of type int, string given","Code":0,"Trace":[{"file":"/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarHeader.php","line":72,"function":"decoct"},{"file":"/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarStreamer.php","line":200,"function":"getHeader","class":"ownCloud\\TarStreamer\\TarHeader","type":"->"},{"file":"/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarStreamer.php","line":166,"function":"writeLongName","class":"ownCloud\\TarStreamer\\TarStreamer","type":"->"},{"file":"/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarStreamer.php","line":102,"function":"initFileStreamTransfer","class":"ownCloud\\TarStreamer\\TarStreamer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Streamer.php","line":167,"function":"addFileFromStream","class":"ownCloud\\TarStreamer\\TarStreamer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Streamer.php","line":136,"function":"addFileFromStream","class":"OC\\Streamer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Streamer.php","line":141,"function":"addDirRecursive","class":"OC\\Streamer","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Files.php","line":217,"function":"addDirRecursive","class":"OC\\Streamer","type":"->"},{"file":"/var/www/nextcloud/apps/files/ajax/download.php","line":77,"function":"get","class":"OC_Files","type":"::"},{"file":"/var/www/nextcloud/lib/private/Route/Route.php","line":155,"args":["/var/www/nextcloud/apps/files/ajax/download.php"],"function":"require_once"},{"function":"OC\\Route\\{closure}","class":"OC\\Route\\Route","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":324,"function":"call_user_func"},{"file":"/var/www/nextcloud/lib/base.php","line":1055,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarHeader.php","Line":72,"CustomMessage":"--"}
nc_method
    GET
nc_msg_Code
    0
nc_msg_CustomMessage
    --
nc_msg_Exception
    TypeError
nc_msg_File
    /var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarHeader.php
nc_msg_Line
    72
nc_msg_Message
    decoct(): Argument #1 ($num) must be of type int, string given
nc_msg_Trace
    {file=/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarHeader.php, line=72, function=decoct},
    {file=/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarStreamer.php, line=200, function=getHeader, class=ownCloud\TarStreamer\TarHeader, type=->},
    {file=/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarStreamer.php, line=166, function=writeLongName, class=ownCloud\TarStreamer\TarStreamer, type=->},
    {file=/var/www/nextcloud/3rdparty/deepdiver1975/tarstreamer/src/TarStreamer.php, line=102, function=initFileStreamTransfer, class=ownCloud\TarStreamer\TarStreamer, type=->},
    {file=/var/www/nextcloud/lib/private/Streamer.php, line=167, function=addFileFromStream, class=ownCloud\TarStreamer\TarStreamer, type=->},
    {file=/var/www/nextcloud/lib/private/Streamer.php, line=136, function=addFileFromStream, class=OC\Streamer, type=->},
    {file=/var/www/nextcloud/lib/private/Streamer.php, line=141, function=addDirRecursive, class=OC\Streamer, type=->},
    {file=/var/www/nextcloud/lib/private/legacy/OC_Files.php, line=217, function=addDirRecursive, class=OC\Streamer, type=->},
    {file=/var/www/nextcloud/apps/files/ajax/download.php, line=77, function=get, class=OC_Files, type=::},
    {file=/var/www/nextcloud/lib/private/Route/Route.php, line=155, args=[/var/www/nextcloud/apps/files/ajax/download.php], function=require_once},
    {function=OC\Route\{closure}, class=OC\Route\Route, type=->, args=[*** sensitive parameters replaced ***]},
    {file=/var/www/nextcloud/lib/private/Route/Router.php, line=324, function=call_user_func},
    {file=/var/www/nextcloud/lib/base.php, line=1055, function=match, class=OC\Route\Router, type=->},
    {file=/var/www/nextcloud/index.php, line=36, function=handleRequest, class=OC, type=::}
nc_remoteAddr
    10.150.64.1
nc_reqId
    DxUGPZDJ1qX1WR8O81ll
nc_time
    2023-04-14 16:21:01.000
nc_url
    /index.php/apps/files/ajax/download.php?***REMOVED SENSITIVE VALUE***
nc_user
    ***REMOVED SENSITIVE VALUE***
nc_userAgent
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0
nc_version
    26.0.0.11
process_id
    1822
source
    nc
timestamp
    2023-04-14 16:21:01.331

Additional info

No response

Activity

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 triagePending check for reproducibility or if it fits our roadmap26-feedbackbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions