FoloToy / folotoy-server-self-hosting

Config files for self-hosting the FoloToy Server. Documents: https://docs.folotoy.com
https://tool.folotoy.com
GNU General Public License v3.0
468 stars 85 forks source link

fly.io 部署完成后,问了没有反应 #104

Closed hywailiu closed 10 months ago

hywailiu commented 10 months ago

WARNING The app is not listening on the expected address and will not be reachable by fly-proxy. You can fix this by configuring your app to listen on the following addresses:

部署flyio项目的时候提示8085端口问题,看了fly Monitoring 录音是没有日志的,只能切换角色 启动检测如下 2023-12-28T16:39:08.956 runner[148e5233f32748] nrt [info] Configuring firecracker

2023-12-28T16:39:09.790 app[148e5233f32748] nrt [info] INFO Sending signal SIGINT to main child process w/ PID 306

2023-12-28T16:39:10.246 app[148e5233f32748] nrt [info] INFO Sending signal SIGTERM to main child process w/ PID 306

2023-12-28T16:39:10.986 app[148e5233f32748] nrt [info] INFO Main child exited with signal (with signal 'SIGTERM', core dumped? false)

2023-12-28T16:39:10.987 app[148e5233f32748] nrt [info] INFO Starting clean up.

2023-12-28T16:39:10.989 app[148e5233f32748] nrt [info] WARN hallpass exited, pid: 307, status: signal: 15 (SIGTERM)

2023-12-28T16:39:10.994 app[148e5233f32748] nrt [info] 2023/12/29 00:39:10 listening on [fdaa:4:93b6:a7b:22e:845d:ce8a:2]:22 (DNS: [fdaa::3]:53)

2023-12-28T16:39:11.009 app[148e5233f32748] nrt [info] INFO: Shutting down

2023-12-28T16:39:11.112 app[148e5233f32748] nrt [info] INFO: Waiting for application shutdown.

2023-12-28T16:39:11.112 app[148e5233f32748] nrt [info] INFO: Application shutdown complete.

2023-12-28T16:39:11.112 app[148e5233f32748] nrt [info] INFO: Finished server process [315]

2023-12-28T16:39:11.988 app[148e5233f32748] nrt [info] [ 408.700932] reboot: Restarting system

2023-12-28T16:39:12.322 app[148e5233f32748] nrt [info] [ 0.037385] Spectre V2 : WARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible via Spectre v2 BHB attacks!

2023-12-28T16:39:12.358 app[148e5233f32748] nrt [info] [ 0.049550] PCI: Fatal: No config space access function found

2023-12-28T16:39:12.540 app[148e5233f32748] nrt [info] INFO Starting init (commit: 15238e9)...

2023-12-28T16:39:12.551 app[148e5233f32748] nrt [info] INFO Preparing to run: ./start.sh as root

2023-12-28T16:39:12.556 app[148e5233f32748] nrt [info] INFO [fly api proxy] listening at /.fly/api

2023-12-28T16:39:12.563 app[148e5233f32748] nrt [info] 2023/12/29 00:39:12 listening on [fdaa:4:93b6:a7b:22e:845d:ce8a:2]:22 (DNS: [fdaa::3]:53)

2023-12-28T16:39:13.569 app[148e5233f32748] nrt [info] 2023-12-29 00:39:13,568 - INFO - FoloToy Server Version: v23.49.1.2-beta

2023-12-28T16:39:13.574 app[148e5233f32748] nrt [info] 2023-12-29 00:39:13,573 - INFO - API server started(http://0.0.0.0:8082)

2023-12-28T16:39:13.575 app[148e5233f32748] nrt [info] 2023-12-29 00:39:13,574 - INFO - Connected to MQTT Broker(127.0.0.1:1883)!

2023-12-28T16:39:13.577 app[148e5233f32748] nrt [info] 2023-12-29 00:39:13,577 - INFO - Speech server started(fly-global-services:8085/udp)

2023-12-28T16:39:13.585 app[148e5233f32748] nrt [info] 2023-12-29 00:39:13,584 - DEBUG - Using selector: EpollSelector

2023-12-28T16:39:13.608 app[148e5233f32748] nrt [info] INFO: Started server process [315]

2023-12-28T16:39:13.608 app[148e5233f32748] nrt [info] INFO: Waiting for application startup.

2023-12-28T16:39:13.609 app[148e5233f32748] nrt [info] INFO: Application startup complete.

2023-12-28T16:39:13.610 app[148e5233f32748] nrt [info] INFO: Uvicorn running on http://0.0.0.0:8082 (Press CTRL+C to quit)

hywailiu commented 10 months ago

重新给录音服务器设置成ip就有反应了,但还是没有回应,日志如下 2023-12-28T17:26:37.986 app[148e5233f32748] nrt [info] 2023-12-29 01:26:37,986 - WARNING - Token:[8f8f4b53c2bf4d7e860ed865d4dd1713] is unknown, need further action, block the peer: ('120.239.211.57', 5197)?

2023-12-28T17:26:37.988 app[148e5233f32748] nrt [info] 2023-12-29 01:26:37,988 - DEBUG - Peer: ('120.239.211.57', 5197) Len: 1043B

2023-12-28T17:26:37.988 app[148e5233f32748] nrt [info] 2023-12-29 01:26:37,988 - DEBUG - Received token: 8f8f4b53c2bf4d7e860ed865d4dd1713 RecordingId: 5

2023-12-28T17:26:37.988 app[148e5233f32748] nrt [info] 2023-12-29 01:26:37,988 - WARNING - Token:[8f8f4b53c2bf4d7e860ed865d4dd1713] is unknown, need further action, block the peer: ('120.239.211.57', 5197)?

2023-12-28T17:26:38.006 app[148e5233f32748] nrt [info] 2023-12-29 01:26:38,006 - DEBUG - Peer: ('120.239.211.57', 5197) Len: 1043B

2023-12-28T17:26:38.006 app[148e5233f32748] nrt [info] 2023-12-29 01:26:38,006 - DEBUG - Received token: 8f8f4b53c2bf4d7e860ed865d4dd1713 RecordingId: 5

2023-12-28T17:26:38.006 app[148e5233f32748] nrt [info] 2023-12-29 01:26:38,006 - WARNING - Token:[8f8f4b53c2bf4d7e860ed865d4dd1713] is unknown, need further action, block the peer: ('120.239.211.57', 5197)?

2023-12-28T17:26:38.022 app[148e5233f32748] nrt [info] 2023-12-29 01:26:38,022 - DEBUG - Peer: ('120.239.211.57', 5197) Len: 20B

2023-12-28T17:26:38.022 app[148e5233f32748] nrt [info] 2023-12-29 01:26:38,022 - DEBUG - Received token: 8f8f4b53c2bf4d7e860ed865d4dd1713 RecordingId: 5

2023-12-28T17:26:38.023 app[148e5233f32748] nrt [info] 2023-12-29 01:26:38,022 - WARNING - Token:[8f8f4b53c2bf4d7e860ed865d4dd1713] is unknown, need further action, block the peer: ('120.239.211.57', 5197)?

lewangdev commented 10 months ago

玩具关机重开一下

重新给录音服务器设置成ip就有反应了,但还是没有回应,日志如下

2023-12-28T17:26:37.986 app[148e5233f32748] nrt [info] 2023-12-29 01:26:37,986 - WARNING - Token:[8f8f4b53c2bf4d7e860ed865d4dd1713] is unknown, need further action, block the peer: ('120.239.211.57', 5197)?

2023-12-28T17:26:37.988 app[148e5233f32748] nrt [info] 2023-12-29 01:26:37,988 - DEBUG - Peer: ('120.239.211.57', 5197) Len: 1043B

2023-12-28T17:26:37.988 app[148e5233f32748] nrt [info] 2023-12-29 01:26:37,988 - DEBUG - Received token: 8f8f4b53c2bf4d7e860ed865d4dd1713 RecordingId: 5

2023-12-28T17:26:37.988 app[148e5233f32748] nrt [info] 2023-12-29 01:26:37,988 - WARNING - Token:[8f8f4b53c2bf4d7e860ed865d4dd1713] is unknown, need further action, block the peer: ('120.239.211.57', 5197)?

2023-12-28T17:26:38.006 app[148e5233f32748] nrt [info] 2023-12-29 01:26:38,006 - DEBUG - Peer: ('120.239.211.57', 5197) Len: 1043B

2023-12-28T17:26:38.006 app[148e5233f32748] nrt [info] 2023-12-29 01:26:38,006 - DEBUG - Received token: 8f8f4b53c2bf4d7e860ed865d4dd1713 RecordingId: 5

2023-12-28T17:26:38.006 app[148e5233f32748] nrt [info] 2023-12-29 01:26:38,006 - WARNING - Token:[8f8f4b53c2bf4d7e860ed865d4dd1713] is unknown, need further action, block the peer: ('120.239.211.57', 5197)?

2023-12-28T17:26:38.022 app[148e5233f32748] nrt [info] 2023-12-29 01:26:38,022 - DEBUG - Peer: ('120.239.211.57', 5197) Len: 20B

2023-12-28T17:26:38.022 app[148e5233f32748] nrt [info] 2023-12-29 01:26:38,022 - DEBUG - Received token: 8f8f4b53c2bf4d7e860ed865d4dd1713 RecordingId: 5

2023-12-28T17:26:38.023 app[148e5233f32748] nrt [info] 2023-12-29 01:26:38,022 - WARNING - Token:[8f8f4b53c2bf4d7e860ed865d4dd1713] is unknown, need further action, block the peer: ('120.239.211.57', 5197)?

hywailiu commented 10 months ago

新错误日志,重启一样

2023-12-30T09:10:55.496 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,496 - DEBUG - Received frame type: b'\x01'

2023-12-30T09:10:55.523 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,523 - DEBUG - Peer: ('120.239.211.91', 6334) Len: 1043B

2023-12-30T09:10:55.523 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,523 - DEBUG - Received token: 5957f9d6a42a432ab391ec1d3d571211 RecordingId: 1

2023-12-30T09:10:55.523 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,523 - DEBUG - Received frame type: b'\x01'

2023-12-30T09:10:55.527 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,526 - DEBUG - Peer: ('120.239.211.91', 6334) Len: 1043B

2023-12-30T09:10:55.527 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,527 - DEBUG - Received token: 5957f9d6a42a432ab391ec1d3d571211 RecordingId: 1

2023-12-30T09:10:55.527 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,527 - DEBUG - Received frame type: b'\x01'

2023-12-30T09:10:55.583 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,583 - DEBUG - Peer: ('120.239.211.91', 6334) Len: 1043B

2023-12-30T09:10:55.583 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,583 - DEBUG - Received token: 5957f9d6a42a432ab391ec1d3d571211 RecordingId: 1

2023-12-30T09:10:55.583 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,583 - DEBUG - Received frame type: b'\x01'

2023-12-30T09:10:55.592 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,592 - DEBUG - Peer: ('120.239.211.91', 6334) Len: 1043B

2023-12-30T09:10:55.592 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,592 - DEBUG - Received token: 5957f9d6a42a432ab391ec1d3d571211 RecordingId: 1

2023-12-30T09:10:55.592 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,592 - DEBUG - Received frame type: b'\x01'

2023-12-30T09:10:55.592 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,592 - DEBUG - Peer: ('120.239.211.91', 6334) Len: 20B

2023-12-30T09:10:55.592 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,592 - DEBUG - Received token: 5957f9d6a42a432ab391ec1d3d571211 RecordingId: 1

2023-12-30T09:10:55.592 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,592 - DEBUG - Received frame type: b'\x02'

2023-12-30T09:10:55.593 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,593 - DEBUG - Recording file created: /audio/recording-c37f2caf1fe44a5babee7a672b724192.wav

2023-12-30T09:10:55.593 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,593 - DEBUG - Current dkey=08d1f9c657ec role=2

2023-12-30T09:10:55.594 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,593 - DEBUG - STT type: openai-whisper

2023-12-30T09:10:55.601 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,599 - DEBUG - message='Request to OpenAI API' method=post path=https://api.openai.com/v1/audio/transcriptions

2023-12-30T09:10:55.601 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,599 - DEBUG - api_version=None data='{\'model\': \'whisper-1\', \'prompt\': "ok. let\'s begin.", \'response_format\': \'json\', \'language\': \'zh\'}' message='Post details'

2023-12-30T09:10:55.601 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,600 - DEBUG - Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None, status=None)

2023-12-30T09:10:55.602 app[148e5233f32748] nrt [info] 2023-12-30 17:10:55,602 - DEBUG - Starting new HTTPS connection (1): api.openai.com:443

2023-12-30T09:10:56.352 app[148e5233f32748] nrt [info] 2023-12-30 17:10:56,352 - DEBUG - https://api.openai.com:443 "POST /v1/audio/transcriptions HTTP/1.1" 429 337

2023-12-30T09:10:56.353 app[148e5233f32748] nrt [info] 2023-12-30 17:10:56,353 - DEBUG - message='OpenAI API response' path=https://api.openai.com/v1/audio/transcriptions processing_ms=None request_id=d100791a009020c87ebdc0cdc8a248f5 response_code=429

2023-12-30T09:10:56.353 app[148e5233f32748] nrt [info] 2023-12-30 17:10:56,353 - INFO - error_code=insufficient_quota error_message='You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.' error_param=None error_type=insufficient_quota message='OpenAI API error received' stream_error=False

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] 2023-12-30 17:10:56,355 - DEBUG - Publish topic: /user/folotoy/08d1f9c657ec/thing/command/call, msg: {"msgId": 3, "identifier": "audioplay_cmd", "inputParams": {"recordingId": 1, "total": 0}}

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] 2023-12-30 17:10:56,355 - ERROR - LLM error: Traceback (most recent call last):

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "core/speech_wav_processor.py", line 94, in core.speech_wav_processor.SpeechWavProcessor.write_wav

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "sdk/stt.py", line 23, in sdk.stt.SttSdk.transcribe

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "sdk/stt.py", line 24, in sdk.stt.SttSdk.transcribe

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "sdk/stt.py", line 51, in sdk.stt.SttSdk.openai_whisper

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "/usr/local/lib/python3.11/site-packages/openai/api_resources/audio.py", line 72, in transcribe

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] response, _, api_key = requestor.request("post", url, files=files, params=data)

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "/usr/local/lib/python3.11/site-packages/openai/api_requestor.py", line 299, in request

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] resp, got_stream = self._interpret_response(result, stream)

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "/usr/local/lib/python3.11/site-packages/openai/api_requestor.py", line 710, in _interpret_response

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] self._interpret_response_line(

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "/usr/local/lib/python3.11/site-packages/openai/api_requestor.py", line 775, in _interpret_response_line

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] raise self.handle_error_response(

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] Traceback (most recent call last):

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "core/speech_wav_processor.py", line 94, in core.speech_wav_processor.SpeechWavProcessor.write_wav

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "sdk/stt.py", line 23, in sdk.stt.SttSdk.transcribe

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "sdk/stt.py", line 24, in sdk.stt.SttSdk.transcribe

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "sdk/stt.py", line 51, in sdk.stt.SttSdk.openai_whisper

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "/usr/local/lib/python3.11/site-packages/openai/api_resources/audio.py", line 72, in transcribe

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] response, _, api_key = requestor.request("post", url, files=files, params=data)

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "/usr/local/lib/python3.11/site-packages/openai/api_requestor.py", line 299, in request

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] resp, got_stream = self._interpret_response(result, stream)

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "/usr/local/lib/python3.11/site-packages/openai/api_requestor.py", line 710, in _interpret_response

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] self._interpret_response_line(

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] File "/usr/local/lib/python3.11/site-packages/openai/api_requestor.py", line 775, in _interpret_response_line

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] raise self.handle_error_response(

2023-12-30T09:10:56.356 app[148e5233f32748] nrt [info] openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.

2023-12-30T09:10:58.470 app[148e5233f32748] nrt [info] 2023-12-30 17:10:58,469 - DEBUG - Received /user/folotoy/08d1f9c657ec/thing/command/callAck: message data: {'msgId': 3, 'identifier': 'audioplay_cmd', 'result': 1}

2023-12-30T09:10:58.470 app[148e5233f32748] nrt [info] 2023-12-30 17:10:58,470 - DEBUG - Command call ack: True, topic_tokens: {'#': [], '+': ['08d1f9c657ec']}

lewangdev commented 10 months ago

OpenAI的key超过使用额度了