Cant invoke the endpoint! (104 Connection rest by peer) #448

Description

@gautiese

Please fill out the form below.

System Information

  • Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Tensorflow
  • Framework Version: 1.10
  • Python Version: 2
  • CPU or GPU: CPU
  • Python SDK Version:
  • Are you using a custom image: No

Describe the problem

Describe the problem or feature request clearly here.
When I try to invoke my newly created endoint, I get a 104 error.
Is this a timeout issue? It is a fairly large network

Minimal repro / logs

`---------------------------------------------------------------------------
ConnectionResetError Traceback (most recent call last)
~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
543 timeout=timeout_obj,
--> 544 body=body, headers=headers)
545

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
348 # urllib3.request. It also calls makefile (recv) on the socket.
--> 349 conn.request(method, url, **httplib_request_kw)
350

~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
1238 """Send a complete request to the server."""
-> 1239 self._send_request(method, url, body, headers, encode_chunked)
1240

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
129 rval = HTTPConnection._send_request(
--> 130 self, method, url, body, headers, *args, **kwargs)
131 self._expect_header_set = False

~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
1284 body = _encode(body, 'body')
-> 1285 self.endheaders(body, encode_chunked=encode_chunked)
1286

~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
1233 raise CannotSendHeader()
-> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
1235

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
156 message_body = None
--> 157 self.send(msg)
158 if self._expect_header_set:

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
241 return
--> 242 return HTTPConnection.send(self, str)
243

~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
985 try:
--> 986 self.sock.sendall(data)
987 except TypeError:

~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
971 while count < amount:
--> 972 v = self.send(byte_view[count:])
973 count += v

~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
940 self.class)
--> 941 return self._sslobj.write(data)
942 else:

~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
641 """
--> 642 return self._sslobj.write(data)
643

ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

ProtocolError Traceback (most recent call last)
~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
369 retries=self.max_retries,
--> 370 timeout=timeout
371 )

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
596 retries = retries.increment(method, url, error=e, _pool=self,
--> 597 _stacktrace=sys.exc_info()[2])
598 retries.sleep()

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
244 if read is False:
--> 245 raise six.reraise(type(error), error, _stacktrace)
246 elif read is not None:

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/packages/six.py in reraise(tp, value, tb)
308 if value.traceback is not tb:
--> 309 raise value.with_traceback(tb)
310 raise value

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
543 timeout=timeout_obj,
--> 544 body=body, headers=headers)
545

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
348 # urllib3.request. It also calls makefile (recv) on the socket.
--> 349 conn.request(method, url, **httplib_request_kw)
350

~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
1238 """Send a complete request to the server."""
-> 1239 self._send_request(method, url, body, headers, encode_chunked)
1240

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
129 rval = HTTPConnection._send_request(
--> 130 self, method, url, body, headers, *args, **kwargs)
131 self._expect_header_set = False

~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
1284 body = _encode(body, 'body')
-> 1285 self.endheaders(body, encode_chunked=encode_chunked)
1286

~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
1233 raise CannotSendHeader()
-> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
1235

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
156 message_body = None
--> 157 self.send(msg)
158 if self._expect_header_set:

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
241 return
--> 242 return HTTPConnection.send(self, str)
243

~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
985 try:
--> 986 self.sock.sendall(data)
987 except TypeError:

~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
971 while count < amount:
--> 972 v = self.send(byte_view[count:])
973 count += v

~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
940 self.class)
--> 941 return self._sslobj.write(data)
942 else:

~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
641 """
--> 642 return self._sslobj.write(data)
643

ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

ConnectionError Traceback (most recent call last)
in ()
----> 1 endpoint.predict(json.dumps(test_dict))

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/sagemaker/predictor.py in predict(self, data)
85 request_args['Accept'] = self.accept
86
---> 87 response = self.sagemaker_session.sagemaker_runtime_client.invoke_endpoint(**request_args)
88
89 response_body = response['Body']

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
312 "%s() only accepts keyword arguments." % py_operation_name)
313 # The "self" in this scope is referring to the BaseClient.
--> 314 return self._make_api_call(operation_name, kwargs)
315
316 _api_call.name = str(py_operation_name)

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
597 else:
598 http, parsed_response = self._endpoint.make_request(
--> 599 operation_model, request_dict)
600
601 self.meta.events.emit(

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in make_request(self, operation_model, request_dict)
146 logger.debug("Making request for %s (verify_ssl=%s) with params: %s",
147 operation_model, self.verify, request_dict)
--> 148 return self._send_request(request_dict, operation_model)
149
150 def create_request(self, params, operation_model=None):

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _send_request(self, request_dict, operation_model)
175 request, operation_model, attempts)
176 while self._needs_retry(attempts, operation_model, request_dict,
--> 177 success_response, exception):
178 attempts += 1
179 # If there is a stream associated with the request, we need

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _needs_retry(self, attempts, operation_model, request_dict, response, caught_exception)
271 event_name, response=response, endpoint=self,
272 operation=operation_model, attempts=attempts,
--> 273 caught_exception=caught_exception, request_dict=request_dict)
274 handler_response = first_non_none_response(responses)
275 if handler_response is None:

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in emit(self, event_name, **kwargs)
225 handlers.
226 """
--> 227 return self._emit(event_name, kwargs)
228
229 def emit_until_response(self, event_name, **kwargs):

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
358 aliased_event_name = self._alias_event_name(event_name)
359 return super(AliasedEventEmitter, self)._emit(
--> 360 aliased_event_name, kwargs, stop_on_response
361 )
362

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
208 for handler in handlers_to_call:
209 logger.debug('Event %s: calling handler %s', event_name, handler)
--> 210 response = handler(**kwargs)
211 responses.append((handler, response))
212 if stop_on_response and response is not None:

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempts, response, caught_exception, **kwargs)
181
182 """
--> 183 if self._checker(attempts, response, caught_exception):
184 result = self._action(attempts=attempts)
185 logger.debug("Retry needed, action of: %s", result)

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
249 def call(self, attempt_number, response, caught_exception):
250 should_retry = self._should_retry(attempt_number, response,
--> 251 caught_exception)
252 if should_retry:
253 if attempt_number >= self._max_attempts:

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _should_retry(self, attempt_number, response, caught_exception)
275 # If we've exceeded the max attempts we just let the exception
276 # propogate if one has occurred.
--> 277 return self._checker(attempt_number, response, caught_exception)
278
279

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
315 for checker in self._checkers:
316 checker_response = checker(attempt_number, response,
--> 317 caught_exception)
318 if checker_response:
319 return checker_response

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
221 elif caught_exception is not None:
222 return self._check_caught_exception(
--> 223 attempt_number, caught_exception)
224 else:
225 raise ValueError("Both response and caught_exception are None.")

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _check_caught_exception(self, attempt_number, caught_exception)
357 # the MaxAttemptsDecorator is not interested in retrying the exception
358 # then this exception just propogates out past the retry code.
--> 359 raise caught_exception

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _get_response(self, request, operation_model, attempts)
220 request, verify=self.verify,
221 stream=streaming,
--> 222 proxies=self.proxies, timeout=self.timeout)
223 except ConnectionError as e:
224 # For a connection error, if it looks like it's a DNS

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/sessions.py in send(self, request, **kwargs)
571
572 # Send the request
--> 573 r = adapter.send(request, **kwargs)
574
575 # Total elapsed time of the request (approximately)

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
413
414 except (ProtocolError, socket.error) as err:
--> 415 raise ConnectionError(err, request=request)
416
417 except MaxRetryError as e:

ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))`

  • Exact command to reproduce:
    endpoint = my_estimator.deploy(initial_instance_count=1, instance_type="ml.m4.xlarge")
    endpoint.predict(test_dict)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all \u003cpre\u003e\u003ccode\u003e blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks"); } } catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); } })(); (function(){ try { var __m = "github.com"; var __re = new RegExp('^' + "github\\.com" + '
      Skip to content

      Cant invoke the endpoint! (104 Connection rest by peer) #448

      Description

      @gautiese

      Please fill out the form below.

      System Information

      • Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Tensorflow
      • Framework Version: 1.10
      • Python Version: 2
      • CPU or GPU: CPU
      • Python SDK Version:
      • Are you using a custom image: No

      Describe the problem

      Describe the problem or feature request clearly here.
      When I try to invoke my newly created endoint, I get a 104 error.
      Is this a timeout issue? It is a fairly large network

      Minimal repro / logs

      `---------------------------------------------------------------------------
      ConnectionResetError Traceback (most recent call last)
      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
      543 timeout=timeout_obj,
      --> 544 body=body, headers=headers)
      545

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
      348 # urllib3.request. It also calls makefile (recv) on the socket.
      --> 349 conn.request(method, url, **httplib_request_kw)
      350

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
      1238 """Send a complete request to the server."""
      -> 1239 self._send_request(method, url, body, headers, encode_chunked)
      1240

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
      129 rval = HTTPConnection._send_request(
      --> 130 self, method, url, body, headers, *args, **kwargs)
      131 self._expect_header_set = False

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
      1284 body = _encode(body, 'body')
      -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
      1286

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
      1233 raise CannotSendHeader()
      -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
      1235

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
      156 message_body = None
      --> 157 self.send(msg)
      158 if self._expect_header_set:

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
      241 return
      --> 242 return HTTPConnection.send(self, str)
      243

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
      985 try:
      --> 986 self.sock.sendall(data)
      987 except TypeError:

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
      971 while count < amount:
      --> 972 v = self.send(byte_view[count:])
      973 count += v

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
      940 self.class)
      --> 941 return self._sslobj.write(data)
      942 else:

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
      641 """
      --> 642 return self._sslobj.write(data)
      643

      ConnectionResetError: [Errno 104] Connection reset by peer

      During handling of the above exception, another exception occurred:

      ProtocolError Traceback (most recent call last)
      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
      369 retries=self.max_retries,
      --> 370 timeout=timeout
      371 )

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
      596 retries = retries.increment(method, url, error=e, _pool=self,
      --> 597 _stacktrace=sys.exc_info()[2])
      598 retries.sleep()

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
      244 if read is False:
      --> 245 raise six.reraise(type(error), error, _stacktrace)
      246 elif read is not None:

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/packages/six.py in reraise(tp, value, tb)
      308 if value.traceback is not tb:
      --> 309 raise value.with_traceback(tb)
      310 raise value

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
      543 timeout=timeout_obj,
      --> 544 body=body, headers=headers)
      545

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
      348 # urllib3.request. It also calls makefile (recv) on the socket.
      --> 349 conn.request(method, url, **httplib_request_kw)
      350

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
      1238 """Send a complete request to the server."""
      -> 1239 self._send_request(method, url, body, headers, encode_chunked)
      1240

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
      129 rval = HTTPConnection._send_request(
      --> 130 self, method, url, body, headers, *args, **kwargs)
      131 self._expect_header_set = False

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
      1284 body = _encode(body, 'body')
      -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
      1286

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
      1233 raise CannotSendHeader()
      -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
      1235

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
      156 message_body = None
      --> 157 self.send(msg)
      158 if self._expect_header_set:

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
      241 return
      --> 242 return HTTPConnection.send(self, str)
      243

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
      985 try:
      --> 986 self.sock.sendall(data)
      987 except TypeError:

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
      971 while count < amount:
      --> 972 v = self.send(byte_view[count:])
      973 count += v

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
      940 self.class)
      --> 941 return self._sslobj.write(data)
      942 else:

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
      641 """
      --> 642 return self._sslobj.write(data)
      643

      ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

      During handling of the above exception, another exception occurred:

      ConnectionError Traceback (most recent call last)
      in ()
      ----> 1 endpoint.predict(json.dumps(test_dict))

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/sagemaker/predictor.py in predict(self, data)
      85 request_args['Accept'] = self.accept
      86
      ---> 87 response = self.sagemaker_session.sagemaker_runtime_client.invoke_endpoint(**request_args)
      88
      89 response_body = response['Body']

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
      312 "%s() only accepts keyword arguments." % py_operation_name)
      313 # The "self" in this scope is referring to the BaseClient.
      --> 314 return self._make_api_call(operation_name, kwargs)
      315
      316 _api_call.name = str(py_operation_name)

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
      597 else:
      598 http, parsed_response = self._endpoint.make_request(
      --> 599 operation_model, request_dict)
      600
      601 self.meta.events.emit(

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in make_request(self, operation_model, request_dict)
      146 logger.debug("Making request for %s (verify_ssl=%s) with params: %s",
      147 operation_model, self.verify, request_dict)
      --> 148 return self._send_request(request_dict, operation_model)
      149
      150 def create_request(self, params, operation_model=None):

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _send_request(self, request_dict, operation_model)
      175 request, operation_model, attempts)
      176 while self._needs_retry(attempts, operation_model, request_dict,
      --> 177 success_response, exception):
      178 attempts += 1
      179 # If there is a stream associated with the request, we need

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _needs_retry(self, attempts, operation_model, request_dict, response, caught_exception)
      271 event_name, response=response, endpoint=self,
      272 operation=operation_model, attempts=attempts,
      --> 273 caught_exception=caught_exception, request_dict=request_dict)
      274 handler_response = first_non_none_response(responses)
      275 if handler_response is None:

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in emit(self, event_name, **kwargs)
      225 handlers.
      226 """
      --> 227 return self._emit(event_name, kwargs)
      228
      229 def emit_until_response(self, event_name, **kwargs):

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
      358 aliased_event_name = self._alias_event_name(event_name)
      359 return super(AliasedEventEmitter, self)._emit(
      --> 360 aliased_event_name, kwargs, stop_on_response
      361 )
      362

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
      208 for handler in handlers_to_call:
      209 logger.debug('Event %s: calling handler %s', event_name, handler)
      --> 210 response = handler(**kwargs)
      211 responses.append((handler, response))
      212 if stop_on_response and response is not None:

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempts, response, caught_exception, **kwargs)
      181
      182 """
      --> 183 if self._checker(attempts, response, caught_exception):
      184 result = self._action(attempts=attempts)
      185 logger.debug("Retry needed, action of: %s", result)

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
      249 def call(self, attempt_number, response, caught_exception):
      250 should_retry = self._should_retry(attempt_number, response,
      --> 251 caught_exception)
      252 if should_retry:
      253 if attempt_number >= self._max_attempts:

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _should_retry(self, attempt_number, response, caught_exception)
      275 # If we've exceeded the max attempts we just let the exception
      276 # propogate if one has occurred.
      --> 277 return self._checker(attempt_number, response, caught_exception)
      278
      279

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
      315 for checker in self._checkers:
      316 checker_response = checker(attempt_number, response,
      --> 317 caught_exception)
      318 if checker_response:
      319 return checker_response

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
      221 elif caught_exception is not None:
      222 return self._check_caught_exception(
      --> 223 attempt_number, caught_exception)
      224 else:
      225 raise ValueError("Both response and caught_exception are None.")

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _check_caught_exception(self, attempt_number, caught_exception)
      357 # the MaxAttemptsDecorator is not interested in retrying the exception
      358 # then this exception just propogates out past the retry code.
      --> 359 raise caught_exception

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _get_response(self, request, operation_model, attempts)
      220 request, verify=self.verify,
      221 stream=streaming,
      --> 222 proxies=self.proxies, timeout=self.timeout)
      223 except ConnectionError as e:
      224 # For a connection error, if it looks like it's a DNS

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/sessions.py in send(self, request, **kwargs)
      571
      572 # Send the request
      --> 573 r = adapter.send(request, **kwargs)
      574
      575 # Total elapsed time of the request (approximately)

      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
      413
      414 except (ProtocolError, socket.error) as err:
      --> 415 raise ConnectionError(err, request=request)
      416
      417 except MaxRetryError as e:

      ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))`

      • Exact command to reproduce:
        endpoint = my_estimator.deploy(initial_instance_count=1, instance_type="ml.m4.xlarge")
        endpoint.predict(test_dict)

      Activity

      Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

      Metadata

      Metadata

      Assignees

      No one assigned

        Labels

        No labels
        No labels

        Type

        No type

        Projects

        No projects

          Milestone

          No milestone

          Relationships

          None yet

          Development

          No branches or pull requests

          Issue actions

          , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
          Skip to content

          Cant invoke the endpoint! (104 Connection rest by peer) #448

          Description

          @gautiese

          Please fill out the form below.

          System Information

          • Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Tensorflow
          • Framework Version: 1.10
          • Python Version: 2
          • CPU or GPU: CPU
          • Python SDK Version:
          • Are you using a custom image: No

          Describe the problem

          Describe the problem or feature request clearly here.
          When I try to invoke my newly created endoint, I get a 104 error.
          Is this a timeout issue? It is a fairly large network

          Minimal repro / logs

          `---------------------------------------------------------------------------
          ConnectionResetError Traceback (most recent call last)
          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
          543 timeout=timeout_obj,
          --> 544 body=body, headers=headers)
          545

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
          348 # urllib3.request. It also calls makefile (recv) on the socket.
          --> 349 conn.request(method, url, **httplib_request_kw)
          350

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
          1238 """Send a complete request to the server."""
          -> 1239 self._send_request(method, url, body, headers, encode_chunked)
          1240

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
          129 rval = HTTPConnection._send_request(
          --> 130 self, method, url, body, headers, *args, **kwargs)
          131 self._expect_header_set = False

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
          1284 body = _encode(body, 'body')
          -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
          1286

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
          1233 raise CannotSendHeader()
          -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
          1235

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
          156 message_body = None
          --> 157 self.send(msg)
          158 if self._expect_header_set:

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
          241 return
          --> 242 return HTTPConnection.send(self, str)
          243

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
          985 try:
          --> 986 self.sock.sendall(data)
          987 except TypeError:

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
          971 while count < amount:
          --> 972 v = self.send(byte_view[count:])
          973 count += v

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
          940 self.class)
          --> 941 return self._sslobj.write(data)
          942 else:

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
          641 """
          --> 642 return self._sslobj.write(data)
          643

          ConnectionResetError: [Errno 104] Connection reset by peer

          During handling of the above exception, another exception occurred:

          ProtocolError Traceback (most recent call last)
          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
          369 retries=self.max_retries,
          --> 370 timeout=timeout
          371 )

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
          596 retries = retries.increment(method, url, error=e, _pool=self,
          --> 597 _stacktrace=sys.exc_info()[2])
          598 retries.sleep()

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
          244 if read is False:
          --> 245 raise six.reraise(type(error), error, _stacktrace)
          246 elif read is not None:

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/packages/six.py in reraise(tp, value, tb)
          308 if value.traceback is not tb:
          --> 309 raise value.with_traceback(tb)
          310 raise value

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
          543 timeout=timeout_obj,
          --> 544 body=body, headers=headers)
          545

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
          348 # urllib3.request. It also calls makefile (recv) on the socket.
          --> 349 conn.request(method, url, **httplib_request_kw)
          350

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
          1238 """Send a complete request to the server."""
          -> 1239 self._send_request(method, url, body, headers, encode_chunked)
          1240

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
          129 rval = HTTPConnection._send_request(
          --> 130 self, method, url, body, headers, *args, **kwargs)
          131 self._expect_header_set = False

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
          1284 body = _encode(body, 'body')
          -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
          1286

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
          1233 raise CannotSendHeader()
          -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
          1235

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
          156 message_body = None
          --> 157 self.send(msg)
          158 if self._expect_header_set:

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
          241 return
          --> 242 return HTTPConnection.send(self, str)
          243

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
          985 try:
          --> 986 self.sock.sendall(data)
          987 except TypeError:

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
          971 while count < amount:
          --> 972 v = self.send(byte_view[count:])
          973 count += v

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
          940 self.class)
          --> 941 return self._sslobj.write(data)
          942 else:

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
          641 """
          --> 642 return self._sslobj.write(data)
          643

          ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

          During handling of the above exception, another exception occurred:

          ConnectionError Traceback (most recent call last)
          in ()
          ----> 1 endpoint.predict(json.dumps(test_dict))

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/sagemaker/predictor.py in predict(self, data)
          85 request_args['Accept'] = self.accept
          86
          ---> 87 response = self.sagemaker_session.sagemaker_runtime_client.invoke_endpoint(**request_args)
          88
          89 response_body = response['Body']

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
          312 "%s() only accepts keyword arguments." % py_operation_name)
          313 # The "self" in this scope is referring to the BaseClient.
          --> 314 return self._make_api_call(operation_name, kwargs)
          315
          316 _api_call.name = str(py_operation_name)

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
          597 else:
          598 http, parsed_response = self._endpoint.make_request(
          --> 599 operation_model, request_dict)
          600
          601 self.meta.events.emit(

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in make_request(self, operation_model, request_dict)
          146 logger.debug("Making request for %s (verify_ssl=%s) with params: %s",
          147 operation_model, self.verify, request_dict)
          --> 148 return self._send_request(request_dict, operation_model)
          149
          150 def create_request(self, params, operation_model=None):

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _send_request(self, request_dict, operation_model)
          175 request, operation_model, attempts)
          176 while self._needs_retry(attempts, operation_model, request_dict,
          --> 177 success_response, exception):
          178 attempts += 1
          179 # If there is a stream associated with the request, we need

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _needs_retry(self, attempts, operation_model, request_dict, response, caught_exception)
          271 event_name, response=response, endpoint=self,
          272 operation=operation_model, attempts=attempts,
          --> 273 caught_exception=caught_exception, request_dict=request_dict)
          274 handler_response = first_non_none_response(responses)
          275 if handler_response is None:

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in emit(self, event_name, **kwargs)
          225 handlers.
          226 """
          --> 227 return self._emit(event_name, kwargs)
          228
          229 def emit_until_response(self, event_name, **kwargs):

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
          358 aliased_event_name = self._alias_event_name(event_name)
          359 return super(AliasedEventEmitter, self)._emit(
          --> 360 aliased_event_name, kwargs, stop_on_response
          361 )
          362

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
          208 for handler in handlers_to_call:
          209 logger.debug('Event %s: calling handler %s', event_name, handler)
          --> 210 response = handler(**kwargs)
          211 responses.append((handler, response))
          212 if stop_on_response and response is not None:

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempts, response, caught_exception, **kwargs)
          181
          182 """
          --> 183 if self._checker(attempts, response, caught_exception):
          184 result = self._action(attempts=attempts)
          185 logger.debug("Retry needed, action of: %s", result)

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
          249 def call(self, attempt_number, response, caught_exception):
          250 should_retry = self._should_retry(attempt_number, response,
          --> 251 caught_exception)
          252 if should_retry:
          253 if attempt_number >= self._max_attempts:

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _should_retry(self, attempt_number, response, caught_exception)
          275 # If we've exceeded the max attempts we just let the exception
          276 # propogate if one has occurred.
          --> 277 return self._checker(attempt_number, response, caught_exception)
          278
          279

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
          315 for checker in self._checkers:
          316 checker_response = checker(attempt_number, response,
          --> 317 caught_exception)
          318 if checker_response:
          319 return checker_response

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
          221 elif caught_exception is not None:
          222 return self._check_caught_exception(
          --> 223 attempt_number, caught_exception)
          224 else:
          225 raise ValueError("Both response and caught_exception are None.")

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _check_caught_exception(self, attempt_number, caught_exception)
          357 # the MaxAttemptsDecorator is not interested in retrying the exception
          358 # then this exception just propogates out past the retry code.
          --> 359 raise caught_exception

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _get_response(self, request, operation_model, attempts)
          220 request, verify=self.verify,
          221 stream=streaming,
          --> 222 proxies=self.proxies, timeout=self.timeout)
          223 except ConnectionError as e:
          224 # For a connection error, if it looks like it's a DNS

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/sessions.py in send(self, request, **kwargs)
          571
          572 # Send the request
          --> 573 r = adapter.send(request, **kwargs)
          574
          575 # Total elapsed time of the request (approximately)

          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
          413
          414 except (ProtocolError, socket.error) as err:
          --> 415 raise ConnectionError(err, request=request)
          416
          417 except MaxRetryError as e:

          ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))`

          • Exact command to reproduce:
            endpoint = my_estimator.deploy(initial_instance_count=1, instance_type="ml.m4.xlarge")
            endpoint.predict(test_dict)

          Activity

          Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

          Metadata

          Metadata

          Assignees

          No one assigned

            Labels

            No labels
            No labels

            Type

            No type

            Projects

            No projects

              Milestone

              No milestone

              Relationships

              None yet

              Development

              No branches or pull requests

              Issue actions

              , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length \u003e 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
              Skip to content

              Cant invoke the endpoint! (104 Connection rest by peer) #448

              Description

              @gautiese

              Please fill out the form below.

              System Information

              • Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Tensorflow
              • Framework Version: 1.10
              • Python Version: 2
              • CPU or GPU: CPU
              • Python SDK Version:
              • Are you using a custom image: No

              Describe the problem

              Describe the problem or feature request clearly here.
              When I try to invoke my newly created endoint, I get a 104 error.
              Is this a timeout issue? It is a fairly large network

              Minimal repro / logs

              `---------------------------------------------------------------------------
              ConnectionResetError Traceback (most recent call last)
              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
              543 timeout=timeout_obj,
              --> 544 body=body, headers=headers)
              545

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
              348 # urllib3.request. It also calls makefile (recv) on the socket.
              --> 349 conn.request(method, url, **httplib_request_kw)
              350

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
              1238 """Send a complete request to the server."""
              -> 1239 self._send_request(method, url, body, headers, encode_chunked)
              1240

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
              129 rval = HTTPConnection._send_request(
              --> 130 self, method, url, body, headers, *args, **kwargs)
              131 self._expect_header_set = False

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
              1284 body = _encode(body, 'body')
              -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
              1286

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
              1233 raise CannotSendHeader()
              -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
              1235

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
              156 message_body = None
              --> 157 self.send(msg)
              158 if self._expect_header_set:

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
              241 return
              --> 242 return HTTPConnection.send(self, str)
              243

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
              985 try:
              --> 986 self.sock.sendall(data)
              987 except TypeError:

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
              971 while count < amount:
              --> 972 v = self.send(byte_view[count:])
              973 count += v

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
              940 self.class)
              --> 941 return self._sslobj.write(data)
              942 else:

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
              641 """
              --> 642 return self._sslobj.write(data)
              643

              ConnectionResetError: [Errno 104] Connection reset by peer

              During handling of the above exception, another exception occurred:

              ProtocolError Traceback (most recent call last)
              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
              369 retries=self.max_retries,
              --> 370 timeout=timeout
              371 )

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
              596 retries = retries.increment(method, url, error=e, _pool=self,
              --> 597 _stacktrace=sys.exc_info()[2])
              598 retries.sleep()

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
              244 if read is False:
              --> 245 raise six.reraise(type(error), error, _stacktrace)
              246 elif read is not None:

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/packages/six.py in reraise(tp, value, tb)
              308 if value.traceback is not tb:
              --> 309 raise value.with_traceback(tb)
              310 raise value

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
              543 timeout=timeout_obj,
              --> 544 body=body, headers=headers)
              545

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
              348 # urllib3.request. It also calls makefile (recv) on the socket.
              --> 349 conn.request(method, url, **httplib_request_kw)
              350

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
              1238 """Send a complete request to the server."""
              -> 1239 self._send_request(method, url, body, headers, encode_chunked)
              1240

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
              129 rval = HTTPConnection._send_request(
              --> 130 self, method, url, body, headers, *args, **kwargs)
              131 self._expect_header_set = False

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
              1284 body = _encode(body, 'body')
              -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
              1286

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
              1233 raise CannotSendHeader()
              -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
              1235

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
              156 message_body = None
              --> 157 self.send(msg)
              158 if self._expect_header_set:

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
              241 return
              --> 242 return HTTPConnection.send(self, str)
              243

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
              985 try:
              --> 986 self.sock.sendall(data)
              987 except TypeError:

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
              971 while count < amount:
              --> 972 v = self.send(byte_view[count:])
              973 count += v

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
              940 self.class)
              --> 941 return self._sslobj.write(data)
              942 else:

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
              641 """
              --> 642 return self._sslobj.write(data)
              643

              ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

              During handling of the above exception, another exception occurred:

              ConnectionError Traceback (most recent call last)
              in ()
              ----> 1 endpoint.predict(json.dumps(test_dict))

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/sagemaker/predictor.py in predict(self, data)
              85 request_args['Accept'] = self.accept
              86
              ---> 87 response = self.sagemaker_session.sagemaker_runtime_client.invoke_endpoint(**request_args)
              88
              89 response_body = response['Body']

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
              312 "%s() only accepts keyword arguments." % py_operation_name)
              313 # The "self" in this scope is referring to the BaseClient.
              --> 314 return self._make_api_call(operation_name, kwargs)
              315
              316 _api_call.name = str(py_operation_name)

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
              597 else:
              598 http, parsed_response = self._endpoint.make_request(
              --> 599 operation_model, request_dict)
              600
              601 self.meta.events.emit(

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in make_request(self, operation_model, request_dict)
              146 logger.debug("Making request for %s (verify_ssl=%s) with params: %s",
              147 operation_model, self.verify, request_dict)
              --> 148 return self._send_request(request_dict, operation_model)
              149
              150 def create_request(self, params, operation_model=None):

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _send_request(self, request_dict, operation_model)
              175 request, operation_model, attempts)
              176 while self._needs_retry(attempts, operation_model, request_dict,
              --> 177 success_response, exception):
              178 attempts += 1
              179 # If there is a stream associated with the request, we need

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _needs_retry(self, attempts, operation_model, request_dict, response, caught_exception)
              271 event_name, response=response, endpoint=self,
              272 operation=operation_model, attempts=attempts,
              --> 273 caught_exception=caught_exception, request_dict=request_dict)
              274 handler_response = first_non_none_response(responses)
              275 if handler_response is None:

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in emit(self, event_name, **kwargs)
              225 handlers.
              226 """
              --> 227 return self._emit(event_name, kwargs)
              228
              229 def emit_until_response(self, event_name, **kwargs):

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
              358 aliased_event_name = self._alias_event_name(event_name)
              359 return super(AliasedEventEmitter, self)._emit(
              --> 360 aliased_event_name, kwargs, stop_on_response
              361 )
              362

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
              208 for handler in handlers_to_call:
              209 logger.debug('Event %s: calling handler %s', event_name, handler)
              --> 210 response = handler(**kwargs)
              211 responses.append((handler, response))
              212 if stop_on_response and response is not None:

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempts, response, caught_exception, **kwargs)
              181
              182 """
              --> 183 if self._checker(attempts, response, caught_exception):
              184 result = self._action(attempts=attempts)
              185 logger.debug("Retry needed, action of: %s", result)

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
              249 def call(self, attempt_number, response, caught_exception):
              250 should_retry = self._should_retry(attempt_number, response,
              --> 251 caught_exception)
              252 if should_retry:
              253 if attempt_number >= self._max_attempts:

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _should_retry(self, attempt_number, response, caught_exception)
              275 # If we've exceeded the max attempts we just let the exception
              276 # propogate if one has occurred.
              --> 277 return self._checker(attempt_number, response, caught_exception)
              278
              279

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
              315 for checker in self._checkers:
              316 checker_response = checker(attempt_number, response,
              --> 317 caught_exception)
              318 if checker_response:
              319 return checker_response

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
              221 elif caught_exception is not None:
              222 return self._check_caught_exception(
              --> 223 attempt_number, caught_exception)
              224 else:
              225 raise ValueError("Both response and caught_exception are None.")

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _check_caught_exception(self, attempt_number, caught_exception)
              357 # the MaxAttemptsDecorator is not interested in retrying the exception
              358 # then this exception just propogates out past the retry code.
              --> 359 raise caught_exception

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _get_response(self, request, operation_model, attempts)
              220 request, verify=self.verify,
              221 stream=streaming,
              --> 222 proxies=self.proxies, timeout=self.timeout)
              223 except ConnectionError as e:
              224 # For a connection error, if it looks like it's a DNS

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/sessions.py in send(self, request, **kwargs)
              571
              572 # Send the request
              --> 573 r = adapter.send(request, **kwargs)
              574
              575 # Total elapsed time of the request (approximately)

              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
              413
              414 except (ProtocolError, socket.error) as err:
              --> 415 raise ConnectionError(err, request=request)
              416
              417 except MaxRetryError as e:

              ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))`

              • Exact command to reproduce:
                endpoint = my_estimator.deploy(initial_instance_count=1, instance_type="ml.m4.xlarge")
                endpoint.predict(test_dict)

              Activity

              Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

              Metadata

              Metadata

              Assignees

              No one assigned

                Labels

                No labels
                No labels

                Type

                No type

                Projects

                No projects

                  Milestone

                  No milestone

                  Relationships

                  None yet

                  Development

                  No branches or pull requests

                  Issue actions

                  , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
                  Skip to content

                  Cant invoke the endpoint! (104 Connection rest by peer) #448

                  Description

                  @gautiese

                  Please fill out the form below.

                  System Information

                  • Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Tensorflow
                  • Framework Version: 1.10
                  • Python Version: 2
                  • CPU or GPU: CPU
                  • Python SDK Version:
                  • Are you using a custom image: No

                  Describe the problem

                  Describe the problem or feature request clearly here.
                  When I try to invoke my newly created endoint, I get a 104 error.
                  Is this a timeout issue? It is a fairly large network

                  Minimal repro / logs

                  `---------------------------------------------------------------------------
                  ConnectionResetError Traceback (most recent call last)
                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
                  543 timeout=timeout_obj,
                  --> 544 body=body, headers=headers)
                  545

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
                  348 # urllib3.request. It also calls makefile (recv) on the socket.
                  --> 349 conn.request(method, url, **httplib_request_kw)
                  350

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
                  1238 """Send a complete request to the server."""
                  -> 1239 self._send_request(method, url, body, headers, encode_chunked)
                  1240

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
                  129 rval = HTTPConnection._send_request(
                  --> 130 self, method, url, body, headers, *args, **kwargs)
                  131 self._expect_header_set = False

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
                  1284 body = _encode(body, 'body')
                  -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
                  1286

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
                  1233 raise CannotSendHeader()
                  -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
                  1235

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
                  156 message_body = None
                  --> 157 self.send(msg)
                  158 if self._expect_header_set:

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
                  241 return
                  --> 242 return HTTPConnection.send(self, str)
                  243

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
                  985 try:
                  --> 986 self.sock.sendall(data)
                  987 except TypeError:

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
                  971 while count < amount:
                  --> 972 v = self.send(byte_view[count:])
                  973 count += v

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
                  940 self.class)
                  --> 941 return self._sslobj.write(data)
                  942 else:

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
                  641 """
                  --> 642 return self._sslobj.write(data)
                  643

                  ConnectionResetError: [Errno 104] Connection reset by peer

                  During handling of the above exception, another exception occurred:

                  ProtocolError Traceback (most recent call last)
                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
                  369 retries=self.max_retries,
                  --> 370 timeout=timeout
                  371 )

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
                  596 retries = retries.increment(method, url, error=e, _pool=self,
                  --> 597 _stacktrace=sys.exc_info()[2])
                  598 retries.sleep()

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
                  244 if read is False:
                  --> 245 raise six.reraise(type(error), error, _stacktrace)
                  246 elif read is not None:

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/packages/six.py in reraise(tp, value, tb)
                  308 if value.traceback is not tb:
                  --> 309 raise value.with_traceback(tb)
                  310 raise value

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
                  543 timeout=timeout_obj,
                  --> 544 body=body, headers=headers)
                  545

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
                  348 # urllib3.request. It also calls makefile (recv) on the socket.
                  --> 349 conn.request(method, url, **httplib_request_kw)
                  350

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
                  1238 """Send a complete request to the server."""
                  -> 1239 self._send_request(method, url, body, headers, encode_chunked)
                  1240

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
                  129 rval = HTTPConnection._send_request(
                  --> 130 self, method, url, body, headers, *args, **kwargs)
                  131 self._expect_header_set = False

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
                  1284 body = _encode(body, 'body')
                  -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
                  1286

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
                  1233 raise CannotSendHeader()
                  -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
                  1235

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
                  156 message_body = None
                  --> 157 self.send(msg)
                  158 if self._expect_header_set:

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
                  241 return
                  --> 242 return HTTPConnection.send(self, str)
                  243

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
                  985 try:
                  --> 986 self.sock.sendall(data)
                  987 except TypeError:

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
                  971 while count < amount:
                  --> 972 v = self.send(byte_view[count:])
                  973 count += v

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
                  940 self.class)
                  --> 941 return self._sslobj.write(data)
                  942 else:

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
                  641 """
                  --> 642 return self._sslobj.write(data)
                  643

                  ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

                  During handling of the above exception, another exception occurred:

                  ConnectionError Traceback (most recent call last)
                  in ()
                  ----> 1 endpoint.predict(json.dumps(test_dict))

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/sagemaker/predictor.py in predict(self, data)
                  85 request_args['Accept'] = self.accept
                  86
                  ---> 87 response = self.sagemaker_session.sagemaker_runtime_client.invoke_endpoint(**request_args)
                  88
                  89 response_body = response['Body']

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
                  312 "%s() only accepts keyword arguments." % py_operation_name)
                  313 # The "self" in this scope is referring to the BaseClient.
                  --> 314 return self._make_api_call(operation_name, kwargs)
                  315
                  316 _api_call.name = str(py_operation_name)

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
                  597 else:
                  598 http, parsed_response = self._endpoint.make_request(
                  --> 599 operation_model, request_dict)
                  600
                  601 self.meta.events.emit(

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in make_request(self, operation_model, request_dict)
                  146 logger.debug("Making request for %s (verify_ssl=%s) with params: %s",
                  147 operation_model, self.verify, request_dict)
                  --> 148 return self._send_request(request_dict, operation_model)
                  149
                  150 def create_request(self, params, operation_model=None):

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _send_request(self, request_dict, operation_model)
                  175 request, operation_model, attempts)
                  176 while self._needs_retry(attempts, operation_model, request_dict,
                  --> 177 success_response, exception):
                  178 attempts += 1
                  179 # If there is a stream associated with the request, we need

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _needs_retry(self, attempts, operation_model, request_dict, response, caught_exception)
                  271 event_name, response=response, endpoint=self,
                  272 operation=operation_model, attempts=attempts,
                  --> 273 caught_exception=caught_exception, request_dict=request_dict)
                  274 handler_response = first_non_none_response(responses)
                  275 if handler_response is None:

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in emit(self, event_name, **kwargs)
                  225 handlers.
                  226 """
                  --> 227 return self._emit(event_name, kwargs)
                  228
                  229 def emit_until_response(self, event_name, **kwargs):

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
                  358 aliased_event_name = self._alias_event_name(event_name)
                  359 return super(AliasedEventEmitter, self)._emit(
                  --> 360 aliased_event_name, kwargs, stop_on_response
                  361 )
                  362

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
                  208 for handler in handlers_to_call:
                  209 logger.debug('Event %s: calling handler %s', event_name, handler)
                  --> 210 response = handler(**kwargs)
                  211 responses.append((handler, response))
                  212 if stop_on_response and response is not None:

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempts, response, caught_exception, **kwargs)
                  181
                  182 """
                  --> 183 if self._checker(attempts, response, caught_exception):
                  184 result = self._action(attempts=attempts)
                  185 logger.debug("Retry needed, action of: %s", result)

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
                  249 def call(self, attempt_number, response, caught_exception):
                  250 should_retry = self._should_retry(attempt_number, response,
                  --> 251 caught_exception)
                  252 if should_retry:
                  253 if attempt_number >= self._max_attempts:

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _should_retry(self, attempt_number, response, caught_exception)
                  275 # If we've exceeded the max attempts we just let the exception
                  276 # propogate if one has occurred.
                  --> 277 return self._checker(attempt_number, response, caught_exception)
                  278
                  279

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
                  315 for checker in self._checkers:
                  316 checker_response = checker(attempt_number, response,
                  --> 317 caught_exception)
                  318 if checker_response:
                  319 return checker_response

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
                  221 elif caught_exception is not None:
                  222 return self._check_caught_exception(
                  --> 223 attempt_number, caught_exception)
                  224 else:
                  225 raise ValueError("Both response and caught_exception are None.")

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _check_caught_exception(self, attempt_number, caught_exception)
                  357 # the MaxAttemptsDecorator is not interested in retrying the exception
                  358 # then this exception just propogates out past the retry code.
                  --> 359 raise caught_exception

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _get_response(self, request, operation_model, attempts)
                  220 request, verify=self.verify,
                  221 stream=streaming,
                  --> 222 proxies=self.proxies, timeout=self.timeout)
                  223 except ConnectionError as e:
                  224 # For a connection error, if it looks like it's a DNS

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/sessions.py in send(self, request, **kwargs)
                  571
                  572 # Send the request
                  --> 573 r = adapter.send(request, **kwargs)
                  574
                  575 # Total elapsed time of the request (approximately)

                  ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
                  413
                  414 except (ProtocolError, socket.error) as err:
                  --> 415 raise ConnectionError(err, request=request)
                  416
                  417 except MaxRetryError as e:

                  ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))`

                  • Exact command to reproduce:
                    endpoint = my_estimator.deploy(initial_instance_count=1, instance_type="ml.m4.xlarge")
                    endpoint.predict(test_dict)

                  Activity

                  Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

                  Metadata

                  Metadata

                  Assignees

                  No one assigned

                    Labels

                    No labels
                    No labels

                    Type

                    No type

                    Projects

                    No projects

                      Milestone

                      No milestone

                      Relationships

                      None yet

                      Development

                      No branches or pull requests

                      Issue actions

                      , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
                      Skip to content

                      Cant invoke the endpoint! (104 Connection rest by peer) #448

                      Description

                      @gautiese

                      Please fill out the form below.

                      System Information

                      • Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Tensorflow
                      • Framework Version: 1.10
                      • Python Version: 2
                      • CPU or GPU: CPU
                      • Python SDK Version:
                      • Are you using a custom image: No

                      Describe the problem

                      Describe the problem or feature request clearly here.
                      When I try to invoke my newly created endoint, I get a 104 error.
                      Is this a timeout issue? It is a fairly large network

                      Minimal repro / logs

                      `---------------------------------------------------------------------------
                      ConnectionResetError Traceback (most recent call last)
                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
                      543 timeout=timeout_obj,
                      --> 544 body=body, headers=headers)
                      545

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
                      348 # urllib3.request. It also calls makefile (recv) on the socket.
                      --> 349 conn.request(method, url, **httplib_request_kw)
                      350

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
                      1238 """Send a complete request to the server."""
                      -> 1239 self._send_request(method, url, body, headers, encode_chunked)
                      1240

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
                      129 rval = HTTPConnection._send_request(
                      --> 130 self, method, url, body, headers, *args, **kwargs)
                      131 self._expect_header_set = False

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
                      1284 body = _encode(body, 'body')
                      -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
                      1286

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
                      1233 raise CannotSendHeader()
                      -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
                      1235

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
                      156 message_body = None
                      --> 157 self.send(msg)
                      158 if self._expect_header_set:

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
                      241 return
                      --> 242 return HTTPConnection.send(self, str)
                      243

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
                      985 try:
                      --> 986 self.sock.sendall(data)
                      987 except TypeError:

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
                      971 while count < amount:
                      --> 972 v = self.send(byte_view[count:])
                      973 count += v

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
                      940 self.class)
                      --> 941 return self._sslobj.write(data)
                      942 else:

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
                      641 """
                      --> 642 return self._sslobj.write(data)
                      643

                      ConnectionResetError: [Errno 104] Connection reset by peer

                      During handling of the above exception, another exception occurred:

                      ProtocolError Traceback (most recent call last)
                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
                      369 retries=self.max_retries,
                      --> 370 timeout=timeout
                      371 )

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
                      596 retries = retries.increment(method, url, error=e, _pool=self,
                      --> 597 _stacktrace=sys.exc_info()[2])
                      598 retries.sleep()

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
                      244 if read is False:
                      --> 245 raise six.reraise(type(error), error, _stacktrace)
                      246 elif read is not None:

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/packages/six.py in reraise(tp, value, tb)
                      308 if value.traceback is not tb:
                      --> 309 raise value.with_traceback(tb)
                      310 raise value

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
                      543 timeout=timeout_obj,
                      --> 544 body=body, headers=headers)
                      545

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
                      348 # urllib3.request. It also calls makefile (recv) on the socket.
                      --> 349 conn.request(method, url, **httplib_request_kw)
                      350

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
                      1238 """Send a complete request to the server."""
                      -> 1239 self._send_request(method, url, body, headers, encode_chunked)
                      1240

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
                      129 rval = HTTPConnection._send_request(
                      --> 130 self, method, url, body, headers, *args, **kwargs)
                      131 self._expect_header_set = False

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
                      1284 body = _encode(body, 'body')
                      -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
                      1286

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
                      1233 raise CannotSendHeader()
                      -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
                      1235

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
                      156 message_body = None
                      --> 157 self.send(msg)
                      158 if self._expect_header_set:

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
                      241 return
                      --> 242 return HTTPConnection.send(self, str)
                      243

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
                      985 try:
                      --> 986 self.sock.sendall(data)
                      987 except TypeError:

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
                      971 while count < amount:
                      --> 972 v = self.send(byte_view[count:])
                      973 count += v

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
                      940 self.class)
                      --> 941 return self._sslobj.write(data)
                      942 else:

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
                      641 """
                      --> 642 return self._sslobj.write(data)
                      643

                      ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

                      During handling of the above exception, another exception occurred:

                      ConnectionError Traceback (most recent call last)
                      in ()
                      ----> 1 endpoint.predict(json.dumps(test_dict))

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/sagemaker/predictor.py in predict(self, data)
                      85 request_args['Accept'] = self.accept
                      86
                      ---> 87 response = self.sagemaker_session.sagemaker_runtime_client.invoke_endpoint(**request_args)
                      88
                      89 response_body = response['Body']

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
                      312 "%s() only accepts keyword arguments." % py_operation_name)
                      313 # The "self" in this scope is referring to the BaseClient.
                      --> 314 return self._make_api_call(operation_name, kwargs)
                      315
                      316 _api_call.name = str(py_operation_name)

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
                      597 else:
                      598 http, parsed_response = self._endpoint.make_request(
                      --> 599 operation_model, request_dict)
                      600
                      601 self.meta.events.emit(

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in make_request(self, operation_model, request_dict)
                      146 logger.debug("Making request for %s (verify_ssl=%s) with params: %s",
                      147 operation_model, self.verify, request_dict)
                      --> 148 return self._send_request(request_dict, operation_model)
                      149
                      150 def create_request(self, params, operation_model=None):

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _send_request(self, request_dict, operation_model)
                      175 request, operation_model, attempts)
                      176 while self._needs_retry(attempts, operation_model, request_dict,
                      --> 177 success_response, exception):
                      178 attempts += 1
                      179 # If there is a stream associated with the request, we need

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _needs_retry(self, attempts, operation_model, request_dict, response, caught_exception)
                      271 event_name, response=response, endpoint=self,
                      272 operation=operation_model, attempts=attempts,
                      --> 273 caught_exception=caught_exception, request_dict=request_dict)
                      274 handler_response = first_non_none_response(responses)
                      275 if handler_response is None:

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in emit(self, event_name, **kwargs)
                      225 handlers.
                      226 """
                      --> 227 return self._emit(event_name, kwargs)
                      228
                      229 def emit_until_response(self, event_name, **kwargs):

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
                      358 aliased_event_name = self._alias_event_name(event_name)
                      359 return super(AliasedEventEmitter, self)._emit(
                      --> 360 aliased_event_name, kwargs, stop_on_response
                      361 )
                      362

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
                      208 for handler in handlers_to_call:
                      209 logger.debug('Event %s: calling handler %s', event_name, handler)
                      --> 210 response = handler(**kwargs)
                      211 responses.append((handler, response))
                      212 if stop_on_response and response is not None:

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempts, response, caught_exception, **kwargs)
                      181
                      182 """
                      --> 183 if self._checker(attempts, response, caught_exception):
                      184 result = self._action(attempts=attempts)
                      185 logger.debug("Retry needed, action of: %s", result)

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
                      249 def call(self, attempt_number, response, caught_exception):
                      250 should_retry = self._should_retry(attempt_number, response,
                      --> 251 caught_exception)
                      252 if should_retry:
                      253 if attempt_number >= self._max_attempts:

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _should_retry(self, attempt_number, response, caught_exception)
                      275 # If we've exceeded the max attempts we just let the exception
                      276 # propogate if one has occurred.
                      --> 277 return self._checker(attempt_number, response, caught_exception)
                      278
                      279

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
                      315 for checker in self._checkers:
                      316 checker_response = checker(attempt_number, response,
                      --> 317 caught_exception)
                      318 if checker_response:
                      319 return checker_response

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
                      221 elif caught_exception is not None:
                      222 return self._check_caught_exception(
                      --> 223 attempt_number, caught_exception)
                      224 else:
                      225 raise ValueError("Both response and caught_exception are None.")

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _check_caught_exception(self, attempt_number, caught_exception)
                      357 # the MaxAttemptsDecorator is not interested in retrying the exception
                      358 # then this exception just propogates out past the retry code.
                      --> 359 raise caught_exception

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _get_response(self, request, operation_model, attempts)
                      220 request, verify=self.verify,
                      221 stream=streaming,
                      --> 222 proxies=self.proxies, timeout=self.timeout)
                      223 except ConnectionError as e:
                      224 # For a connection error, if it looks like it's a DNS

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/sessions.py in send(self, request, **kwargs)
                      571
                      572 # Send the request
                      --> 573 r = adapter.send(request, **kwargs)
                      574
                      575 # Total elapsed time of the request (approximately)

                      ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
                      413
                      414 except (ProtocolError, socket.error) as err:
                      --> 415 raise ConnectionError(err, request=request)
                      416
                      417 except MaxRetryError as e:

                      ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))`

                      • Exact command to reproduce:
                        endpoint = my_estimator.deploy(initial_instance_count=1, instance_type="ml.m4.xlarge")
                        endpoint.predict(test_dict)

                      Activity

                      Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

                      Metadata

                      Metadata

                      Assignees

                      No one assigned

                        Labels

                        No labels
                        No labels

                        Type

                        No type

                        Projects

                        No projects

                          Milestone

                          No milestone

                          Relationships

                          None yet

                          Development

                          No branches or pull requests

                          Issue actions

                          , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
                          Skip to content

                          Cant invoke the endpoint! (104 Connection rest by peer) #448

                          Description

                          @gautiese

                          Please fill out the form below.

                          System Information

                          • Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Tensorflow
                          • Framework Version: 1.10
                          • Python Version: 2
                          • CPU or GPU: CPU
                          • Python SDK Version:
                          • Are you using a custom image: No

                          Describe the problem

                          Describe the problem or feature request clearly here.
                          When I try to invoke my newly created endoint, I get a 104 error.
                          Is this a timeout issue? It is a fairly large network

                          Minimal repro / logs

                          `---------------------------------------------------------------------------
                          ConnectionResetError Traceback (most recent call last)
                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
                          543 timeout=timeout_obj,
                          --> 544 body=body, headers=headers)
                          545

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
                          348 # urllib3.request. It also calls makefile (recv) on the socket.
                          --> 349 conn.request(method, url, **httplib_request_kw)
                          350

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
                          1238 """Send a complete request to the server."""
                          -> 1239 self._send_request(method, url, body, headers, encode_chunked)
                          1240

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
                          129 rval = HTTPConnection._send_request(
                          --> 130 self, method, url, body, headers, *args, **kwargs)
                          131 self._expect_header_set = False

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
                          1284 body = _encode(body, 'body')
                          -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
                          1286

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
                          1233 raise CannotSendHeader()
                          -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
                          1235

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
                          156 message_body = None
                          --> 157 self.send(msg)
                          158 if self._expect_header_set:

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
                          241 return
                          --> 242 return HTTPConnection.send(self, str)
                          243

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
                          985 try:
                          --> 986 self.sock.sendall(data)
                          987 except TypeError:

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
                          971 while count < amount:
                          --> 972 v = self.send(byte_view[count:])
                          973 count += v

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
                          940 self.class)
                          --> 941 return self._sslobj.write(data)
                          942 else:

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
                          641 """
                          --> 642 return self._sslobj.write(data)
                          643

                          ConnectionResetError: [Errno 104] Connection reset by peer

                          During handling of the above exception, another exception occurred:

                          ProtocolError Traceback (most recent call last)
                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
                          369 retries=self.max_retries,
                          --> 370 timeout=timeout
                          371 )

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
                          596 retries = retries.increment(method, url, error=e, _pool=self,
                          --> 597 _stacktrace=sys.exc_info()[2])
                          598 retries.sleep()

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
                          244 if read is False:
                          --> 245 raise six.reraise(type(error), error, _stacktrace)
                          246 elif read is not None:

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/packages/six.py in reraise(tp, value, tb)
                          308 if value.traceback is not tb:
                          --> 309 raise value.with_traceback(tb)
                          310 raise value

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
                          543 timeout=timeout_obj,
                          --> 544 body=body, headers=headers)
                          545

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
                          348 # urllib3.request. It also calls makefile (recv) on the socket.
                          --> 349 conn.request(method, url, **httplib_request_kw)
                          350

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
                          1238 """Send a complete request to the server."""
                          -> 1239 self._send_request(method, url, body, headers, encode_chunked)
                          1240

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
                          129 rval = HTTPConnection._send_request(
                          --> 130 self, method, url, body, headers, *args, **kwargs)
                          131 self._expect_header_set = False

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
                          1284 body = _encode(body, 'body')
                          -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
                          1286

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
                          1233 raise CannotSendHeader()
                          -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
                          1235

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
                          156 message_body = None
                          --> 157 self.send(msg)
                          158 if self._expect_header_set:

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
                          241 return
                          --> 242 return HTTPConnection.send(self, str)
                          243

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
                          985 try:
                          --> 986 self.sock.sendall(data)
                          987 except TypeError:

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
                          971 while count < amount:
                          --> 972 v = self.send(byte_view[count:])
                          973 count += v

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
                          940 self.class)
                          --> 941 return self._sslobj.write(data)
                          942 else:

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
                          641 """
                          --> 642 return self._sslobj.write(data)
                          643

                          ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

                          During handling of the above exception, another exception occurred:

                          ConnectionError Traceback (most recent call last)
                          in ()
                          ----> 1 endpoint.predict(json.dumps(test_dict))

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/sagemaker/predictor.py in predict(self, data)
                          85 request_args['Accept'] = self.accept
                          86
                          ---> 87 response = self.sagemaker_session.sagemaker_runtime_client.invoke_endpoint(**request_args)
                          88
                          89 response_body = response['Body']

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
                          312 "%s() only accepts keyword arguments." % py_operation_name)
                          313 # The "self" in this scope is referring to the BaseClient.
                          --> 314 return self._make_api_call(operation_name, kwargs)
                          315
                          316 _api_call.name = str(py_operation_name)

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
                          597 else:
                          598 http, parsed_response = self._endpoint.make_request(
                          --> 599 operation_model, request_dict)
                          600
                          601 self.meta.events.emit(

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in make_request(self, operation_model, request_dict)
                          146 logger.debug("Making request for %s (verify_ssl=%s) with params: %s",
                          147 operation_model, self.verify, request_dict)
                          --> 148 return self._send_request(request_dict, operation_model)
                          149
                          150 def create_request(self, params, operation_model=None):

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _send_request(self, request_dict, operation_model)
                          175 request, operation_model, attempts)
                          176 while self._needs_retry(attempts, operation_model, request_dict,
                          --> 177 success_response, exception):
                          178 attempts += 1
                          179 # If there is a stream associated with the request, we need

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _needs_retry(self, attempts, operation_model, request_dict, response, caught_exception)
                          271 event_name, response=response, endpoint=self,
                          272 operation=operation_model, attempts=attempts,
                          --> 273 caught_exception=caught_exception, request_dict=request_dict)
                          274 handler_response = first_non_none_response(responses)
                          275 if handler_response is None:

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in emit(self, event_name, **kwargs)
                          225 handlers.
                          226 """
                          --> 227 return self._emit(event_name, kwargs)
                          228
                          229 def emit_until_response(self, event_name, **kwargs):

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
                          358 aliased_event_name = self._alias_event_name(event_name)
                          359 return super(AliasedEventEmitter, self)._emit(
                          --> 360 aliased_event_name, kwargs, stop_on_response
                          361 )
                          362

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
                          208 for handler in handlers_to_call:
                          209 logger.debug('Event %s: calling handler %s', event_name, handler)
                          --> 210 response = handler(**kwargs)
                          211 responses.append((handler, response))
                          212 if stop_on_response and response is not None:

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempts, response, caught_exception, **kwargs)
                          181
                          182 """
                          --> 183 if self._checker(attempts, response, caught_exception):
                          184 result = self._action(attempts=attempts)
                          185 logger.debug("Retry needed, action of: %s", result)

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
                          249 def call(self, attempt_number, response, caught_exception):
                          250 should_retry = self._should_retry(attempt_number, response,
                          --> 251 caught_exception)
                          252 if should_retry:
                          253 if attempt_number >= self._max_attempts:

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _should_retry(self, attempt_number, response, caught_exception)
                          275 # If we've exceeded the max attempts we just let the exception
                          276 # propogate if one has occurred.
                          --> 277 return self._checker(attempt_number, response, caught_exception)
                          278
                          279

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
                          315 for checker in self._checkers:
                          316 checker_response = checker(attempt_number, response,
                          --> 317 caught_exception)
                          318 if checker_response:
                          319 return checker_response

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
                          221 elif caught_exception is not None:
                          222 return self._check_caught_exception(
                          --> 223 attempt_number, caught_exception)
                          224 else:
                          225 raise ValueError("Both response and caught_exception are None.")

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _check_caught_exception(self, attempt_number, caught_exception)
                          357 # the MaxAttemptsDecorator is not interested in retrying the exception
                          358 # then this exception just propogates out past the retry code.
                          --> 359 raise caught_exception

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _get_response(self, request, operation_model, attempts)
                          220 request, verify=self.verify,
                          221 stream=streaming,
                          --> 222 proxies=self.proxies, timeout=self.timeout)
                          223 except ConnectionError as e:
                          224 # For a connection error, if it looks like it's a DNS

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/sessions.py in send(self, request, **kwargs)
                          571
                          572 # Send the request
                          --> 573 r = adapter.send(request, **kwargs)
                          574
                          575 # Total elapsed time of the request (approximately)

                          ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
                          413
                          414 except (ProtocolError, socket.error) as err:
                          --> 415 raise ConnectionError(err, request=request)
                          416
                          417 except MaxRetryError as e:

                          ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))`

                          • Exact command to reproduce:
                            endpoint = my_estimator.deploy(initial_instance_count=1, instance_type="ml.m4.xlarge")
                            endpoint.predict(test_dict)

                          Activity

                          Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

                          Metadata

                          Metadata

                          Assignees

                          No one assigned

                            Labels

                            No labels
                            No labels

                            Type

                            No type

                            Projects

                            No projects

                              Milestone

                              No milestone

                              Relationships

                              None yet

                              Development

                              No branches or pull requests

                              Issue actions

                              , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
                              Skip to content

                              Cant invoke the endpoint! (104 Connection rest by peer) #448

                              Description

                              @gautiese

                              Please fill out the form below.

                              System Information

                              • Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Tensorflow
                              • Framework Version: 1.10
                              • Python Version: 2
                              • CPU or GPU: CPU
                              • Python SDK Version:
                              • Are you using a custom image: No

                              Describe the problem

                              Describe the problem or feature request clearly here.
                              When I try to invoke my newly created endoint, I get a 104 error.
                              Is this a timeout issue? It is a fairly large network

                              Minimal repro / logs

                              `---------------------------------------------------------------------------
                              ConnectionResetError Traceback (most recent call last)
                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
                              543 timeout=timeout_obj,
                              --> 544 body=body, headers=headers)
                              545

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
                              348 # urllib3.request. It also calls makefile (recv) on the socket.
                              --> 349 conn.request(method, url, **httplib_request_kw)
                              350

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
                              1238 """Send a complete request to the server."""
                              -> 1239 self._send_request(method, url, body, headers, encode_chunked)
                              1240

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
                              129 rval = HTTPConnection._send_request(
                              --> 130 self, method, url, body, headers, *args, **kwargs)
                              131 self._expect_header_set = False

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
                              1284 body = _encode(body, 'body')
                              -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
                              1286

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
                              1233 raise CannotSendHeader()
                              -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
                              1235

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
                              156 message_body = None
                              --> 157 self.send(msg)
                              158 if self._expect_header_set:

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
                              241 return
                              --> 242 return HTTPConnection.send(self, str)
                              243

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
                              985 try:
                              --> 986 self.sock.sendall(data)
                              987 except TypeError:

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
                              971 while count < amount:
                              --> 972 v = self.send(byte_view[count:])
                              973 count += v

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
                              940 self.class)
                              --> 941 return self._sslobj.write(data)
                              942 else:

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
                              641 """
                              --> 642 return self._sslobj.write(data)
                              643

                              ConnectionResetError: [Errno 104] Connection reset by peer

                              During handling of the above exception, another exception occurred:

                              ProtocolError Traceback (most recent call last)
                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
                              369 retries=self.max_retries,
                              --> 370 timeout=timeout
                              371 )

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
                              596 retries = retries.increment(method, url, error=e, _pool=self,
                              --> 597 _stacktrace=sys.exc_info()[2])
                              598 retries.sleep()

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
                              244 if read is False:
                              --> 245 raise six.reraise(type(error), error, _stacktrace)
                              246 elif read is not None:

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/packages/six.py in reraise(tp, value, tb)
                              308 if value.traceback is not tb:
                              --> 309 raise value.with_traceback(tb)
                              310 raise value

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
                              543 timeout=timeout_obj,
                              --> 544 body=body, headers=headers)
                              545

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
                              348 # urllib3.request. It also calls makefile (recv) on the socket.
                              --> 349 conn.request(method, url, **httplib_request_kw)
                              350

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
                              1238 """Send a complete request to the server."""
                              -> 1239 self._send_request(method, url, body, headers, encode_chunked)
                              1240

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_request(self, method, url, body, headers, *args, **kwargs)
                              129 rval = HTTPConnection._send_request(
                              --> 130 self, method, url, body, headers, *args, **kwargs)
                              131 self._expect_header_set = False

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
                              1284 body = _encode(body, 'body')
                              -> 1285 self.endheaders(body, encode_chunked=encode_chunked)
                              1286

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
                              1233 raise CannotSendHeader()
                              -> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
                              1235

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in _send_output(self, message_body, *args, **kwargs)
                              156 message_body = None
                              --> 157 self.send(msg)
                              158 if self._expect_header_set:

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/awsrequest.py in send(self, str)
                              241 return
                              --> 242 return HTTPConnection.send(self, str)
                              243

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/http/client.py in send(self, data)
                              985 try:
                              --> 986 self.sock.sendall(data)
                              987 except TypeError:

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in sendall(self, data, flags)
                              971 while count < amount:
                              --> 972 v = self.send(byte_view[count:])
                              973 count += v

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in send(self, data, flags)
                              940 self.class)
                              --> 941 return self._sslobj.write(data)
                              942 else:

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/ssl.py in write(self, data)
                              641 """
                              --> 642 return self._sslobj.write(data)
                              643

                              ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

                              During handling of the above exception, another exception occurred:

                              ConnectionError Traceback (most recent call last)
                              in ()
                              ----> 1 endpoint.predict(json.dumps(test_dict))

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/sagemaker/predictor.py in predict(self, data)
                              85 request_args['Accept'] = self.accept
                              86
                              ---> 87 response = self.sagemaker_session.sagemaker_runtime_client.invoke_endpoint(**request_args)
                              88
                              89 response_body = response['Body']

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
                              312 "%s() only accepts keyword arguments." % py_operation_name)
                              313 # The "self" in this scope is referring to the BaseClient.
                              --> 314 return self._make_api_call(operation_name, kwargs)
                              315
                              316 _api_call.name = str(py_operation_name)

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
                              597 else:
                              598 http, parsed_response = self._endpoint.make_request(
                              --> 599 operation_model, request_dict)
                              600
                              601 self.meta.events.emit(

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in make_request(self, operation_model, request_dict)
                              146 logger.debug("Making request for %s (verify_ssl=%s) with params: %s",
                              147 operation_model, self.verify, request_dict)
                              --> 148 return self._send_request(request_dict, operation_model)
                              149
                              150 def create_request(self, params, operation_model=None):

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _send_request(self, request_dict, operation_model)
                              175 request, operation_model, attempts)
                              176 while self._needs_retry(attempts, operation_model, request_dict,
                              --> 177 success_response, exception):
                              178 attempts += 1
                              179 # If there is a stream associated with the request, we need

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _needs_retry(self, attempts, operation_model, request_dict, response, caught_exception)
                              271 event_name, response=response, endpoint=self,
                              272 operation=operation_model, attempts=attempts,
                              --> 273 caught_exception=caught_exception, request_dict=request_dict)
                              274 handler_response = first_non_none_response(responses)
                              275 if handler_response is None:

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in emit(self, event_name, **kwargs)
                              225 handlers.
                              226 """
                              --> 227 return self._emit(event_name, kwargs)
                              228
                              229 def emit_until_response(self, event_name, **kwargs):

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
                              358 aliased_event_name = self._alias_event_name(event_name)
                              359 return super(AliasedEventEmitter, self)._emit(
                              --> 360 aliased_event_name, kwargs, stop_on_response
                              361 )
                              362

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/hooks.py in _emit(self, event_name, kwargs, stop_on_response)
                              208 for handler in handlers_to_call:
                              209 logger.debug('Event %s: calling handler %s', event_name, handler)
                              --> 210 response = handler(**kwargs)
                              211 responses.append((handler, response))
                              212 if stop_on_response and response is not None:

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempts, response, caught_exception, **kwargs)
                              181
                              182 """
                              --> 183 if self._checker(attempts, response, caught_exception):
                              184 result = self._action(attempts=attempts)
                              185 logger.debug("Retry needed, action of: %s", result)

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
                              249 def call(self, attempt_number, response, caught_exception):
                              250 should_retry = self._should_retry(attempt_number, response,
                              --> 251 caught_exception)
                              252 if should_retry:
                              253 if attempt_number >= self._max_attempts:

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _should_retry(self, attempt_number, response, caught_exception)
                              275 # If we've exceeded the max attempts we just let the exception
                              276 # propogate if one has occurred.
                              --> 277 return self._checker(attempt_number, response, caught_exception)
                              278
                              279

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
                              315 for checker in self._checkers:
                              316 checker_response = checker(attempt_number, response,
                              --> 317 caught_exception)
                              318 if checker_response:
                              319 return checker_response

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in call(self, attempt_number, response, caught_exception)
                              221 elif caught_exception is not None:
                              222 return self._check_caught_exception(
                              --> 223 attempt_number, caught_exception)
                              224 else:
                              225 raise ValueError("Both response and caught_exception are None.")

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/retryhandler.py in _check_caught_exception(self, attempt_number, caught_exception)
                              357 # the MaxAttemptsDecorator is not interested in retrying the exception
                              358 # then this exception just propogates out past the retry code.
                              --> 359 raise caught_exception

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/endpoint.py in _get_response(self, request, operation_model, attempts)
                              220 request, verify=self.verify,
                              221 stream=streaming,
                              --> 222 proxies=self.proxies, timeout=self.timeout)
                              223 except ConnectionError as e:
                              224 # For a connection error, if it looks like it's a DNS

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/sessions.py in send(self, request, **kwargs)
                              571
                              572 # Send the request
                              --> 573 r = adapter.send(request, **kwargs)
                              574
                              575 # Total elapsed time of the request (approximately)

                              ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
                              413
                              414 except (ProtocolError, socket.error) as err:
                              --> 415 raise ConnectionError(err, request=request)
                              416
                              417 except MaxRetryError as e:

                              ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))`

                              • Exact command to reproduce:
                                endpoint = my_estimator.deploy(initial_instance_count=1, instance_type="ml.m4.xlarge")
                                endpoint.predict(test_dict)

                              Activity

                              Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

                              Metadata

                              Metadata

                              Assignees

                              No one assigned

                                Labels

                                No labels
                                No labels

                                Type

                                No type

                                Projects

                                No projects

                                  Milestone

                                  No milestone

                                  Relationships

                                  None yet

                                  Development

                                  No branches or pull requests

                                  Issue actions