Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

RECVD_MSG_API 连接失败 connect ECONNREFUSED ::1:3000 #244

Open
4 tasks done
brainkelly opened this issue Sep 28, 2024 · 2 comments
Open
4 tasks done

RECVD_MSG_API 连接失败 connect ECONNREFUSED ::1:3000 #244

brainkelly opened this issue Sep 28, 2024 · 2 comments

Comments

@brainkelly
Copy link

brainkelly commented Sep 28, 2024

提bug前先检查以下是否已经执行

  • 我已更新了最新版本的代码
  • 我已经仔细地阅读了readme 文档
  • 我已在FAQ里查找了可能寻找的答案
  • 我已经尝试搜索过历史关闭issue寻找可能的答案

bug描述

RECVD_MSG_API 设置为http://localhost:3000/receive/ , 扫码后提示链接失败 connect ECONNREFUSED ::1:3000,具体报错log见下文。
已经确认 http://localhost:3000/receive/ 已经处于监听状态,且post请求是有响应的

提供有用的信息

  • 目前使用的版本号:(很可能最新版本已经修复了)
    v2.8.0
  • 提供任何代码片段/日志/输出/截图 以便于帮助快速定位问题

docker 启动命令:

sudo docker run -d --name wxBotWebhook --restart unless-stopped -p 3000:3000 -p 3001:3001 -v ~/wxBot_logs:/app/log -e ACCEPT_RECVD_MSG_MYSELF=true -e RECVD_MSG_API=http://localhost:3000/receive/ -e LOGIN_API_TOKEN=123 dannicool/docker-wechatbot-webhook

报错log:

[2024-09-28T14:48:39.506] [INFO] - starting fetching api: http://localhost:3000/receive/
[2024-09-28T14:48:39.515] [ERROR] - Error occurred when trying to send Data to RecvdApi FetchError: request to http://localhost:3000/receive/ failed, reason: connect ECONNREFUSED ::1:3000
at ClientRequest. (/app/node_modules/.pnpm/[email protected]/node_modules/node-fetch-commonjs/index.js:2223:11)
at ClientRequest.emit (node:events:529:35)
at Socket.socketErrorListener (node:_http_client:501:9)
at Socket.emit (node:events:517:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: 'system',
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
erroredSysCall: 'connect'
}

@danni-cool
Copy link
Owner

danni-cool commented Oct 8, 2024

试试本机局域网地址

在 Docker 中,如果你在容器内请求 localhost(或 127.0.0.1),那么请求会被发送到容器本身,而不是主机(即你的本地电脑)。每个容器都有自己的网络栈,所以容器内的 localhost 指向的是容器内部

@hazzzzzy
Copy link

hazzzzzy commented Oct 18, 2024

启动项的接受消息处理地址设为http://host.docker.internal:3000/receive

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants