[Bug]: OC\Archive\TAR only partially extracts tar.gz file
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ 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 OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
File is available here: https://download.nextcloud.com/server/apps/text2image_stablediffusion/stable-diffusion-xl-base-1.0/
Steps to reproduce
$tarManager = new TAR($archivePath);
$tarManager->extract($__DIR__ );
Result:
ls apps/text2image_stablediffusion/models/stable-diffusion-xl
unet vae_decoder vae_encoder
Expected behavior
Should extract all folders
Installation method
Community Manual installation with Archive
Nextcloud Server version
master
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
None
Database engine version
SQlite
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
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
No response
List of activated Apps
No response
Nextcloud Signing status
No response
Nextcloud Logs
{"reqId":"gziLpSYLVdLw0IMx6nQD","level":3,"time":"2024-01-09T11:00:45+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Uninitialized string offset 2 at /home/marcel/code/server/3rdparty/pear/archive_tar/Archive/Tar.php#1790","userAgent":"--","version":"29.0.0.3","data":{"app":"PHP"}}
{"reqId":"gziLpSYLVdLw0IMx6nQD","level":3,"time":"2024-01-09T11:00:45+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Uninitialized string offset 3 at /home/marcel/code/server/3rdparty/pear/archive_tar/Archive/Tar.php#1790","userAgent":"--","version":"29.0.0.3","data":{"app":"PHP"}}
{"reqId":"gziLpSYLVdLw0IMx6nQD","level":3,"time":"2024-01-09T11:00:45+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Uninitialized string offset 4 at /home/marcel/code/server/3rdparty/pear/archive_tar/Archive/Tar.php#1790","userAgent":"--","version":"29.0.0.3","data":{"app":"PHP"}}
{"reqId":"gziLpSYLVdLw0IMx6nQD","level":3,"time":"2024-01-09T11:00:45+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Uninitialized string offset 5 at /home/marcel/code/server/3rdparty/pear/archive_tar/Archive/Tar.php#1790","userAgent":"--","version":"29.0.0.3","data":{"app":"PHP"}}
{"reqId":"gziLpSYLVdLw0IMx6nQD","level":3,"time":"2024-01-09T11:00:45+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Uninitialized string offset 6 at /home/marcel/code/server/3rdparty/pear/archive_tar/Archive/Tar.php#1790","userAgent":"--","version":"29.0.0.3","data":{"app":"PHP"}}
{"reqId":"gziLpSYLVdLw0IMx6nQD","level":3,"time":"2024-01-09T11:00:45+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Uninitialized string offset 7 at /home/marcel/code/server/3rdparty/pear/archive_tar/Archive/Tar.php#1790","userAgent":"--","version":"29.0.0.3","data":{"app":"PHP"}}
{"reqId":"gziLpSYLVdLw0IMx6nQD","level":3,"time":"2024-01-09T11:00:45+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Uninitialized string offset 8 at /home/marcel/code/server/3rdparty/pear/archive_tar/Archive/Tar.php#1790","userAgent":"--","version":"29.0.0.3","data":{"app":"PHP"}}
{"reqId":"gziLpSYLVdLw0IMx6nQD","level":3,"time":"2024-01-09T11:00:45+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Uninitialized string offset 9 at /home/marcel/code/server/3rdparty/pear/archive_tar/Archive/Tar.php#1790","userAgent":"--","version":"29.0.0.3","data":{"app":"PHP"}}
{"reqId":"gziLpSYLVdLw0IMx6nQD","level":3,"time":"2024-01-09T11:00:45+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Uninitialized string offset 10 at /home/marcel/code/server/3rdparty/pear/archive_tar/Archive/Tar.php#1790","userAgent":"--","version":"29.0.0.3","data":{"app":"PHP"}}
{"reqId":"gziLpSYLVdLw0IMx6nQD","level":3,"time":"2024-01-09T11:00:45+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Uninitialized string offset 11 at /home/marcel/code/server/3rdparty/pear/archive_tar/Archive/Tar.php#1790","userAgent":"--","version":"29.0.0.3","data":{"app":"PHP"}}
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at 3rdparty/pear/archive_tar/Archive/Tar.php around line 1790 and reproduce the failure with the linked stable-diffusion-xl-base-1.0 archive using TAR::extract(). Check why extraction stops after creating only some folders and address the reported uninitialized string offsets; done means all archive folders are extracted without those warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100