Skip to content

SFTP unit test failures #11692

Closed
Closed

Description

@PVince81

I ran the SFTP unit tests locally to verify something and noticed that the following fail on master:

    1) Test\Files\Storage\SFTP::testHashInFileName
    Failed asserting that false matches expected 'data'.

    /srv/www/htdocs/owncloud/tests/lib/files/storage/storage.php:395

    2) Test\Files\Storage\SFTP::testRenameOverWriteDirectory
    rename must return true on success
    Failed asserting that false is true.

    /srv/www/htdocs/owncloud/tests/lib/files/storage/storage.php:460

@bantu

Activity

  1. bantu commented on Oct 21, 2014

    @bantu

    @PVince81 Feel free to look into that. I've never run those and I think they've been broken for quite a while. These tests are pointless if they are not run on a regular basis.

  2. PVince81 commented on Oct 21, 2014

    @PVince81
    ContributorAuthor

    I think the "Hash" in file name was introduced recently, so it might have discovered a bug.

  3. LukasReschke commented on Oct 22, 2014

    @LukasReschke
    Contributor

    March 31: 76c63a5

  4. added this to the milestone on Jun 1, 2015
  5. DeepDiver1975 commented on Jun 1, 2015

    @DeepDiver1975
    Contributor

    We shall take care of this in 8.2

  6. PVince81 commented on Aug 17, 2015

    @PVince81
    ContributorAuthor

    @bantu does phpseclib support overwriting directories ? If it doesn't then we'd need to auto-delete the target dir first before calling rename.

  7. PVince81 commented on Aug 17, 2015

    @PVince81
    ContributorAuthor

    Raised the hash issue upstream: phpseclib/phpseclib#778

  8. ghost added this to the milestone on Sep 21, 2015
  9. ghost removed this from the milestone on Sep 21, 2015
  10. PVince81 commented on Oct 7, 2015

    @PVince81
    ContributorAuthor

    Still happening on master / 8.2 rc1 which has an updated phpseclib:

    1) Test\Files\Storage\SFTP::testHashInFileName
    Failed asserting that false matches expected 'data'.
    
    /srv/www/htdocs/owncloud/tests/lib/files/storage/storage.php:422
    
    2) Test\Files\Storage\SFTP::testRenameOverWriteDirectory
    rename must return true on success
    Failed asserting that false is true.
    
    /srv/www/htdocs/owncloud/tests/lib/files/storage/storage.php:487
    

    Now I see that the upstream issue hasn't been fixed yet.

  11. PVince81 commented on Oct 13, 2015

    @PVince81
    ContributorAuthor

    The hash problem is not fixable (no workaround) due to upstream issue, needs to be fixed upstream first (see phpseclib/phpseclib#778)

    I suggest moving to 9.0 and hope it will be fixed by then

  12. ghost added this to the milestone on Oct 25, 2015
  13. ghost removed this from the milestone on Oct 25, 2015
  14. PVince81 commented on Feb 12, 2016

    @PVince81
    ContributorAuthor

    Fixing this requires a library update which is a bit risky past feature freeze. Moving to 9.1

  15. modified the milestones: , on Feb 12, 2016
  16. PVince81 commented on May 31, 2016

    @PVince81
    ContributorAuthor

    Reran the tests on master, yay!

    ..............................................................PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 130968 bytes) in /srv/www/htdocs/owncloud/3rdparty/phpseclib/phpseclib/phpseclib/Crypt/Base.php on line 2899
    
  17. PVince81 commented on May 31, 2016

    @PVince81
    ContributorAuthor

    Something must be running in circles, I don't see why we have these memory errors now but didn't back then:

    ..............................................................PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 53 bytes) in /srv/www/htdocs/owncloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SSH2.php on line 2943
    PHP Stack trace:
    PHP   1. {main}() /home/vincent/opt/bin/phpunit:0
    PHP   2. PHPUnit_TextUI_Command::main() /home/vincent/opt/bin/phpunit:520
    PHP   3. PHPUnit_TextUI_Command->run() phar:///home/vincent/opt/bin/phpunit/phpunit/TextUI/Command.php:109
    PHP   4. PHPUnit_TextUI_TestRunner->doRun() phar:///home/vincent/opt/bin/phpunit/phpunit/TextUI/Command.php:158
    PHP   5. PHPUnit_Framework_TestSuite->run() phar:///home/vincent/opt/bin/phpunit/phpunit/TextUI/TestRunner.php:432
    PHP   6. PHPUnit_Framework_TestCase->run() phar:///home/vincent/opt/bin/phpunit/phpunit/Framework/TestSuite.php:747
    PHP   7. PHPUnit_Framework_TestResult->run() phar:///home/vincent/opt/bin/phpunit/phpunit/Framework/TestCase.php:800
    PHP   8. PHPUnit_Framework_TestCase->runBare() phar:///home/vincent/opt/bin/phpunit/phpunit/Framework/TestResult.php:686
    PHP   9. PHPUnit_Framework_TestCase->runTest() phar:///home/vincent/opt/bin/phpunit/phpunit/Framework/TestCase.php:844
    PHP  10. ReflectionMethod->invokeArgs() phar:///home/vincent/opt/bin/phpunit/phpunit/Framework/TestCase.php:984
    PHP  11. Test\Files\Storage\Storage->testHashInFileName() phar:///home/vincent/opt/bin/phpunit/phpunit/Framework/TestCase.php:984
    PHP  12. OC\Files\Storage\Common->file_put_contents() /srv/www/htdocs/owncloud/tests/lib/Files/Storage/Storage.php:418
    PHP  13. fwrite() /srv/www/htdocs/owncloud/lib/private/Files/Storage/Common.php:193
    PHP  14. Icewind\Streams\RetryWrapper->stream_write() /srv/www/htdocs/owncloud/lib/private/Files/Storage/Common.php:193
    PHP  15. Icewind\Streams\Wrapper->stream_write() /srv/www/htdocs/owncloud/apps/files_external/3rdparty/icewind/streams/src/RetryWrapper.php:61
    PHP  16. fwrite() /srv/www/htdocs/owncloud/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php:87
    PHP  17. phpseclib\Net\SFTP\Stream->stream_write() /srv/www/htdocs/owncloud/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php:87
    PHP  18. phpseclib\Net\SFTP\Stream->__call() /srv/www/htdocs/owncloud/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php:87
    PHP  19. call_user_func_array:{/srv/www/htdocs/owncloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php:782}() /srv/www/htdocs/owncloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php:782
    PHP  20. phpseclib\Net\SFTP\Stream->_stream_write() /srv/www/htdocs/owncloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php:782
    PHP  21. phpseclib\Net\SFTP->put() /srv/www/htdocs/owncloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php:340
    PHP  22. phpseclib\Net\SFTP->_get_sftp_packet() /srv/www/htdocs/owncloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP.php:1835
    PHP  23. phpseclib\Net\SSH2->_get_channel_packet() /srv/www/htdocs/owncloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP.php:2718
    PHP  24. phpseclib\Net\SSH2->_get_binary_packet() /srv/www/htdocs/owncloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SSH2.php:3203
    PHP  25. pack() /srv/www/htdocs/owncloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SSH2.php:2943
    
  18. PVince81 commented on Jul 1, 2016

    @PVince81
    ContributorAuthor

    After updating phpseclib with #21301 this is only one failing test left: "testRenameOverWriteDirectory"

  19. modified the milestones: , 9.1 on Jul 1, 2016
  20. PVince81 commented on Jul 1, 2016

    @PVince81
    ContributorAuthor

    And the last piece of the puzzle: #25340

    Once both PRs are merged, the SFTP tests will passed and can be put in CI @DeepDiver1975

    Here are the PRs:

  21. PVince81 commented on Oct 4, 2016

    @PVince81
    ContributorAuthor

    All tests pass now on master!

  22. lock commented on Aug 3, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions