Not able to access the reportportal backend with https connection

426 views
Skip to first unread message

sumeet m

unread,
May 1, 2019, 1:08:16 AM5/1/19
to lemoncheesecake
Hi Team,

We see that report portal backend with https connection requires 2 more parameter to be set when sending the data to reportportal. 

Below is the example i am referring :

But in lemoncheese cake we dont use this parameters. Can we have this 2 more parameter to pass jks keystore and also password for certificate for https.


Error which i am facing now from lcc when sending data to report portal is as follows:
Traceback (most recent call last):
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/reportportal_client/service_async.py", line 209, in process_item
    getattr(self.rp_client, method)(**kwargs)
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/reportportal_client/service.py", line 127, in start_launch
    r = self.session.post(url=url, json=data)
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/requests/sessions.py", line 581, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='report-portal.****.com', port=8080): Max retries exceeded with url: /api/v1/api_automation/launch (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))
                                                      

Could you please check this issue and let us know if any solution to this issue.

Thanks
Sumeet

nicola...@gmail.com

unread,
May 1, 2019, 11:49:36 AM5/1/19
to lemoncheesecake
Hello Sumeet,

I guess that the certificate you installed on ReportPortal is a self-signed one and then it is not trusted by the ReportPortal python client (https://github.com/reportportal/client-Python/) that uses requests (https://2.python-requests.org/en/master/) behind the scene. That's why you encounter this SSL error.

While this is not documented in lemoncheesecake not the ReportPortal python client, you can pass explicitly to requests a trusted certificate chain by pointing the environment variable REQUEST_CA_BUNDLE to a file that contains your trust chain (in your case, it will be your self-signed certificate if this is what you are using). This is explained here: https://2.python-requests.org/en/master/user/advanced/#ssl-cert-verification

Best regards,

Nicolas.

sumeet m

unread,
May 1, 2019, 7:51:24 PM5/1/19
to lemoncheesecake
Hi Nicolas,

Thanks alot for pointing to requests_ca_bundle property.

After i have set the above property. lcc is now able top connect but with the below error and not sending the test data to report portal.

Got the following exception using ReportPortal, test results have not been properly synced:
Traceback (most recent call last):
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/reportportal_client/service_async.py", line 208, in process_item
    getattr(self.rp_client, method)(**kwargs)
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/reportportal_client/service.py", line 144, in finish_launch
    status=status)
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/reportportal_client/service.py", line 138, in _finalize_launch
    self.stack.pop()
IndexError: pop from empty list


Full stack trace:
 export REQUESTS_CA_BUNDLE='/Users/sumeetkumarm/devops/devops/ansible/roles/ag_webserver/files/chain.crt'
$ lcc run FastDataAggregationAPITestSuite.RetrieveListofTagsForValidServicePointIdentifier --tenant ****** --release_version **** --enable-reporting reportportal
======================= FastDataAggregationAPITestSuite =======================
 OK  1 # FastDataAggregationAPITestSuite.RetrieveListofTagsForValidServicePointIdentifier                                                          
                                                      
Statistics :
 * Duration: 1s
 * Tests: 1
 * Successes: 1 (100%)
 * Failures: 0

Got the following exception using ReportPortal, test results have not been properly synced:
Traceback (most recent call last):
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/reportportal_client/service_async.py", line 208, in process_item
    getattr(self.rp_client, method)(**kwargs)
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/reportportal_client/service.py", line 144, in finish_launch
    status=status)
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/reportportal_client/service.py", line 138, in _finalize_launch
    self.stack.pop()
IndexError: pop from empty list


Thanks
Sumeet

sumeet m

unread,
May 1, 2019, 8:00:23 PM5/1/19
to lemoncheesecake
Hi Nicolas,

Started receiving more errors w.r.t to execution and sending data to report portal. This is when i run full test suite with report portal backend enabled.


lcc run FastDataAggregationAPITestSuite --tenant ******* --release_version 3.11 --enable-reporting reportportal

Error:
(python2venv) Sumeet-Autogrids-MacBook-Pro:suites sumeetkumarm$ lcc run FastDataAggregationAPITestSuite --tenant manualtest_flex1 --release_version 3.11 --enable-reporting reportportal
======================= FastDataAggregationAPITestSuite =======================
 OK  1 # FastDataAggregationAPITestSuite.RetrieveListofTagsForValidDeviceIdentifier                                                    
 OK  2 # FastDataAggregationAPITestSuite.RetrieveListofTagsForValidDeviceIdentifierWithInvalidTenant                                                                       
 OK  3 # FastDataAggregationAPITestSuite.RetrieveListofTagsForInValidDeviceIdentifier                                                     
 OK  4 # FastDataAggregationAPITestSuite.RetrieveListofTagsForEmtpyDeviceIdentifier                                                   
 OK  5 # FastDataAggregationAPITestSuite.RetrieveListofTagsWithMissingDeviceIdentifier                                                      
 OK  6 # FastDataAggregationAPITestSuite.RetrieveListofTagsWithMissingTenantUid                                                      
 OK  7 # FastDataAggregationAPITestSuite.RetrieveListofTagsForValidDeviceIdentifierUsingPostMethod                                                                     
 OK  8 # FastDataAggregationAPITestSuite.RetrieveListofTagsForValidDeviceIdentifierUsingPatchMethod                                                                      
 OK  9 # FastDataAggregationAPITestSuite.RetrieveListofTagsForValidDeviceIdentifierWithSecondarySubscription                                                                        
 OK 10 # FastDataAggregationAPITestSuite.RetrieveListofTagsForValidServicePointIdentifier                                                          
 => teardown test session:  (Teardown test session...)Got the following exception using ReportPortal, test results have not been properly synced:
Traceback (most recent call last):
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/reportportal_client/service_async.py", line 208, in process_item
    getattr(self.rp_client, method)(**kwargs)
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/reportportal_client/service.py", line 184, in start_test_item
    item_id = _get_id(r)
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/reportportal_client/service.py", line 14, in _get_id
    return _get_data(response)["id"]
  File "/Users/sumeetkumarm/virtualenvs/python2venv/lib/python2.7/site-packages/reportportal_client/service.py", line 34, in _get_data
    raise ResponseError(error_messages[0])
ResponseError: 4001: Incorrect Request. JSON parse error: Unrecognized field "parameters" (class com.epam.ta.reportportal.ws.model.StartTestItemRQ), not marked as ignorable; nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "parameters" (class com.epam.ta.reportportal.ws.model.StartTestItemRQ), not marked as ignorable (6 known properties: "launch_id", "tags", "start_time", "name", "description", "type"])
 at [Source: java.io.PushbackInputStream@586f9625; line: 1, column: 74] (through reference chain: com.epam.ta.reportportal.ws.model.StartTestItemRQ["parameters"])
                                                      
Statistics :
 * Duration: 9s
 * Tests: 10
 * Successes: 10 (100%)
 * Failures: 0

Thanks
Sumeet

sumeet m

unread,
May 2, 2019, 12:03:14 AM5/2/19
to lemoncheesecake
Hi Nicolas,

This issue is fixed by download the latest report portal images. Thanks Alot for your support for helping with SSL setup issue.

Thanks
Sumeet

nicola...@gmail.com

unread,
May 3, 2019, 10:03:23 AM5/3/19
to lemoncheesecake
Hello Sumeet,

That's great to know that it worked as expected. I have updated the documentation accordingly: http://docs.lemoncheesecake.io/en/latest/configure-reporting-backends.html#reportportal.

I saw that you also posted on the ReportPortal python client's github, I posted an answer there: https://github.com/reportportal/client-Python/issues/48#issuecomment-488327804.

Best regards,

Nicolas.

Bala Kumaran

unread,
Jun 23, 2021, 6:56:54 AM6/23/21
to lemoncheesecake
is it possible to disable the certification check itself?

Nicolas Delon

unread,
Jun 23, 2021, 5:38:57 PM6/23/21
to lemoncheesecake
It's not (currently) possible, but if your server certificate is self signed (for instance), you can use the "REQUEST_CA_BUNDLE"  environment variable indicated sooner in this thread and in the documentation.

Nicolas.

K

unread,
Dec 5, 2023, 12:46:16 AM12/5/23
to lemoncheesecake
Hi ,
Can someone help on how we can integrate the reportportal with lcc, what all steps do we need to follow?

Nicolas Delon

unread,
Dec 5, 2023, 4:34:45 PM12/5/23
to lemoncheesecake
Hello,

Configuration is documented here: https://docs.lemoncheesecake.io/en/latest/configure-reporting-backends.html#reportportal but the support is currently limited to version 4.x of ReportPortal.
What version of ReportPortal are you using ?

Regards,

Nicolas.
Reply all
Reply to author
Forward
0 new messages