Skip to content

[Bug]: error: 503, init() without a ready angular env #440

@MarkYan0428

Description

@MarkYan0428

Environment

- wechaty:0.10.7
- wechaty-puppet: 0.4.23
- wechaty-puppet-service: 0.8.10
- wechaty-plugin-contrib: 
- token type: padlocal|wxwork|xp
- the version of wechaty docker container: latest

Description

你好,按照以下脚本进行启动
docker run -ti `
    --name wechaty_puppet_service_token_gateway `
    --rm `
    -e WECHATY_LOG="info" `
    -e WECHATY_PUPPET="wechaty-puppet-wechat" `
    -e WECHATY_PUPPET_SERVER_PORT="8080" `
    -e WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_SERVER="true" `
    -e WECHATY_TOKEN="python-wechaty-3f153c73-c8d5-4b0e-9d74-7dd121d371c4" `
    -e WECHATY_PUPPET_SERVICE_ENDPOINT="127.0.0.1:8080" `
    -e WECHATY_PUPPET_SERVICE_TOKEN="python-wechaty-3f153c73-c8d5-4b0e-9d74-7dd121d371c4" `
    -p "8080:8080" `
    wechaty/wechaty:latest

编写了代码(如下面所示)进行测试,运行起来后,扫码报错,报错信息以下:
2025-11-04 21:42:29,215 - PuppetService - INFO - receive error info <{'gerror': '{"code":2,"details":"Error: execute proxyWechaty(init) error: 503, init() without a ready angular env\\n    at Bridge.inject (file:///wechaty/node_modules/wechaty-puppet-wechat/src/bridge.ts:356:15)\\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\\n    at async Bridge.onLoad (file:///wechaty/node_modules/wechaty-puppet-wechat/src/bridge.ts:214:7)","message":"execute proxyWechaty(init) error: 503, init() without a ready angular env","name":"Error","stack":"Error: execute proxyWechaty(init) error: 503, init() without a ready angular env\\n    at Bridge.inject (file:///wechaty/node_modules/wechaty-puppet-wechat/src/bridge.ts:356:15)\\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\\n    at async Bridge.onLoad (file:///wechaty/node_modules/wechaty-puppet-wechat/src/bridge.ts:214:7)"}'}>
2025-11-04 21:42:29,215 - WechatyPuppet.Schema.Base - WARNING - invalid fields: <['gerror']> to initialize type<<class 'wechaty_puppet.schemas.event.EventErrorPayload'>> which are should not be here, we suggest that you should post an issue to python-wechaty to fix this issue 
you should give these infos: 
* the version of wechaty: 			0.10.7
* the version of wechaty_puppet: 		0.4.23
* the version of wechaty_puppet_service: 	0.8.10
* the token type: <unkonwn> token 

Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001F2FEEE88B0>
Traceback (most recent call last):
  File "E:\Finance\python3.10\lib\asyncio\proactor_events.py", line 116, in __del__
  File "E:\Finance\python3.10\lib\asyncio\proactor_events.py", line 108, in close
  File "E:\Finance\python3.10\lib\asyncio\base_events.py", line 745, in call_soon
  File "E:\Finance\python3.10\lib\asyncio\base_events.py", line 510, in _check_closed
RuntimeError: Event loop is closed

Minimum reproducible code

class MyWechatBot(Wechaty):

def __init__(self):
    super().__init__()

# 处理信息
async def on_message(self, msg: Message) -> None:
    print('msg:', msg.text())

async def on_login(self, contact: Contact) -> None:
    print(f'user: {contact} has login')

async def on_scan(self, qr_code: str, status: ScanStatus,
                  data: Optional[str] = None) -> None:
    contact = self.Contact.load(self.contact_id)
    print(f'user <{contact}> scan status: {status.name} , '
          f'qr_code: {qr_code}')

async def main():
global bot
bot = MyWechatBot()
await bot.start()

asyncio.run(main())

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