Skip to content

前後端串接問題 #15

@En-Yi

Description

@En-Yi

您好~ 想請教前後端串接問題

目前已架設前後端 api (同電腦),但將音檔(wav) 上傳前端時,資料庫 TASK 資料表有紀錄到該筆資料,觀察到後端 whisperx 執行時會有 Worker process died 的情形
想請教一下是否有遇到過這個問題及建議呢? 如有需要補充說明再請告知,謝謝!

log:

2025-08-26 08:58:52 - INFO - [7512] Task 278435482 selected for execution
2025-08-26 08:58:52 - INFO - [7512] Execution of the task 278435482 has begun.
2025-08-26 08:58:52 - INFO_TABLE - [7512] {
"OBJID": "278435482",
"CREATE_AT": "2025-08-26T08:16:36.793Z",
"ORIGINAL_FILENAME": "我的錄音 7.wav",
"FILENAME": "audiofile-1756167396429.wav",
"STATUS": -2,
"ROUTE": "/api/v1/rest/CreateTranscribeTask",
"REF": null,
"FINISH_AT": null,
"EXEC_AT": "2025-08-26T08:58:40.800Z",
"TRANSCRIBE": null,
"LABEL": "007",
"PID": 16488,
"SSO_ACCOUNT": "andyliu@as.edu.tw",
"FILE_SIZE": 4572,
"CONTENT_LENGTH": null,
"DIARIZE": 0,
"RETRY": -227,
"DURATION": 53.080816,
"IS_DELETE": null
}
2025-08-26 08:58:52 - INFO - [7512] ready to whisperx (before update_task)
2025-08-26 08:58:52 - INFO - [7512] ready to whisperx
2025-08-26 08:58:52 - INFO - [7512] after whisperx
2025-08-26 08:58:52 - INFO - [7512] Update the status of task 278435482 to IN_PROGRESS.
2025-08-26 08:58:52 - INFO - [33596] Worker process 7512 died, starting a new one.
2025-08-26 08:58:52 - INFO - [33596] Worker online: 39852
2025-08-26 08:58:53 - INFO - [39852] Worker process 39852 is running on http://127.0.0.1:3000
2025-08-26 08:58:54 - INFO - [24948] cleanup_task clean up 1 records.
2025-08-26 08:58:54 - INFO - [33596] Worker process 24948 died, starting a new one.
2025-08-26 08:58:55 - INFO - [33596] Worker online: 4296
2025-08-26 08:58:56 - INFO - [4296] Worker process 4296 is running on http://127.0.0.1:3000

  • Note :
    其中 ready to whisperx 跟 after whisperx 是我加在 main.js 的 const child_process = spawn(python_bin, [transcribe_script_path, task_filename, task_diarize]); 這行前後的log

另外我使用 exec_whisperx_task_v1.1.py 可以產生五個輸出檔,執行指令為 python exec_whisperx_task_v1.1.py "我的錄音 7.wav" "0"

【前端】:
http://127.0.0.1:443/www/translate

git bash log:
{"message":"The task was created successfully","task_objid":"278435484","status":5}
update jobs file ok

【後端】:
http://127.0.0.1:3000

git bash: $ ./run.sh status
Sparrow is running with PID 3048

設定檔

【前端 envfile】

SystemName=TranscriptHub
PORT=443
ContainerName=aisuite
OriginAllowList=http://127.0.0.1;http://localhost
AllowMethods=POST;GET;PUT;DELETE
ResponseType=code

DocumentRoot=www/html
TemplateRoot=www/template/
UploadFolder=tmp/
JobsFile=joblists

mailHost=smtp.sinica.edu.tw
smtpPort=25
smtpEmail=its@sinica.edu.tw
smtpPassword=

#sslKeyfile=D:\TranscriptHub\apps\backend\key.pem
#sslCertification=D:\TranscriptHub\apps\backend\certificate.pem

TranslateEndpoint=http://127.0.0.1:3000/api/v1/rest/
TranslateUrl=http://127.0.0.1:3000/api/v1/rest/CreateTranscribeTask
TranslateQueryUrl=http://127.0.0.1:3000/api/v1/rest/ViewAllTask
DownloadServer=http://127.0.0.1:3000/api/v1/rest/RetrieveTranscribe/

Scope=basic
TokenUrl=http://127.0.0.1/index.php/sso2/access_token
UserUrl=http://127.0.0.1/index.php/sso2/basic
JwtKey=justgps@gmail.com

MaxUploadSize=290

NGROK_AUTHTOKEN=
RAGUrl=

【後端 .env 】

#-------------------------

Runtime Configuration

#-------------------------
NODE_ENV=development # development, production, test
TASK_HOME=D:/tasks/whisper/TranscriptHub/apps/backend # Backend root folder

#-------------------------

Database Configuration

#-------------------------
NODE_DB=mssql # Database type
DB_USER=DBNAME # Database username
DB_PASSWORD=DB_PASSWORD # Database password
DB_SERVER=SERVER_IP # Database server address 10.11.61.82
DB_PORT=1433 # Database server address
DB_NAME=AI_AP # Database name

#-------------------------

Service Endpoints

#-------------------------

Task Processing Service => This is your backend server location

TASK_SERVER=127.0.0.1 # Task processing server host
TASK_SERVER_PORT=3000 # Task server port

Download Service => This is your backend server location

DOWNLOAD_SERVER=127.0.0.1 # File download server host
DOWNLOAD_SERVER_PORT=3000 # Download server port

Notification Service => This is your frontend server location

NOTIFY_SERVER=127.0.0.1 # Notification server host
NOTIFY_SERVER_PORT=443 # Notification server port (SSL) raw: 443

#-------------------------

External Services

#-------------------------

Hugging Face

HF_TOKEN=your_hf_token # Hugging Face API token

#-------------------------

Python Environment

#-------------------------
PYTHON_HOME=C:/Users/ID/AppData/Local/Programs/Python/Python311 # Python environment path
PYTHON_BIN=C:/Users/ID/AppData/Local/Programs/Python/Python311/python.exe # Python binary location

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