-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage: 'test_bpo_set_unset_preserves_acls' no longer sees expected 'BadRequest'. #8552
Comments
I'm not sure this is actually "flaky": the back-end appears to no longer return a @frankyn Can you confirm that the back-end behavior is changed? |
Very strange: the call to |
Running the system test with Python 3.6, here is what I see from a breakpoint inside (Pdb) l
432 if self.user_project is not None:
433 query_params["userProject"] = self.user_project
434
435 self.entities.clear()
436
437 -> found = client._connection.api_request(
438 method="GET", path=path, query_params=query_params
439 )
440 self.loaded = True
441 for entry in found.get("items", ()):
442 self.add_entity(self.entity_from_dict(entry))
(Pdb) pp path
'/b/bpo-acls-1562617375855/acl'
(Pdb) pp query_params
{}
(Pdb) n
> /home/tseaver/projects/agendaless/Google/src/gcp/storage/google/cloud/storage/acl.py(438)reload()
-> method="GET", path=path, query_params=query_params
(Pdb)
> /home/tseaver/projects/agendaless/Google/src/gcp/storage/google/cloud/storage/acl.py(440)reload()
-> self.loaded = True
(Pdb) pp found
{'items': [{'bucket': 'bpo-acls-1562617375855',
'entity': 'project-owners-455332057385',
'etag': 'CAI=',
'id': 'bpo-acls-1562617375855/project-owners-455332057385',
'kind': 'storage#bucketAccessControl',
'projectTeam': {'projectNumber': '455332057385', 'team': 'owners'},
'role': 'OWNER',
'selfLink': 'https://www.googleapis.com/storage/v1/b/bpo-acls-1562617375855/acl/project-owners-455332057385'},
{'bucket': 'bpo-acls-1562617375855',
'entity': 'project-editors-455332057385',
'etag': 'CAI=',
'id': 'bpo-acls-1562617375855/project-editors-455332057385',
'kind': 'storage#bucketAccessControl',
'projectTeam': {'projectNumber': '455332057385', 'team': 'editors'},
'role': 'OWNER',
'selfLink': 'https://www.googleapis.com/storage/v1/b/bpo-acls-1562617375855/acl/project-editors-455332057385'},
{'bucket': 'bpo-acls-1562617375855',
'entity': 'project-viewers-455332057385',
'etag': 'CAI=',
'id': 'bpo-acls-1562617375855/project-viewers-455332057385',
'kind': 'storage#bucketAccessControl',
'projectTeam': {'projectNumber': '455332057385', 'team': 'viewers'},
'role': 'READER',
'selfLink': 'https://www.googleapis.com/storage/v1/b/bpo-acls-1562617375855/acl/project-viewers-455332057385'}],
'kind': 'storage#bucketAccessControls'}
(Pdb) client._connection.api_request(method="GET", path=self.bucket.path)
{'kind': 'storage#bucket', 'id': 'bpo-acls-1562617375855', 'selfLink': 'https://www.googleapis.com/storage/v1/b/bpo-acls-1562617375855', 'projectNumber': '455332057385', 'name': 'bpo-acls-1562617375855', 'timeCreated': '2019-07-08T20:22:56.637Z', 'updated': '2019-07-08T20:22:58.175Z', 'metageneration': '2', 'iamConfiguration': {'bucketPolicyOnly': {'enabled': False}, 'uniformBucketLevelAccess': {'enabled': False}}, 'location': 'US', 'locationType': 'multi-region', 'storageClass': 'STANDARD', 'etag': 'CAI='} Note that the resource's |
Under Python 2.7: (Pdb) l
430 query_params = {}
431
432 if self.user_project is not None:
433 query_params["userProject"] = self.user_project
434
435 -> self.entities.clear()
436
437 found = client._connection.api_request(
438 method="GET", path=path, query_params=query_params
439 )
440 self.loaded = True
(Pdb) n
> /home/tseaver/projects/agendaless/Google/src/gcp/storage/google/cloud/storage/acl.py(437)reload()
-> found = client._connection.api_request(
(Pdb) pp path
'/b/bpo-acls-1562617750458/acl'
(Pdb) pp query_params
{}
(Pdb) n
> /home/tseaver/projects/agendaless/Google/src/gcp/storage/google/cloud/storage/acl.py(438)reload()
-> method="GET", path=path, query_params=query_params
(Pdb)
BadRequest: BadReque...-only.',)
> /home/tseaver/projects/agendaless/Google/src/gcp/storage/google/cloud/storage/acl.py(438)reload()
-> method="GET", path=path, query_params=query_params
(Pdb) client._connection.api_request(method="GET", path=self.bucket.path)
{u'kind': u'storage#bucket', u'name': u'bpo-acls-1562617750458', u'timeCreated': u'2019-07-08T20:29:11.039Z', u'locationType': u'multi-region', u'updated': u'2019-07-08T20:29:12.575Z', u'projectNumber': u'455332057385', u'metageneration': u'2', u'location': u'US', u'iamConfiguration': {u'uniformBucketLevelAccess': {u'enabled': True, u'lockedTime': u'2019-10-06T20:29:12.539Z'}, u'bucketPolicyOnly': {u'enabled': True, u'lockedTime': u'2019-10-06T20:29:12.539Z'}}, u'etag': u'CAI=', u'id': u'bpo-acls-1562617750458', u'selfLink': u'https://www.googleapis.com/storage/v1/b/bpo-acls-1562617750458', u'storageClass': u'STANDARD'} Here, the resource's |
Stepping into the calls to (Pdb) l
177 # to work properly w/ 'noAcl'.
178 query_params["projection"] = "full"
179 update_properties = {key: self._properties[key] for key in self._changes}
180
181 # Make the API call.
182 -> api_response = client._connection.api_request(
183 method="PATCH",
184 path=self.path,
185 data=update_properties,
186 query_params=query_params,
187 _target_object=self,
(Pdb) pp self.path
'/b/bpo-acls-1562618298403'
(Pdb) pp update_properties
{'iamConfiguration': {'bucketPolicyOnly': {'enabled': True},
'uniformBucketLevelAccess': {'enabled': False}}}
...
(Pdb) pp api_response
{'acl': [{'bucket': 'bpo-acls-1562618298403',
'entity': 'project-owners-455332057385',
'etag': 'CAI=',
'id': 'bpo-acls-1562618298403/project-owners-455332057385',
'kind': 'storage#bucketAccessControl',
'projectTeam': {'projectNumber': '455332057385', 'team': 'owners'},
'role': 'OWNER',
'selfLink': 'https://www.googleapis.com/storage/v1/b/bpo-acls-1562618298403/acl/project-owners-455332057385'},
{'bucket': 'bpo-acls-1562618298403',
'entity': 'project-editors-455332057385',
'etag': 'CAI=',
'id': 'bpo-acls-1562618298403/project-editors-455332057385',
'kind': 'storage#bucketAccessControl',
'projectTeam': {'projectNumber': '455332057385', 'team': 'editors'},
'role': 'OWNER',
'selfLink': 'https://www.googleapis.com/storage/v1/b/bpo-acls-1562618298403/acl/project-editors-455332057385'},
{'bucket': 'bpo-acls-1562618298403',
'entity': 'project-viewers-455332057385',
'etag': 'CAI=',
'id': 'bpo-acls-1562618298403/project-viewers-455332057385',
'kind': 'storage#bucketAccessControl',
'projectTeam': {'projectNumber': '455332057385', 'team': 'viewers'},
'role': 'READER',
'selfLink': 'https://www.googleapis.com/storage/v1/b/bpo-acls-1562618298403/acl/project-viewers-455332057385'}],
'defaultObjectAcl': [{'entity': 'project-owners-455332057385',
'etag': 'CAI=',
'kind': 'storage#objectAccessControl',
'projectTeam': {'projectNumber': '455332057385',
'team': 'owners'},
'role': 'OWNER'},
{'entity': 'project-editors-455332057385',
'etag': 'CAI=',
'kind': 'storage#objectAccessControl',
'projectTeam': {'projectNumber': '455332057385',
'team': 'editors'},
'role': 'OWNER'},
{'entity': 'project-viewers-455332057385',
'etag': 'CAI=',
'kind': 'storage#objectAccessControl',
'projectTeam': {'projectNumber': '455332057385',
'team': 'viewers'},
'role': 'READER'}],
'etag': 'CAI=',
'iamConfiguration': {'bucketPolicyOnly': {'enabled': False},
'uniformBucketLevelAccess': {'enabled': False}},
'id': 'bpo-acls-1562618298403',
'kind': 'storage#bucket',
'location': 'US',
'locationType': 'multi-region',
'metageneration': '2',
'name': 'bpo-acls-1562618298403',
'owner': {'entity': 'project-owners-455332057385'},
'projectNumber': '455332057385',
'selfLink': 'https://www.googleapis.com/storage/v1/b/bpo-acls-1562618298403',
'storageClass': 'STANDARD',
'timeCreated': '2019-07-08T20:38:19.035Z',
'updated': '2019-07-08T20:39:40.402Z'} and under Python 2.7: (Pdb) l
177 # to work properly w/ 'noAcl'.
178 query_params["projection"] = "full"
179 update_properties = {key: self._properties[key] for key in self._changes}
180
181 # Make the API call.
182 -> api_response = client._connection.api_request(
183 method="PATCH",
184 path=self.path,
185 data=update_properties,
186 query_params=query_params,
187 _target_object=self,
(Pdb) pp self.path
'/b/bpo-acls-1562618105061'
(Pdb) pp update_properties
{'iamConfiguration': {'bucketPolicyOnly': {u'enabled': True},
u'uniformBucketLevelAccess': {u'enabled': False}}}
...
-> self._set_properties(api_response)
(Pdb) pp api_response
{u'etag': u'CAI=',
u'iamConfiguration': {u'bucketPolicyOnly': {u'enabled': True,
u'lockedTime': u'2019-10-06T20:37:19.650Z'},
u'uniformBucketLevelAccess': {u'enabled': True,
u'lockedTime': u'2019-10-06T20:37:19.650Z'}},
u'id': u'bpo-acls-1562618105061',
u'kind': u'storage#bucket',
u'location': u'US',
u'locationType': u'multi-region',
u'metageneration': u'2',
u'name': u'bpo-acls-1562618105061',
u'projectNumber': u'455332057385',
u'selfLink': u'https://www.googleapis.com/storage/v1/b/bpo-acls-1562618105061',
u'storageClass': u'STANDARD',
u'timeCreated': u'2019-07-08T20:35:05.747Z',
u'updated': u'2019-07-08T20:37:19.687Z'} Clearly, the |
Back-end fix for the issue expected 2019-07-12. See #8552.
Issue is not yet fixed in production. Rollout was paused and will have an update next week. |
@tseaver the fix for this might take a few more weeks at the best case. The mitigation is to supply the same value set by BPO to UBLA in the client on a PATCH request. PATCH uri
|
This test should no longer need to be skipped. |
PR #9475 will close this issue. |
Deprecate passing / setting BPO. Closes #8552.
From this Kokoro job:
The text was updated successfully, but these errors were encountered: