nlpbook icon indicating copy to clipboard operation
nlpbook copied to clipboard

4-3 마지막 웹서비스 개시에서 실행이 되지 않습니다

Open DRamghi opened this issue 3 years ago • 3 comments

안녕하세요. 좋은 책을 만나게 되어 기쁜 마음으로 공부하고 있습니다. 그런데 4-3에서 플라스크 웹서비스 개시에서 계속 로딩만 되고 실행이 되지 않습니다. 1

실행하면 아래와 같이 나오네요. 어떻게 하면 될지 알려주시면 감사하겠습니다.

  • Serving Flask app "ratsnlp.nlpbook.classification.deploy" (lazy loading)
  • Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Debug mode: off INFO:werkzeug: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) Exception in thread Thread-16: Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 159, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw) File "/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py", line 80, in create_connection raise err File "/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py", line 70, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 354, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.7/http/client.py", line 1281, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1327, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1276, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1036, in _send_output self.send(msg) File "/usr/lib/python3.7/http/client.py", line 976, in send self.connect() File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 181, in connect conn = self._new_conn() File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 168, in _new_conn self, "Failed to establish a new connection: %s" % e) urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0cae896810>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 638, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/local/lib/python3.7/dist-packages/urllib3/util/retry.py", line 399, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=4040): Max retries exceeded with url: /api/tunnels (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0cae896810>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 1177, in run self.function(*self.args, **self.kwargs) File "/usr/local/lib/python3.7/dist-packages/flask_ngrok.py", line 70, in start_ngrok ngrok_address = _run_ngrok() File "/usr/local/lib/python3.7/dist-packages/flask_ngrok.py", line 35, in _run_ngrok tunnel_url = requests.get(localhost_url).text # Get the tunnel information File "/usr/local/lib/python3.7/dist-packages/requests/api.py", line 76, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 530, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 643, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=4040): Max retries exceeded with url: /api/tunnels (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0cae896810>: Failed to establish a new connection: [Errno 111] Connection refused'))

DRamghi avatar Nov 05 '22 15:11 DRamghi

안녕하세요 @DRamghi 님, 해당 에러는 authtoken이 잘못 입력되어서 발생한 문제로 보입니다. 다음과 같이 입력해서 다시 실행해보시겠어요?

현재

!mkdir /root/.ngrok2 && echo "authtoken: {2H8...Dw4}" > /root/.ngrok2/ngrok.yml

수정

!mkdir /root/.ngrok2 && echo "authtoken: 2H8...Dw4" > /root/.ngrok2/ngrok.yml

ratsgo avatar Nov 07 '22 04:11 ratsgo

자세한 내용은 다음 이슈를 참고하셔도 좋을 것 같습니다.

  • https://github.com/ratsgo/nlpbook/issues/20

ratsgo avatar Nov 07 '22 04:11 ratsgo

말씀대로 수정하니 잘 작동합니다! 친절히 답해주셔서 감사합니다^^

2022년 11월 7일 (월) 오후 1:04, gichang.lee @.***>님이 작성:

안녕하세요 @DRamghi https://github.com/DRamghi 님, 해당 에러는 authtoken이 잘못 입력되어서 발생한 문제로 보입니다. 다음과 같이 입력해서 다시 실행해보시겠어요?

현재

!mkdir /root/.ngrok2 && echo "authtoken: {2H8...Dw4}" > /root/.ngrok2/ngrok.yml

수정

!mkdir /root/.ngrok2 && echo "authtoken: 2H8...Dw4" > /root/.ngrok2/ngrok.yml

— Reply to this email directly, view it on GitHub https://github.com/ratsgo/nlpbook/issues/48#issuecomment-1305050718, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3IHA6ZHJZUQ2UV5ZDAX52LWHB5U5ANCNFSM6AAAAAARX63MAA . You are receiving this because you were mentioned.Message ID: @.***>

DRamghi avatar Nov 19 '22 07:11 DRamghi