allure-docker-service icon indicating copy to clipboard operation
allure-docker-service copied to clipboard

requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

Open dineshmcac opened this issue 1 year ago • 3 comments

Hi @fescobar

Can you please help me on the below issue

I am getting the below error while executing at below line 'response = requests.post(allure_server + '/send-results?project_id=' + project_id + '&force_project_creation=true',headers=headers, data=json_request_body, verify=ssl_verification)'

Error msg: requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

Full error message details Traceback (most recent call last): File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 444, in _make_request httplib_response = conn.getresponse() File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1371, in getresponse response.begin() File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 319, in begin version, status, reason = self._read_status() File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 288, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 489, in send resp = conn.urlopen( File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen retries = retries.increment( File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\packages\six.py", line 769, in reraise raise value.with_traceback(tb) File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 444, in _make_request httplib_response = conn.getresponse() File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1371, in getresponse response.begin() File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 319, in begin version, status, reason = self._read_status() File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 288, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\code.py", line 90, in runcode exec(code, self.locals) File "", line 1, in File "C:\Users\dchengal\AppData\Roaming\JetBrains\IdeaIC2021.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_umd.py", line 198, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Users\dchengal\AppData\Roaming\JetBrains\IdeaIC2021.3\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:/Users/dchengal/Documents/WorkSpace/Accessiblity/taas-runner/send_results.py", line 89, in response = requests.post( File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\api.py", line 115, in post return request("post", url, data=data, json=json, **kwargs) File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 701, in send r = adapter.send(request, **kwargs) File "C:\Users\dchengal\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 547, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

dineshmcac avatar Apr 06 '23 11:04 dineshmcac

@dineshmcac where did you deploy your container? Can you show config and logs? What host and port are you using in the script?

fescobar avatar Apr 06 '23 14:04 fescobar

Hi @fescobar I shared the deployed yaml, and updated the company name in yaml for security purposes.

Problem Statement: The real problem is the Allure report test case count doesn't match with Allure docker service test case count and it is throwing the above error.

port 80 and host is https://internal.offline.pdodev.aws.------.com/api/allure

kind: Service apiVersion: v1 metadata: name: allure-api namespace: offline selfLink: /api/v1/namespaces/offline/services/allure-api spec: selector: app: allure appcomponent: backend ports: - protocol: TCP port: 80 targetPort: 5050 type: NodePort sessionAffinity: None externalTrafficPolicy: Cluster

kind: Deployment apiVersion: apps/v1 metadata: name: allure namespace: offline labels: app: allure env: dev appcomponent: backend spec: replicas: 1 selector: matchLabels: app: allure template: metadata: labels: env: dev app: allure appcomponent: backend app_environment: dev datasource: gus application: gcom app_component: allure function: appserver created_by: ---------------- business_unit: pdo region: us-east-1 network_environment: dev app_contacts: ------------- system_risk_class: "1" tag_version: "2.0" annotations: ad.datadoghq.com/allure.check_names: | [ "tomcat", "jmx" ] ad.datadoghq.com/allure.init_configs: | [ { "is_jmx": true, "collect_default_metrics": true } ] ad.datadoghq.com/allure.instances: | [ { "host": "%%host%%", "port": "9012" } ] spec: serviceAccountName: allure imagePullSecrets: - name: credreg nodeSelector: workload: "offline" containers: - name: allure image: pdo-docker-dev.artifactory.svc.aws.company.com/allure:VERSION::ID ports: - containerPort: 5050 protocol: TCP resources: requests: memory: "3Gi" cpu: "1" volumeMounts: - name: allure-projects mountPath: /app/projects volumes: - name: allure-projects nfs: server: zalenium-dev-efs.pdodev.aws.company.com path: /app/projects

apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: name: allure-scaler namespace: offline spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: allure minReplicas: 1 maxReplicas: 1 metrics: - type: Resource resource: name: cpu targetAverageUtilization: 70 - type: Resource resource: name: memory targetAverageUtilization: 70

apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: internal-allure-alb-ingress namespace: offline annotations: kubernetes.io/ingress.class: "alb" alb.ingress.kubernetes.io/actions.ssl-redirect: "{"type": "redirect", "redirectConfig": { "protocol": "HTTPS", "port": "443", "statusCode": "HTTP_301"}}" alb.ingress.kubernetes.io/backend-protocol: HTTP alb.ingress.kubernetes.io/certificate-arn: "-----------" # alb.ingress.kubernetes.io/healthcheck-path: "/" alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]' alb.ingress.kubernetes.io/scheme: "internal" alb.ingress.kubernetes.io/subnets: "--------------------" alb.ingress.kubernetes.io/success-codes: "200" alb.ingress.kubernetes.io/tags: "app_component=allure-api,app_contacts=-------,app_environment=dev,app_version=2.0,application=allure-api,business_unit=pdo,cluster=eks-pdodev,[email protected],function=api,Name=allure-api,network_environment=dev,region=us-east-1,system_risk_class=3,waf_policy=custom,waf_custom=wafv2-np-guardrails-core-badinputs" spec: rules: - host: allure.pdodev.aws.company.com http: paths: - path: / pathType: Prefix backend: service: name: allure-api port: number: 80

dineshmcac avatar Apr 20 '23 05:04 dineshmcac

any update @fescobar We can't find any log in the instance It is failing for large file in -> 'response = requests.post(allure_server + '/send-results?project_id=' + project_id + '&force_project_creation=true',headers=headers, data=json_request_body, verify=ssl_verification)'

dineshmcac avatar Jul 03 '23 11:07 dineshmcac

@dineshmcac Sorry, but if you can't provide any logs I can't help you. You need to use command kubectl logs INSTANCE_ID

fescobar avatar Mar 13 '24 19:03 fescobar