重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 9|回复: 1
打印 上一主题 下一主题

[服务应用] linux 下hermes开启gateway自启动报:Failed to connect to bus: No medium found

[复制链接]
跳转到指定楼层
楼主
发表于 6 天前 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
问题:
zq@hermes:~$ loginctl enable-linger $(whoami)

zq@hermes:~$ systemctl --user enable hermes-gateway
Failed to connect to bus: No medium found


原因:
     SSH 远程 session 缺少 D-Bus 环境变量


解决办法:

export XDG_RUNTIME_DIR=/run/user/1000
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus

zq@hermes:~$ systemctl --user enable hermes-gateway
Created symlink /home/zq/.config/systemd/user/default.target.wants/hermes-gateway.service → /home/zq/.config/systemd/user/hermes-gateway.service.


验证:
  zq@hermes:~$ hermes gateway status
  Warning: OPENROUTER_API_KEY contained 7 non-ASCII characters (U+66FF ('替'), U+6362 ('换'), U+6210 ('成')) — stripped so the key can be sent as an HTTP header.
  This usually means the key was copy-pasted from a PDF, rich-text editor, or web page that substituted lookalike
  Unicode glyphs for ASCII letters. If authentication fails (e.g. "API key not valid"), re-copy the key from the
  provider's dashboard and run `hermes setup` (or edit the .env file in a plain-text editor).
● hermes-gateway.service - Hermes Agent Gateway - Messaging Platform Integration
     Loaded: loaded (/home/zq/.config/systemd/user/hermes-gateway.service; enabled; preset: enabled)
     Active: active (running) since Fri 2026-05-01 10:09:46 UTC; 24min ago
   Main PID: 3732 (python)
      Tasks: 11 (limit: 9374)
     Memory: 487.6M (peak: 493.9M)
        CPU: 18.418s
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/hermes-gateway.service
             └─3732 /home/zq/.hermes/hermes-agent/venv/bin/python -m hermes_cli.main gateway run --replace

May 01 10:34:16 hermes python[3732]:   File "/home/zq/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/lib/python3.11/asyncio/base_events.py", line 1936, in _run_once
May 01 10:34:16 hermes python[3732]:     handle._run()
May 01 10:34:16 hermes python[3732]:   File "/home/zq/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/lib/python3.11/asyncio/events.py", line 84, in _run
May 01 10:34:16 hermes python[3732]:     self._context.run(self._callback, *self._args)
May 01 10:34:16 hermes python[3732]:   File "/home/zq/.hermes/hermes-agent/gateway/platforms/dingtalk.py", line 279, in _run_stream
May 01 10:34:16 hermes python[3732]:     await self._stream_client.start()
May 01 10:34:16 hermes python[3732]:   File "/home/zq/.hermes/hermes-agent/venv/lib/python3.11/site-packages/dingtalk_stream/stream.py", line 89, in start
May 01 10:34:16 hermes python[3732]:     self.logger.exception('unknown exception', e)
May 01 10:34:16 hermes python[3732]: Message: 'unknown exception'
May 01 10:34:16 hermes python[3732]: Arguments: (TypeError("'coroutine' object does not support the asynchronous context manager protocol"),)
✓ User gateway service is running
✓ Systemd linger is enabled (service survives logout)


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

沙发
 楼主| 发表于 6 天前 | 只看该作者
以上在 ubuntu 24.4,rhel 10.1 上验证过。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2026-5-7 00:34 , Processed in 0.219031 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表