Details
-
Task
-
Resolution: Done
-
Critical
-
2.8.0
-
None
Description
Error Message
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://172.23.104.189:4985/db/_user/
Stacktrace
params_from_base_suite_setup = {'base_url_list': ['http://localhost:8080'], 'cbl_db_list': [<CBLClient.MemoryPointer.MemoryPointer object at 0x10e4d7..._accels': [], 'sync_gateways': [
{'admin': 'http://172.23.104.189:4985', 'public': 'http://172.23.104.189:4984'}]}, ...}
@pytest.mark.listener
@pytest.mark.replication
def test_system(params_from_base_suite_setup):
sg_db = "db"
sg_url = params_from_base_suite_setup["sg_url"]
sg_admin_url = params_from_base_suite_setup["sg_admin_url"]
cluster_config = params_from_base_suite_setup["cluster_config"]
sg_blip_url = params_from_base_suite_setup["target_url"]
base_url_list = params_from_base_suite_setup["base_url_list"]
sg_config = params_from_base_suite_setup["sg_config"]
db_obj_list = params_from_base_suite_setup["db_obj_list"]
cbl_db_list = params_from_base_suite_setup["cbl_db_list"]
db_name_list = params_from_base_suite_setup["db_name_list"]
query_obj_list = params_from_base_suite_setup["query_obj_list"]
sync_gateway_version = params_from_base_suite_setup["sync_gateway_version"]
resume_cluster = params_from_base_suite_setup["resume_cluster"]
generator = params_from_base_suite_setup["generator"]
enable_rebalance = params_from_base_suite_setup["enable_rebalance"]
num_of_docs = params_from_base_suite_setup["num_of_docs"]
num_of_doc_updates = params_from_base_suite_setup["num_of_doc_updates"]
num_of_docs_to_update = params_from_base_suite_setup["num_of_docs_to_update"]
num_of_docs_in_itr = params_from_base_suite_setup["num_of_docs_in_itr"]
num_of_docs_to_delete = params_from_base_suite_setup["num_of_docs_to_delete"]
num_of_docs_to_add = params_from_base_suite_setup["num_of_docs_to_add"]
up_time = params_from_base_suite_setup["up_time"]
repl_status_check_sleep_time = params_from_base_suite_setup["repl_status_check_sleep_time"]
platform_list = params_from_base_suite_setup["platform_list"]
doc_id_for_new_docs = num_of_docs
query_limit = 1000
query_offset = 0
if sync_gateway_version < "2.0.0":
pytest.skip('This test cannot run with sg version below 2.0')
channels_sg = ["ABC"]
username = "autotest"
password = "password"
- Create CBL database
sg_client = MobileRestClient()
doc_ids = set()
docs_per_db = num_of_docs // len(cbl_db_list) # Equally distributing docs to db
extra_docs = num_of_docs % len(cbl_db_list) # Docs left after equal distribution
num_of_itr_per_db = docs_per_db // num_of_docs_in_itr # iteration required to add docs in each db
extra_docs_in_itr_per_db = docs_per_db % num_of_docs_in_itr # iteration required to add docs leftover docs per db
cluster = Cluster(config=cluster_config)
if enable_rebalance:
if len(cluster.servers) < 2:
raise Exception("Please provide at least 3 servers")
server_urls = []
for server in cluster.servers:
server_urls.append(server.url)
primary_server = cluster.servers[0]
servers = cluster.servers[1:]
if not resume_cluster:
- Reset cluster to ensure no data in system
cluster.reset(sg_config_path=sg_config)
log_info("Using SG ur: {}".format(sg_admin_url))
> sg_client.create_user(sg_admin_url, sg_db, username, password, channels=channels_sg)
testsuites/CBLTester/System_test_multiple_device/test_system_testing.py:78:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
keywords/MobileRestClient.py:374: in create_user
resp.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Response [400]>
def raise_for_status(self):
"""Raises stored :class:`HTTPError`, if one occurred."""
http_error_msg = ''
if isinstance(self.reason, bytes):
- We attempt to decode utf-8 first because some servers
- choose to localize their reason strings. If the string
- isn't utf-8, we fall back to iso-8859-1 for all other
- encodings. (See PR #3538)
try:
reason = self.reason.decode('utf-8')
except UnicodeDecodeError:
reason = self.reason.decode('iso-8859-1')
else:
reason = self.reason
if 400 <= self.status_code < 500:
http_error_msg = u'%s Client Error: %s for url: %s' % (self.status_code, reason, self.url)
elif 500 <= self.status_code < 600:
http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url)
if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://172.23.104.189:4985/db/_user/
venv/lib/python3.6/site-packages/requests/models.py:939: HTTPError
Attachments
Issue Links
- Clones
-
CM-437 test_replication.test_blob_contructor_replication
-
- In Progress
-