Skip to content

Updater (5.0.12 -> 5.0.13) fails with "unable to fetch package" ("extraction error" in log) #5795

Closed

Description

@RandolfCarter

Expected behaviour

Trying to use the Updater to update from 5.0.12 to 5.0.13, I expect it to run through successfully

Actual behaviour

The updater fails with "Unable to fetch package".

Steps to reproduce

  1. Go to "Admin" page; the Updater section will show "ownCloud 5.0.13 is available ..."
  2. Click on the "Update Center" link
  3. Go to the "Update" tab
  4. Update fails with "unable to fetch package"

Server configuration

Operating system: Ubuntu 12.04.3 LTS
Web server: Apache 2.4.6-3
Database: mysql Ver 14.14 Distrib 5.5.34,
PHP version: 5.5.4-1

ownCloud version: 5.0.12

Client configuration

Browser: Firefox 25.0
Operating system: Windows 8.1 / Ubuntu 13.10

Logs

Web server error log

Nothing related

ownCloud log (data/owncloud.log)

Error updater /tmp/b71915fa52a77a0e359366325e6d4046.tar.bz2 extraction error 2013-11-09T20:38:26+00:00
Error updater Retrieving http://download.owncloud.org/community/ ... 13.tar.bz2 2013-11-09T20:38:26+00:00
Warning PHP file_exists() expects parameter 1 to be a valid path, string given at /home/bfroehler/htdocs/owncloud/3rdparty/Archive/Tar.php#1615 2013-11-09T20:38:26+00:00

Browser log

Have not collected such, don't think they could be relevant

Further information

open_basedir is not set
php / www-data has permissions on both /tmp and the target folder for the extraction (I put a temporary log output in there to find out the extract location)

I'm not sure at which step exactly the extraction fails, but it seems unlikely to be a permission issue. Maybe the bz2 module somehow could be corrupt? Any idea how I could check that?

See also

http://forum.owncloud.org/viewtopic.php?f=23&t=17358&p=47786#p47786

Activity

  1. VicDeo commented on Nov 10, 2013

    @VicDeo
    Contributor

    I fetched the package and tried the following snippet on it

                $extractDir = '/tmp/oc-5.0.13';
                mkdir($extractDir, 0755, true);
                $archive = \OC_Archive::open('/tmp/owncloud-5.0.13.tar.bz2');
                if (!$archive){
                     echo 'Reading failed';
                 }
                 if (!$archive->extract($extractDir)) {
                    echo 'Extraction failed';
                 }
    

    It says 'Extraction failed' so it's rather OC_Archive issue.
    Most likely it is related to the digital signature or #5621
    (Just a guess)

  2. RandolfCarter commented on Nov 10, 2013

    @RandolfCarter
    ContributorAuthor

    Do I understand you correctly that the php extractor got a problem with the current owncloud .tar.bz2 files?
    Meaning there's nothing to be done about it, the Updater just won't work?

    Edit: Thanks for the really quick answer, by the way :)

  3. VicDeo commented on Nov 23, 2013

    @VicDeo
    Contributor

    @RandolfCarter according to its description Archive_Tar doesn't support extended tar typeflags, namely

    XHDTYPE  'x'            /* Extended header referring to the
                                   next file in the archive */
    

    http://www.gnu.org/software/tar/manual/html_node/Standard.html

    The only solution I see is to rebuild 5.0.13 tar.bz2 package

  4. VicDeo commented on Nov 23, 2013

    @VicDeo
    Contributor

    Archive_Tar expects '5' or '2' (directory or file) as a typeflag https://github.com/owncloud/3rdparty/blob/master/Archive/Tar.php#L1664 and treats anything else as a file.

    Extraction error is caused by the entry with typeflag 'x'

  5. VicDeo commented on Nov 23, 2013

    @VicDeo
    Contributor

    Related to #5732

  6. flow7 commented on Nov 27, 2013

    @flow7

    I wonder if this is the right place to ask - I have the same problem on my owncloud installation - and I don't know how to move on from here? How can I upgrade if this keeps happening?
    Do I have to do a manual upgrade?
    Thanks

  7. VicDeo commented on Nov 27, 2013

    @VicDeo
    Contributor

    @karlitschek what do you think?

  8. te-online commented on Nov 29, 2013

    @te-online

    Any progress on that? Would be nice ;-)

  9. Schwobaland commented on Dec 2, 2013

    @Schwobaland

    Something new here? It's very time-consuming to update without shell-access...
    Thanks!

  10. karlitschek commented on Dec 2, 2013

    @karlitschek
    Contributor

    That's really strange. Works just fine for me here.

  11. te-online commented on Dec 2, 2013

    @te-online

    I also get an error in log

    Error | updater | /var/www/folder/phptmp//25e1b6d80bc6cb3ceb9021f325f1224a.tar.bz2 extraction error

    Could this be related to the broken updater? I had to remove some lines to make the updater work again after 5.0.11 update. #4857

  12. VicDeo commented on Dec 2, 2013

    @VicDeo
    Contributor

    @te-online As it is said above:
    #5795 (comment)

    This package can not be untared with 3rdparty library used in oC, namely Archive_Tar PEAR class.

    The steps to reproduce are listed above already:
    #5795 (comment)

    All one needs is to download the package, put it to any location and paste the code snippet inside any OC template.
    It would fail on extraction.

  13. VicDeo commented on Dec 2, 2013

    @VicDeo
    Contributor

    it's enough to trace the code to confirm this just as I did.
    In the middle of extraction Archive_Tar returns false here https://github.com/owncloud/3rdparty/blob/master/Archive/Tar.php#L1664 due to extended typeflag it isn't aware of

  14. te-online commented on Dec 2, 2013

    @te-online

    Okay, unfortunately I don't know much about tar flags or how the updater works.

    So without any knowledge I try to ask: What about the idea of @MrMrsK to rebuild the package (with a correct typeflag or none)? Any possibility to solve the problem in with this idea? :-)

  15. 28 remaining items

  16. Jas2Ma commented on Jan 9, 2014

    @Jas2Ma

    I'm also affected by this bug.

    I recommend to use zip archivs for the updater, because it is checked whether it works or not by owncloud during installation prozess.

  17. bantu commented on Jan 9, 2014

    @bantu

    owncloud-6.0.0a.tar.bz2 (48257271 bytes)
    owncloud-6.0.0a.zip (58901140 bytes)

    Not sure whether it is safe to assume that the ZipArchive extension is there.

  18. VicDeo commented on Jan 10, 2014

    @VicDeo
    Contributor

    @karlitschek Updater uses the URL from the feed and generic OC_Archive class so no changes are needed.

  19. karlitschek commented on Jan 10, 2014

    @karlitschek
    Contributor

    Very cool. I just changed the filename to .zip in the updater feed. Can someone check if it works now?

  20. Jas2Ma commented on Jan 10, 2014

    @Jas2Ma

    Jep. Update from 6.0 to 6.0a did it's job. Thanks a lot!

  21. VicDeo commented on Jan 10, 2014

    @VicDeo
    Contributor

    @Jas2Ma just for the record: do you have bz2 PHP extension enabled?

  22. Jas2Ma commented on Jan 10, 2014

    @Jas2Ma

    @VicDeo Nope, I have not. I only have the zip extension. But if you demand the bz2 I recommend to check whether this extension is enabled during installation.

  23. Jas2Ma commented on Jan 10, 2014

    @Jas2Ma

    @VicDeo I looked up phpinfo and it actually says, that b2 is enable: Version 1.0.6, 6-Sept-2010. In Ubuntu it comes with php5-cgi package, which I've installed.

  24. te-online commented on Jan 24, 2014

    @te-online
  25. VicDeo commented on Jan 24, 2014

    @VicDeo
    Contributor
  26. te-online commented on Jan 24, 2014

    @te-online

    Thank you so much! It worked out in the end. Could have guessed the url was cached...
    Can't believe that I missed all the awesome new things for such a long time! :D

    For others with problems: After removing line 47 in updater.php, I additionally had to apply the fix given here owncloud-archive/apps#1563 to complete the upgrade successfully.

    @VicDeo My personal guess is that the cache-problem is related to a wrong server-time (not my fault - shared hosting ;-)) or something that causes the cache not to be cleared, because the current time is before the stored time. Because after the successful upgrade I had to remove the line a second time to not always get the wrong notice that I should upgrade to 6.0.1 (from 6.0.1) ... Maybe this error can be caught somehow?

  27. VicDeo commented on Jan 24, 2014

    @VicDeo
    Contributor

    @te-online it might be a bug since it was reported here #6928

    I guess after the upgrade cached feed is not invalidated so the message is displayed for 30 minutes or so.

  28. te-online commented on Jan 24, 2014

    @te-online

    Yes, it was the same issue. I didn't want to wait and just temporarily removed the line from updater.php, after refreshing the page the message disappeared. Maybe it varies from server to server how many minutes this bug affects you (because for me the upgrade-url wasn't refreshed for weeks before I forced it to).

  29. locked as resolved and limited conversation to collaborators on Aug 19, 2019
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions