Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

set correct flag type #76

Merged
merged 1 commit into from
Feb 11, 2020
Merged

set correct flag type #76

merged 1 commit into from
Feb 11, 2020

Conversation

C0rby
Copy link
Contributor

@C0rby C0rby commented Feb 4, 2020

Fixes #75

@C0rby C0rby requested a review from butonic February 4, 2020 10:38
@update-docs
Copy link

update-docs bot commented Feb 4, 2020

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@C0rby C0rby self-assigned this Feb 4, 2020
@butonic butonic assigned butonic and unassigned C0rby Feb 11, 2020
@butonic
Copy link
Member

butonic commented Feb 11, 2020

AFAICT the problem comes from changing the global namespace to a jailed one at the endpoints.

phoenix uses the path 'is sees' and sends a request like

curl 'http://localhost:9140/ocs/v1.php/apps/files_sharing/api/v1/shares' -H 'authorization: Bearer OOB...2gnFs'  --data 'shareType=0&shareWith=marie&path=%2Ff2&permissions=1'

to create the share. but the ocs endpoint takes the path /f2 without applying the jailing, so the gateway sees /fs and does not know where to route it -> 404.

digging deeper...

manually prefixing the path in the payload with --data 'shareType=0&shareWith=marie&path=%2Fhome%2Ff2&permissions=1' works

@C0rby
Copy link
Contributor Author

C0rby commented Feb 11, 2020

I got other errors with the acceptance tests. It was about the tests where we provide invalide permissions as parameters and expect the ocs service to return an error instead of ok.
I'm working on it right now.

@butonic butonic merged commit ac3381e into master Feb 11, 2020
@delete-merged-branch delete-merged-branch bot deleted the bugfix/change-flag-type branch February 11, 2020 15:15
individual-it added a commit that referenced this pull request Feb 11, 2020
@butonic butonic restored the bugfix/change-flag-type branch February 11, 2020 18:52
@butonic
Copy link
Member

butonic commented Feb 11, 2020

these are the scenarios that failed:
L74-101

  @skipOnOcV10
  @issue-ocis-reva-20
  @issue-ocis-reva-26
  @issue-ocis-reva-43
  @issue-ocis-reva-44
  @issue-ocis-reva-64
  #after fixing all issues delete this Scenario and use the one above
  Scenario Outline: Creating a share of a file with a user and asking for various permission combinations
    Given using OCS API version "<ocs_api_version>"
    And user "user1" has been created with default attributes and without skeleton files
    When user "user0" shares file "textfile0.txt" with user "user1" with permissions <requested_permissions> using the sharing API
    Then the OCS status code should be "<ocs_status_code>"
    And the HTTP status code should be "200"
    And the OCS status message should be "error searching recipient"
    Examples:
      | ocs_api_version | requested_permissions | granted_permissions | ocs_status_code |
      # Ask for full permissions. You get share plus read plus update. create and delete do not apply to shares of a file
      | 1               | 31                    | 31                  | 996             |
      | 2               | 31                    | 31                  | 996             |
      # Ask for read, share (17), create and delete. You get share plus read
      | 1               | 29                    | 31                  | 996             |
      | 2               | 29                    | 31                  | 996             |
      # Ask for read, update, create, delete. You get read plus update.
      | 1               | 15                    | 15                  | 996             |
      | 2               | 15                    | 15                  | 996             |
      # Ask for just update. You get exactly update (you do not get read or anything else)
      | 1               | 2                     | 2                   | 996             |
      | 2               | 2                     | 2                   | 996             |

and L119-135

  @skipOnOcV10
  @issue-ocis-reva-45
  @issue-ocis-reva-64
  #after fixing all issues delete this Scenario and use the one above
  Scenario Outline: Creating a share of a file with no permissions should fail
    Given using OCS API version "<ocs_api_version>"
    And user "user1" has been created with default attributes and without skeleton files
    And user "user0" has uploaded file with content "user0 file" to "randomfile.txt"
    When user "user0" shares file "randomfile.txt" with user "user1" with permissions "0" using the sharing API
    Then the OCS status code should be "996"
    And the OCS status message should be "error searching recipient"
    And the HTTP status code should be "<http_status_code>"
    And as "user1" file "randomfile.txt" should not exist
    Examples:
      | ocs_api_version | http_status_code |
      | 1               | 200              |
      | 2               | 200              |

L153-169

  @skipOnOcV10
  @issue-ocis-reva-45
  @issue-ocis-reva-64
  #after fixing all issues delete this Scenario and use the one above
  Scenario Outline: Creating a share of a folder with no permissions should fail
    Given using OCS API version "<ocs_api_version>"
    And user "user1" has been created with default attributes and without skeleton files
    And user "user0" has created folder "/afolder"
    When user "user0" shares folder "afolder" with user "user1" with permissions "0" using the sharing API
    Then the OCS status code should be "996"
    And the OCS status message should be "error searching recipient"
    And the HTTP status code should be "<http_status_code>"
    And as "user1" folder "afolder" should not exist
    Examples:
      | ocs_api_version | http_status_code |
      | 1               | 200              |
      | 2               | 200              |

L201-219

  @skipOnOcV10
  @issue-ocis-reva-20
  @issue-ocis-reva-26
  @issue-ocis-reva-43
  @issue-ocis-reva-46
  @issue-ocis-reva-64
  #after fixing all issues delete this Scenario and use the one above
  Scenario Outline: Creating a share of a folder with a user, the default permissions are all permissions(31)
    Given using OCS API version "<ocs_api_version>"
    And user "user1" has been created with default attributes and without skeleton files
    And user "user0" has created folder "/FOLDER"
    When user "user0" shares folder "/FOLDER" with user "user1" using the sharing API
    Then the OCS status code should be "<ocs_status_code>"
    And the OCS status message should be "error searching recipient"
    And the HTTP status code should be "200"
    Examples:
      | ocs_api_version | ocs_status_code |
      | 1               | 996             |
      | 2               | 996             |

the flags of this PR makes the storageprovider for root actually run a storage ...
hm for ocis the SharingHelper prefixes the path with /home in L113-0116

		if (OcisHelper::isTestingOnOcis()) {
			$path = "/home/" . $path;
			$path = WebDavHelper::sanitizeUrl($path);
		}

That should jail all api sharing requests to the home storage which makes sense, well, it hides the reva ocs sharing bug that always uses the global namespace ...

Well it helps to look at the actual errors


@skipOnOcV10 @issue-ocis-reva-45 @issue-ocis-reva-64 | 283s
-- | --
1018 | Scenario Outline: Cannot create a share of a file or folder with invalid permissions   # /srv/app/testrunner/tests/acceptance/features/apiShareCreateSpecial2/createShareWithInvalidPermissions.feature:34 | 283s
1019 | Given using OCS API version "<ocs_api_version>"                                      # FeatureContext::usingOcsApiVersion() | 283s
1020 | And user "user1" has been created with default attributes and without skeleton files # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles() | 283s
1021 | When user "user0" creates a share using the sharing API with settings                # FeatureContext::userCreatesAShareWithSettings() | 283s
1022 | \| path        \| <item>        \| | 283s
1023 | \| shareWith   \| user1         \| | 283s
1024 | \| shareType   \| user          \| | 283s
1025 | \| permissions \| <permissions> \| | 283s
1026 | Then the OCS status code should be "<ocs_status_code>"                               # OCSContext::theOCSStatusCodeShouldBe() | 283s
1027 | And the HTTP status code should be "<http_status_code>"                              # FeatureContext::thenTheHTTPStatusCodeShouldBe() | 283s
1028 | And as "user1" entry "<item>" should not exist                                       # FeatureContext::asFileOrFolderShouldNotExist() | 283s
1029 |   | 283s
1030 | Examples: | 283s
1031 | \| ocs_api_version \| ocs_status_code \| http_status_code \| item          \| permissions \| | 283s
1032 | \| 1               \| 996             \| 200              \| textfile0.txt \| 0           \| | 283s
1033 | OCS status code is not the expected value | 283s
1034 | Failed asserting that two strings are equal. | 283s
1035 | --- Expected | 283s
1036 | +++ Actual | 283s
1037 | @@ @@ | 283s
1038 | -'996' | 283s
1039 | +'100' | 283s
1040 | \| 2               \| 996             \| 200              \| textfile0.txt \| 0           \| | 283s
1041 | OCS status code is not the expected value | 283s
1042 | Failed asserting that two strings are equal. | 283s
1043 | --- Expected | 283s
1044 | +++ Actual | 283s
1045 | @@ @@ | 283s
1046 | -'996' | 283s
1047 | +'100' | 283s
1048 | \| 1               \| 996             \| 200              \| PARENT        \| 0           \| | 284s
1049 | OCS status code is not the expected value | 284s
1050 | Failed asserting that two strings are equal. | 284s
1051 | --- Expected | 284s
1052 | +++ Actual | 284s
1053 | @@ @@ | 284s
1054 | -'996' | 284s
1055 | +'100' | 284s
1056 | \| 2               \| 996             \| 200              \| PARENT        \| 0           \| | 284s
1057 | OCS status code is not the expected value | 284s
1058 | Failed asserting that two strings are equal. | 284s
1059 | --- Expected | 284s
1060 | +++ Actual | 284s
1061 | @@ @@ | 284s
1062 | -'996' | 284s
1063 | +'100' | 284s
1064 | \| 1               \| 996             \| 200              \| textfile0.txt \| 32          \| | 284s
1065 | OCS status code is not the expected value | 284s
1066 | Failed asserting that two strings are equal. | 284s
1067 | --- Expected | 284s
1068 | +++ Actual | 284s
1069 | @@ @@ | 284s
1070 | -'996' | 284s
1071 | +'100' | 284s
1072 | \| 2               \| 996             \| 200              \| textfile0.txt \| 32          \| | 285s
1073 | OCS status code is not the expected value | 285s
1074 | Failed asserting that two strings are equal. | 285s
1075 | --- Expected | 285s
1076 | +++ Actual | 285s
1077 | @@ @@ | 285s
1078 | -'996' | 285s
1079 | +'100' | 285s
1080 | \| 1               \| 996             \| 200              \| PARENT        \| 32          \| | 285s
1081 | OCS status code is not the expected value | 285s
1082 | Failed asserting that two strings are equal. | 285s
1083 | --- Expected | 285s
1084 | +++ Actual | 285s
1085 | @@ @@ | 285s
1086 | -'996' | 285s
1087 | +'100' | 285s
1088 | \| 2               \| 996             \| 200              \| PARENT        \| 32          \| | 285s
1089 | OCS status code is not the expected value | 285s
1090 | Failed asserting that two strings are equal. | 285s
1091 | --- Expected | 285s
1092 | +++ Actual | 285s
1093 | @@ @@ | 285s
1094 | -'996' | 285s
1095 | +'100' | 285s
1096 |   | 285s
1097 | @skipOnOcV10 @issue-ocis-reva-45 @issue-ocis-reva-64 | 286s
1098 | Scenario Outline: Cannot create a share of a file with a user with only create permission # /srv/app/testrunner/tests/acceptance/features/apiShareCreateSpecial2/createShareWithInvalidPermissions.feature:75 | 286s
1099 | Given using OCS API version "<ocs_api_version>"                                         # FeatureContext::usingOcsApiVersion() | 286s
1100 | And user "user1" has been created with default attributes and without skeleton files    # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles() | 286s
1101 | When user "user0" creates a share using the sharing API with settings                   # FeatureContext::userCreatesAShareWithSettings() | 286s
1102 | \| path        \| textfile0.txt \| | 286s
1103 | \| shareWith   \| user1         \| | 286s
1104 | \| shareType   \| user          \| | 286s
1105 | \| permissions \| create        \| | 286s
1106 | Then the OCS status code should be "<ocs_status_code>"                                  # OCSContext::theOCSStatusCodeShouldBe() | 286s
1107 | And the HTTP status code should be "<http_status_code>"                                 # FeatureContext::thenTheHTTPStatusCodeShouldBe() | 286s
1108 | And as "user1" entry "textfile0.txt" should not exist                                   # FeatureContext::asFileOrFolderShouldNotExist() | 286s
1109 |   | 286s
1110 | Examples: | 286s
1111 | \| ocs_api_version \| ocs_status_code \| http_status_code \| | 286s
1112 | \| 1               \| 996             \| 200              \| | 286s
1113 | OCS status code is not the expected value | 286s
1114 | Failed asserting that two strings are equal. | 286s
1115 | --- Expected | 286s
1116 | +++ Actual | 286s
1117 | @@ @@ | 286s
1118 | -'996' | 286s
1119 | +'100' | 286s
1120 | \| 2               \| 996             \| 200              \| | 286s
1121 | OCS status code is not the expected value | 286s
1122 | Failed asserting that two strings are equal. | 286s
1123 | --- Expected | 286s
1124 | +++ Actual | 286s
1125 | @@ @@ | 286s
1126 | -'996' | 286s
1127 | +'100' | 286s
1128 |   | 286s
1129 | @skipOnOcV10 @issue-ocis-reva-45 @issue-ocis-reva-64 | 286s
1130 | Scenario Outline: Cannot create a share of a file with a user with only (create,delete) permission # /srv/app/testrunner/tests/acceptance/features/apiShareCreateSpecial2/createShareWithInvalidPermissions.feature:112 | 286s
1131 | Given using OCS API version "<ocs_api_version>"                                                  # FeatureContext::usingOcsApiVersion() | 286s
1132 | And user "user1" has been created with default attributes and without skeleton files             # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles() | 286s
1133 | When user "user0" creates a share using the sharing API with settings                            # FeatureContext::userCreatesAShareWithSettings() | 286s
1134 | \| path        \| textfile0.txt \| | 286s
1135 | \| shareWith   \| user1         \| | 286s
1136 | \| shareType   \| user          \| | 286s
1137 | \| permissions \| <permissions> \| | 286s
1138 | Then the OCS status code should be "<ocs_status_code>"                                           # OCSContext::theOCSStatusCodeShouldBe() | 286s
1139 | And the HTTP status code should be "<http_status_code>"                                          # FeatureContext::thenTheHTTPStatusCodeShouldBe() | 286s
1140 | And as "user1" entry "textfile0.txt" should not exist                                            # FeatureContext::asFileOrFolderShouldNotExist() | 286s
1141 |   | 286s
1142 | Examples: | 286s
1143 | \| ocs_api_version \| ocs_status_code \| http_status_code \| permissions   \| | 286s
1144 | \| 1               \| 996             \| 200              \| delete        \| | 286s
1145 | OCS status code is not the expected value | 286s
1146 | Failed asserting that two strings are equal. | 286s
1147 | --- Expected | 286s
1148 | +++ Actual | 286s
1149 | @@ @@ | 286s
1150 | -'996' | 286s
1151 | +'100' | 286s
1152 | \| 2               \| 996             \| 200              \| delete        \| | 287s
1153 | OCS status code is not the expected value | 287s
1154 | Failed asserting that two strings are equal. | 287s
1155 | --- Expected | 287s
1156 | +++ Actual | 287s
1157 | @@ @@ | 287s
1158 | -'996' | 287s
1159 | +'100' | 287s
1160 | \| 1               \| 996             \| 200              \| create,delete \| | 287s
1161 | OCS status code is not the expected value | 287s
1162 | Failed asserting that two strings are equal. | 287s
1163 | --- Expected | 287s
1164 | +++ Actual | 287s
1165 | @@ @@ | 287s
1166 | -'996' | 287s
1167 | +'100' | 287s
1168 | \| 2               \| 996             \| 200              \| create,delete \| | 287s
1169 | OCS status code is not the expected value | 287s
1170 | Failed asserting that two strings are equal. | 287s
1171 | --- Expected | 287s
1172 | +++ Actual | 287s
1173 | @@ @@ | 287s
1174 | -'996' | 287s
1175 | +'100' | 287s
1176 |   | 287s
1177 | @api @TestAlsoOnExternalUserBackend @files_sharing-app-required | 287s
1178 | Feature: sharing | 287s
1179 |   | 287s
1180 | Background:                                                                                       # /srv/app/testrunner/tests/acceptance/features/apiShareManagementBasic/createShare.feature:4 | 287s
1181 | Given user "user0" has been created with default attributes and without skeleton files          # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles() | 287s
1182 | And user "user0" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt" # FeatureContext::userHasUploadedAFileWithContentTo() | 287s
1183 |   | 287s
1184 | @skipOnOcV10 @issue-ocis-reva-20 @issue-ocis-reva-26 @issue-ocis-reva-43 @issue-ocis-reva-44 @issue-ocis-reva-64 | 288s
1185 | Scenario Outline: Creating a share of a file with a user and asking for various permission combinations                          # /srv/app/testrunner/tests/acceptance/features/apiShareManagementBasic/createShare.feature:81 | 288s
1186 | Given using OCS API version "<ocs_api_version>"                                                                                # FeatureContext::usingOcsApiVersion() | 288s
1187 | And user "user1" has been created with default attributes and without skeleton files                                           # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles() | 288s
1188 | When user "user0" shares file "textfile0.txt" with user "user1" with permissions <requested_permissions> using the sharing API # FeatureContext::userSharesFileWithUserUsingTheSharingApi() | 288s
1189 | Then the OCS status code should be "<ocs_status_code>"                                                                         # OCSContext::theOCSStatusCodeShouldBe() | 288s
1190 | And the HTTP status code should be "200"                                                                                       # FeatureContext::thenTheHTTPStatusCodeShouldBe() | 288s
1191 | And the OCS status message should be "error searching recipient"                                                               # OCSContext::theOCSStatusMessageShouldBe() | 288s
1192 |   | 288s
1193 | Examples: | 288s
1194 | \| ocs_api_version \| requested_permissions \| granted_permissions \| ocs_status_code \| | 288s
1195 | \| 1               \| 31                    \| 31                  \| 996             \| | 288s
1196 | OCS status code is not the expected value | 288s
1197 | Failed asserting that two strings are equal. | 288s
1198 | --- Expected | 288s
1199 | +++ Actual | 288s
1200 | @@ @@ | 288s
1201 | -'996' | 288s
1202 | +'100' | 288s
1203 | \| 2               \| 31                    \| 31                  \| 996             \| | 288s
1204 | OCS status code is not the expected value | 288s
1205 | Failed asserting that two strings are equal. | 288s
1206 | --- Expected | 288s
1207 | +++ Actual | 288s
1208 | @@ @@ | 288s
1209 | -'996' | 288s
1210 | +'100' | 288s
1211 | \| 1               \| 29                    \| 31                  \| 996             \| | 288s
1212 | OCS status code is not the expected value | 288s
1213 | Failed asserting that two strings are equal. | 288s
1214 | --- Expected | 288s
1215 | +++ Actual | 288s
1216 | @@ @@ | 288s
1217 | -'996' | 288s
1218 | +'100' | 288s
1219 | \| 2               \| 29                    \| 31                  \| 996             \| | 289s
1220 | OCS status code is not the expected value | 289s
1221 | Failed asserting that two strings are equal. | 289s
1222 | --- Expected | 289s
1223 | +++ Actual | 289s
1224 | @@ @@ | 289s
1225 | -'996' | 289s
1226 | +'100' | 289s
1227 | \| 1               \| 15                    \| 15                  \| 996             \| | 289s
1228 | OCS status code is not the expected value | 289s
1229 | Failed asserting that two strings are equal. | 289s
1230 | --- Expected | 289s
1231 | +++ Actual | 289s
1232 | @@ @@ | 289s
1233 | -'996' | 289s
1234 | +'100' | 289s
1235 | \| 2               \| 15                    \| 15                  \| 996             \| | 289s
1236 | OCS status code is not the expected value | 289s
1237 | Failed asserting that two strings are equal. | 289s
1238 | --- Expected | 289s
1239 | +++ Actual | 289s
1240 | @@ @@ | 289s
1241 | -'996' | 289s
1242 | +'100' | 289s
1243 | \| 1               \| 2                     \| 2                   \| 996             \| | 290s
1244 | OCS status code is not the expected value | 290s
1245 | Failed asserting that two strings are equal. | 290s
1246 | --- Expected | 290s
1247 | +++ Actual | 290s
1248 | @@ @@ | 290s
1249 | -'996' | 290s
1250 | +'100' | 290s
1251 | \| 2               \| 2                     \| 2                   \| 996             \| | 290s
1252 | OCS status code is not the expected value | 290s
1253 | Failed asserting that two strings are equal. | 290s
1254 | --- Expected | 290s
1255 | +++ Actual | 290s
1256 | @@ @@ | 290s
1257 | -'996' | 290s
1258 | +'100' | 290s
1259 |   | 290s
1260 | @skipOnOcV10 @issue-ocis-reva-45 @issue-ocis-reva-64 | 291s
1261 | Scenario Outline: Creating a share of a file with no permissions should fail                                  # /srv/app/testrunner/tests/acceptance/features/apiShareManagementBasic/createShare.feature:123 | 291s
1262 | Given using OCS API version "<ocs_api_version>"                                                             # FeatureContext::usingOcsApiVersion() | 291s
1263 | And user "user1" has been created with default attributes and without skeleton files                        # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles() | 291s
1264 | And user "user0" has uploaded file with content "user0 file" to "randomfile.txt"                            # FeatureContext::userHasUploadedAFileWithContentTo() | 291s
1265 | When user "user0" shares file "randomfile.txt" with user "user1" with permissions "0" using the sharing API # FeatureContext::userSharesFileWithUserUsingTheSharingApi() | 291s
1266 | Then the OCS status code should be "996"                                                                    # OCSContext::theOCSStatusCodeShouldBe() | 291s
1267 | And the OCS status message should be "error searching recipient"                                            # OCSContext::theOCSStatusMessageShouldBe() | 291s
1268 | And the HTTP status code should be "<http_status_code>"                                                     # FeatureContext::thenTheHTTPStatusCodeShouldBe() | 291s
1269 | And as "user1" file "randomfile.txt" should not exist                                                       # FeatureContext::asFileOrFolderShouldNotExist() | 291s
1270 |   | 291s
1271 | Examples: | 291s
1272 | \| ocs_api_version \| http_status_code \| | 291s
1273 | \| 1               \| 200              \| | 291s
1274 | OCS status code is not the expected value | 291s
1275 | Failed asserting that two strings are equal. | 291s
1276 | --- Expected | 291s
1277 | +++ Actual | 291s
1278 | @@ @@ | 291s
1279 | -'996' | 291s
1280 | +'100' | 291s
1281 | \| 2               \| 200              \| | 293s
1282 | OCS status code is not the expected value | 293s
1283 | Failed asserting that two strings are equal. | 293s
1284 | --- Expected | 293s
1285 | +++ Actual | 293s
1286 | @@ @@ | 293s
1287 | -'996' | 293s
1288 | +'100' | 293s
1289 |   | 293s
1290 | @skipOnOcV10 @issue-ocis-reva-45 @issue-ocis-reva-64 | 293s
1291 | Scenario Outline: Creating a share of a folder with no permissions should fail                           # /srv/app/testrunner/tests/acceptance/features/apiShareManagementBasic/createShare.feature:157 | 293s
1292 | Given using OCS API version "<ocs_api_version>"                                                        # FeatureContext::usingOcsApiVersion() | 293s
1293 | And user "user1" has been created with default attributes and without skeleton files                   # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles() | 293s
1294 | And user "user0" has created folder "/afolder"                                                         # FeatureContext::userHasCreatedFolder() | 293s
1295 | When user "user0" shares folder "afolder" with user "user1" with permissions "0" using the sharing API # FeatureContext::userSharesFileWithUserUsingTheSharingApi() | 293s
1296 | Then the OCS status code should be "996"                                                               # OCSContext::theOCSStatusCodeShouldBe() | 293s
1297 | And the OCS status message should be "error searching recipient"                                       # OCSContext::theOCSStatusMessageShouldBe() | 293s
1298 | And the HTTP status code should be "<http_status_code>"                                                # FeatureContext::thenTheHTTPStatusCodeShouldBe() | 293s
1299 | And as "user1" folder "afolder" should not exist                                                       # FeatureContext::asFileOrFolderShouldNotExist() | 293s
1300 |   | 293s
1301 | Examples: | 293s
1302 | \| ocs_api_version \| http_status_code \| | 293s
1303 | \| 1               \| 200              \| | 293s
1304 | OCS status code is not the expected value | 293s
1305 | Failed asserting that two strings are equal. | 293s
1306 | --- Expected | 293s
1307 | +++ Actual | 293s
1308 | @@ @@ | 293s
1309 | -'996' | 293s
1310 | +'100' | 293s
1311 | \| 2               \| 200              \| | 293s
1312 | OCS status code is not the expected value | 293s
1313 | Failed asserting that two strings are equal. | 293s
1314 | --- Expected | 293s
1315 | +++ Actual | 293s
1316 | @@ @@ | 293s
1317 | -'996' | 293s
1318 | +'100' | 293s
1319 |   | 293s
1320 | @skipOnOcV10 @issue-ocis-reva-20 @issue-ocis-reva-26 @issue-ocis-reva-43 @issue-ocis-reva-46 @issue-ocis-reva-64 | 294s
1321 | Scenario Outline: Creating a share of a folder with a user, the default permissions are all permissions(31) # /srv/app/testrunner/tests/acceptance/features/apiShareManagementBasic/createShare.feature:208 | 294s
1322 | Given using OCS API version "<ocs_api_version>"                                                           # FeatureContext::usingOcsApiVersion() | 294s
1323 | And user "user1" has been created with default attributes and without skeleton files                      # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles() | 294s
1324 | And user "user0" has created folder "/FOLDER"                                                             # FeatureContext::userHasCreatedFolder() | 294s
1325 | When user "user0" shares folder "/FOLDER" with user "user1" using the sharing API                         # FeatureContext::userSharesFileWithUserUsingTheSharingApi() | 294s
1326 | Then the OCS status code should be "<ocs_status_code>"                                                    # OCSContext::theOCSStatusCodeShouldBe() | 294s
1327 | And the OCS status message should be "error searching recipient"                                          # OCSContext::theOCSStatusMessageShouldBe() | 294s
1328 | And the HTTP status code should be "200"                                                                  # FeatureContext::thenTheHTTPStatusCodeShouldBe() | 294s
1329 |   | 294s
1330 | Examples: | 294s
1331 | \| ocs_api_version \| ocs_status_code \| | 294s
1332 | \| 1               \| 996             \| | 294s
1333 | OCS status code is not the expected value | 294s
1334 | Failed asserting that two strings are equal. | 294s
1335 | --- Expected | 294s
1336 | +++ Actual | 294s
1337 | @@ @@ | 294s
1338 | -'996' | 294s
1339 | +'100' | 294s
1340 | \| 2               \| 996             \| | 294s
1341 | OCS status code is not the expected value | 294s
1342 | Failed asserting that two strings are equal. | 294s
1343 | --- Expected | 294s
1344 | +++ Actual | 294s
1345 | @@ @@ | 294s
1346 | -'996' | 294s
1347 | +'100'

It seems the users service now returns a user ... wtf ...

will continue digging tomorrow ...

@individual-it
Copy link
Member

adding /home was partly removed from the tests in owncloud/core#36884 This one was left over, because it made the tests pass as they are currently. If its not supposed to be there anymore we need to remove it in core.

Steps to reproduce the current issue in CI manually:

all steps done using LDAP. Reva started with this command:

bin/ocis-reva gateway &\
bin/ocis-reva users & \
REVA_USERS_DRIVER=ldap bin/ocis-reva auth-basic & \
bin/ocis-reva auth-bearer &  \
bin/ocis-reva sharing &  \
bin/ocis-reva storage-root &  \
REVA_STORAGE_HOME_EXPOSE_DATA_SERVER=1 bin/ocis-reva storage-home &  \
bin/ocis-reva storage-home-data &  \
REVA_STORAGE_OC_EXPOSE_DATA_SERVER=1 bin/ocis-reva storage-oc &  \
bin/ocis-reva storage-oc-data &  \
bin/ocis-reva frontend
  1. Upload a file: curl -u user0:123456 -X PUT http://localhost:9140/remote.php/webdav/textfile0.txt -d "data for file"
  2. make sure the file is there and PROPFIND works on both endpoints curl -u user0:123456 -X PROPFIND http://localhost:9140/remote.php/webdav/textfile0.txt
    curl -u user0:123456 -X PROPFIND http://localhost:9140/remote.php/dav/files/user0/textfile0.txt
  3. try to share the file with different path:
  • %2Fhome%2Ftextfile0.txt: curl -u user0:123456 -X POST http://localhost:9140/ocs/v1.php/apps/files_sharing/api/v1/shares -d "permissions=31&path=%2Fhome%2Ftextfile0.txt&shareType=0&shareWith=user1" -v
  • %2Ftextfile0.txt: curl -u user0:123456 -X POST http://localhost:9140/ocs/v1.php/apps/files_sharing/api/v1/shares -d "permissions=31&path=%2Ftextfile0.txt&shareType=0&shareWith=user1" -v
  • textfile0.txt: curl -u user0:123456 -X POST http://localhost:9140/ocs/v1.php/apps/files_sharing/api/v1/shares -d "permissions=31&path=textfile0.txt&shareType=0&shareWith=user1" -v

Results

with with 2b2e7f0

in every case the result is:

HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<ocs><meta><status>error</status><statuscode>996</statuscode><message>error searching recipient</message></meta></ocs>

with ac3381e

  • %2Fhome%2Ftextfile0.txt: Empty reply from server
    ocis-log:
2020/02/12 09:22:53 http: panic serving 127.0.0.1:34246: runtime error: invalid memory address or nil pointer dereference
goroutine 15 [running]:
net/http.(*conn).serve.func1(0xc00055a000)
	/usr/local/go/src/net/http/server.go:1767 +0x139
panic(0x1048a80, 0x1ff0180)
	/usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/cs3org/reva/internal/http/services/owncloud/ocs.(*SharesHandler).createShare(0xc000444d50, 0x7f6776913fd8, 0xc000513f20, 0xc000292600)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/internal/http/services/owncloud/ocs/shares.go:262 +0x80e
github.com/cs3org/reva/internal/http/services/owncloud/ocs.(*SharesHandler).ServeHTTP(0xc000444d50, 0x7f6776913fd8, 0xc000513f20, 0xc000292600)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/internal/http/services/owncloud/ocs/shares.go:73 +0x351
github.com/cs3org/reva/internal/http/services/owncloud/ocs.(*AppsHandler).ServeHTTP(0xc000444d40, 0x7f6776913fd8, 0xc000513f20, 0xc000292600)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/internal/http/services/owncloud/ocs/apps.go:49 +0x3e2
github.com/cs3org/reva/internal/http/services/owncloud/ocs.(*V1Handler).Handler.func1(0x7f6776913fd8, 0xc000513f20, 0xc000292600)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/internal/http/services/owncloud/ocs/v1.go:53 +0x1c8
net/http.HandlerFunc.ServeHTTP(0xc0005946a0, 0x7f6776913fd8, 0xc000513f20, 0xc000292600)
	/usr/local/go/src/net/http/server.go:2007 +0x44
github.com/cs3org/reva/internal/http/services/owncloud/ocs.(*svc).Handler.func1(0x7f6776913fd8, 0xc000513f20, 0xc000292600)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/internal/http/services/owncloud/ocs/ocs.go:95 +0x1ff
net/http.HandlerFunc.ServeHTTP(0xc000444d80, 0x7f6776913fd8, 0xc000513f20, 0xc000292600)
	/usr/local/go/src/net/http/server.go:2007 +0x44
github.com/cs3org/reva/pkg/rhttp.traceHandler.func1(0x7f6776913fd8, 0xc000513f20, 0xc000292400)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/pkg/rhttp/rhttp.go:300 +0x185
net/http.HandlerFunc.ServeHTTP(0xc000486b10, 0x7f6776913fd8, 0xc000513f20, 0xc000292400)
	/usr/local/go/src/net/http/server.go:2007 +0x44
github.com/cs3org/reva/pkg/rhttp.(*Server).getHandler.func1(0x7f6776913fd8, 0xc000513f20, 0xc000292400)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/pkg/rhttp/rhttp.go:239 +0x287
net/http.HandlerFunc.ServeHTTP(0xc0001a6fb0, 0x7f6776913fd8, 0xc000513f20, 0xc000292400)
	/usr/local/go/src/net/http/server.go:2007 +0x44
github.com/cs3org/reva/pkg/rhttp.traceHandler.func1(0x7f6776913fd8, 0xc000513f20, 0xc000292300)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/pkg/rhttp/rhttp.go:300 +0x185
net/http.HandlerFunc.ServeHTTP(0xc000513320, 0x7f6776913fd8, 0xc000513f20, 0xc000292300)
	/usr/local/go/src/net/http/server.go:2007 +0x44
github.com/rs/cors.(*Cors).Handler.func1(0x7f6776913fd8, 0xc000513f20, 0xc000292300)
	/home/artur/go/pkg/mod/github.com/rs/cors@v1.7.0/cors.go:219 +0x1b8
net/http.HandlerFunc.ServeHTTP(0xc0003d5780, 0x7f6776913fd8, 0xc000513f20, 0xc000292300)
	/usr/local/go/src/net/http/server.go:2007 +0x44
github.com/cs3org/reva/pkg/rhttp.traceHandler.func1(0x7f6776913fd8, 0xc000513f20, 0xc000292200)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/pkg/rhttp/rhttp.go:300 +0x185
net/http.HandlerFunc.ServeHTTP(0xc0005136e0, 0x7f6776913fd8, 0xc000513f20, 0xc000292200)
	/usr/local/go/src/net/http/server.go:2007 +0x44
github.com/cs3org/reva/internal/http/interceptors/auth.New.func1.1(0x7f6776913fd8, 0xc000513f20, 0xc00054cd00)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/internal/http/interceptors/auth/auth.go:230 +0xdb9
net/http.HandlerFunc.ServeHTTP(0xc000414510, 0x7f6776913fd8, 0xc000513f20, 0xc00054cd00)
	/usr/local/go/src/net/http/server.go:2007 +0x44
github.com/cs3org/reva/pkg/rhttp.traceHandler.func1(0x7f6776913fd8, 0xc000513f20, 0xc00054cc00)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/pkg/rhttp/rhttp.go:300 +0x185
net/http.HandlerFunc.ServeHTTP(0xc000513710, 0x7f6776913fd8, 0xc000513f20, 0xc00054cc00)
	/usr/local/go/src/net/http/server.go:2007 +0x44
github.com/cs3org/reva/internal/http/interceptors/log.loggingHandler.ServeHTTP(0x17c5620, 0xc000513710, 0x17dd080, 0xc0000a4a00, 0xc00054cc00)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/internal/http/interceptors/log/log.go:57 +0x297
github.com/cs3org/reva/pkg/rhttp.traceHandler.func1(0x17dd080, 0xc0000a4a00, 0xc00054cb00)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/pkg/rhttp/rhttp.go:300 +0x185
net/http.HandlerFunc.ServeHTTP(0xc000513740, 0x17dd080, 0xc0000a4a00, 0xc00054cb00)
	/usr/local/go/src/net/http/server.go:2007 +0x44
github.com/cs3org/reva/internal/http/interceptors/appctx.handler.func1(0x17dd080, 0xc0000a4a00, 0xc00054ca00)
	/home/artur/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200115110931-4c7513415ec5/internal/http/interceptors/appctx/appctx.go:52 +0x5e5
net/http.HandlerFunc.ServeHTTP(0xc000558070, 0x17dd080, 0xc0000a4a00, 0xc00054ca00)
	/usr/local/go/src/net/http/server.go:2007 +0x44
go.opencensus.io/plugin/ochttp.(*Handler).ServeHTTP(0xc0000a4550, 0x17dd080, 0xc0000a4a00, 0xc00054c800)
	/home/artur/go/pkg/mod/go.opencensus.io@v0.22.2/plugin/ochttp/server.go:92 +0x2b9
net/http.serverHandler.ServeHTTP(0xc0004da000, 0x17dc040, 0xc0004da0e0, 0xc00054c800)
	/usr/local/go/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc00055a000, 0x17e1580, 0xc000081080)
	/usr/local/go/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:2927 +0x38e
  • %2Ftextfile0.txt:
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<ocs><meta><status>error</status><statuscode>998</statuscode><message>not found</message></meta></ocs>
  • textfile0.txt:
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<ocs><meta><status>error</status><statuscode>996</statuscode><message>grpc stat request failed</message></meta></ocs>

@C0rby
Copy link
Contributor Author

C0rby commented Feb 12, 2020

Could you try starting ocis-reva users with REVA_USERS_DRIVER=ldap and then execute the tests again?

@butonic butonic mentioned this pull request Feb 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

micro/cli update broke users and storage-root service
3 participants