owncloud / user_ldap

📒
GNU Affero General Public License v3.0
17 stars 17 forks source link

Nightly test failing with status code `500 and 503` #780

Closed SagarGi closed 1 year ago

SagarGi commented 1 year ago

Description

The nightly tests is failing when user is uploading or moving files to /localstorage in the tests.

@local_storage @files_external-app-required @skipOnEncryptionType:user-keys @encryption-issue-42 @skip_on_objectstore @newChunking
  Scenario: Deleting an updated file into external storage moves it to the trashbin and can be restored with new chunking # /var/www/owncloud/testrunner/tests/acceptance/features/apiTrashbinRestore/trashbinRestore.feature:171
    Given using new DAV path                                                                                              # FeatureContext::usingOldOrNewDavPath()
    And the administrator has invoked occ command "files:scan --all"                                                      # OccContext::theAdministratorHasInvokedOccCommand()
    And user "Alice" has created folder "/local_storage/tmp"                                                              # FeatureContext::userHasCreatedFolder()
    And user "Alice" has moved file "/textfile0.txt" to "/local_storage/tmp/textfile0.txt"                                # FeatureContext::userHasMovedFile()
      WebDav::userHasMovedFile Failed moving resource '/textfile0.txt' to '/local_storage/tmp/textfile0.txt'. Expected status code was '201' but got '500'
      Failed asserting that 500 matches expected 201.

also

@skipOnEncryptionType:user-keys @encryption-issue-181
  Scenario Outline: Share a file inside a local external storage to a group                                # /var/www/owncloud/testrunner/tests/acceptance/features/apiShareManagementBasicToShares/createShareFromLocalStorageToSharesFolder.feature:65
    Given using OCS API version "<ocs_api_version>"                                                        # FeatureContext::usingOcsApiVersion()
    And group "grp1" has been created                                                                      # FeatureContext::groupHasBeenCreated()
    And user "Alice" has been added to group "grp1"                                                        # FeatureContext::userHasBeenAddedToGroup()
    And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/local_storage/filetoshare.txt"   # FeatureContext::userHasUploadedAFileTo()
    When user "Alice" shares file "/local_storage/filetoshare.txt" with group "grp1" using the sharing API # FeatureContext::userSharesFileWithGroupUsingTheSharingApi()
    Then the OCS status code should be "<ocs_status_code>"                                                 # OCSContext::theOCSStatusCodeShouldBe()
    And the HTTP status code should be "200"                                                               # FeatureContext::thenTheHTTPStatusCodeShouldBe()
    And the fields of the last response to user "Alice" sharing with group "grp1" should include           # FeatureContext::checkFieldsOfLastResponseToUser()
      | share_with             | grp1                           |
      | share_with_displayname | grp1                           |
      | file_target            | /Shares/filetoshare.txt        |
      | path                   | /local_storage/filetoshare.txt |
      | permissions            | share,read,update              |
      | uid_owner              | %username%                     |
      | displayname_owner      | %displayname%                  |
      | item_type              | file                           |
      | mimetype               | text/plain                     |
      | storage_id             | ANY_VALUE                      |
      | share_type             | group                          |

    Examples:
      | ocs_api_version | ocs_status_code |
      | 1               | 100             |
        Failed step: And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/local_storage/filetoshare.txt"
        HTTP status code was not 201 or 204 while trying to upload file 'filesForUpload/textfile.txt' to '/local_storage/filetoshare.txt' for user 'Alice'
        Failed asserting that an array contains 503.
      | 2               | 200             |
        Failed step: And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/local_storage/filetoshare.txt"
        HTTP status code was not 201 or 204 while trying to upload file 'filesForUpload/textfile.txt' to '/local_storage/filetoshare.txt' for user 'Alice'
        Failed asserting that an array contains 503.

Build link: https://drone.owncloud.com/owncloud/user_ldap/4452/124/20

SwikritiT commented 1 year ago

There's an issue here that may be related to this https://github.com/owncloud/user_ldap/issues/747

SagarGi commented 1 year ago

This Nightly fails on mainly 3 steps in doing things in /storage

OC10 Server log:

  1. When moving files to /storage

01T01:33:23+00:00","remoteAddr":"192.168.12.9","user":"Alice","app":"webdav","method":"MOVE","url":"\/remote.php\/webdav\/textfile0.txt","message":"Exception: multikeydecrypt with share key failed:error:0909006C:PEM routines:get_name:no start line: {\"Exception\":\"OCA\\\\Encryption\\\\Exceptions\\\\MultiKeyDecryptException\",\"Message\":\"multikeydecrypt with share key failed:error:0909006C:PEM routines:get_name:no start line\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/server\\\/apps\\\/encryption\\\/lib\\\/KeyManager.php(434): OCA\\\\Encryption\\\\Crypto\\\\Crypt->multiKeyDecrypt()\\n#1 \\\/var\\\/www\\\/owncloud\\\/server\\\/apps\\\/encryption\\\/lib\\\/Crypto\\\/Encryption.php(195): OCA\\\\Encryption\\\\KeyManager->getFileKey()\\n#2 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/private\\\/Files\\\/Stream\\\/Encryption.php(261): OCA\\\\Encryption\\\\Crypto\\\\Encryption->begin()\\n#3 [internal function]: OC\\\\Files\\\\Stream\\\\Encryption->stream_open()\\n#4

  1. When Uploading files to /storage

01T01:27:46+00:00","remoteAddr":"192.168.29.9","user":"Alice","app":"webdav","method":"PUT","url":"\/remote.php\/webdav\/local_storage\/filetoshare.txt","message":"Exception: HTTP\/1.1 503 Encryption not ready: multikeydecrypt with share key failed:error:0909006C:PEM routines:get_name:no start line: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\ServiceUnavailable\",\"Message\":\"Encryption not ready: multikeydecrypt with share key failed:error:0909006C:PEM routines:get_name:no start line\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/server\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(240): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->convertToSabreException()\\n#1

Not sure if Something wrong with encryption app.

SagarGi commented 1 year ago

The failure of this can be referred to this comment. https://github.com/owncloud/encryption/issues/393#issuecomment-1493280016.

This PR https://github.com/owncloud/user_ldap/commit/e9c3f1048ef02320759fbf205e1c0835ecc89dfd has removed the encryption:select-encryption-type command from the drone star. since the latest oc10 stable still uses the encryption command to enable the master key. I will be making a PR https://github.com/owncloud/user_ldap/pull/782 to revert those changes in the drone so that when when master become stable the drone fails and we can remove that at that command at that time.

phil-davis commented 1 year ago

PR #782 has been merged. We need to check the nightly results tomorrow morning, then hopefully we can close this issue.

SagarGi commented 1 year ago

Build https://drone.owncloud.com/owncloud/user_ldap/4472 is passing. So closing this issue.