google / mozc

Mozc - a Japanese Input Method Editor designed for multi-platform
Other
2.4k stars 348 forks source link

IPC connection denied on start-up #881

Closed k0aaa closed 7 months ago

k0aaa commented 7 months ago

Description

On linux, with the latest commit and fcitx5, mozc claims that "互換性のない変換エンジンプログラムに接続しています" when being enabled. The log (at log level 0) reveals the following error messages:

kwin_wayland_wrapper[4816]: WARNING: All log messages before absl::InitializeLog() is called are written to STDERR kwin_wayland_wrapper[4816]: W0000 00:00:1709070134.528216 4816 unix_ipc.cc:277] connect failed: 接続を拒否されました kwin_wayland_wrapper[4816]: W0000 00:00:1709070134.528260 4816 unix_ipc.cc:277] connect failed: 接続を拒否されました kwin_wayland_wrapper[4816]: E0000 00:00:1709070134.528267 4816 client.cc:596] Connection failure to session kwin_wayland_wrapper[4816]: W0000 00:00:1709070134.528560 4816 unix_ipc.cc:277] connect failed: 接続を拒否されました kwin_wayland_wrapper[4816]: W0000 00:00:1709070134.528587 4816 unix_ipc.cc:277] connect failed: 接続を拒否されました kwin_wayland_wrapper[4816]: E0000 00:00:1709070134.528592 4816 client.cc:596] Connection failure to session kwin_wayland_wrapper[5490]: WARNING: All log messages before absl::InitializeLog() is called are written to STDERR kwin_wayland_wrapper[5490]: E0000 00:00:1709070134.530638 5490 tiny_storage.cc:131] the file is missing the header. kwin_wayland_wrapper[5490]: E0000 00:00:1709070134.530669 5490 registry.cc:73] cannot open registry kwin_wayland_wrapper[4816]: E0000 00:00:1709070134.729669 4816 message_lite.cc:124] Can't parse message of type "mozc.commands.Output" because it is missing required fields: engine_reload_response.status kwin_wayland_wrapper[4816]: E0000 00:00:1709070134.731103 4816 client.cc:709] Parse failure of the result of the request: kwin_wayland_wrapper[4816]: E0000 00:00:1709070134.731126 4816 client.cc:812] Call() failed kwin_wayland_wrapper[4816]: E0000 00:00:1709070134.731130 4816 client.cc:472] CheckVersionOrRestartServer() failed kwin_wayland_wrapper[4816]: E0000 00:00:1709070134.731136 4816 client.cc:201] CreateSession failed kwin_wayland_wrapper[4816]: E0000 00:00:1709070134.731140 4816 server_launcher.cc:245] OnFatal is called: 1 kwin_wayland_wrapper[4816]: E0000 00:00:1709070134.731321 4816 client.cc:374] EnsureSession failed kwin_wayland_wrapper[4816]: E0000 00:00:1709070134.731335 4816 client.cc:374] EnsureSession failed

If mozc enables when the desktop environment is starting up, it could crash the environment. (Happens with KDE wayland) Weirdly, mozc continues to function after the error message.

Commit: 8eddfbaaeb2ff64512f17e32eadef5c7cbac9457

Environment

Investigations

k0aaa commented 7 months ago

Information around where the issue occurs: (log level 1)

WARNING: All log messages before absl::InitializeLog() is called are written to STDERR I0000 00:00:1709071680.629835 3338 key_parser.cc:68] Init KeyParser Data I0000 00:00:1709071680.630049 3338 mozc_state.cc:59] MozcState created. I0000 00:00:1709071680.630110 3338 ipc_path_manager.cc:530] ClientIPCKey: 8b1fdbabc1345fed92d5eeb9a826448e I0000 00:00:1709071680.630113 3338 ipc_path_manager.cc:531] ProtocolVersion: 3 W0000 00:00:1709071680.630150 3338 unix_ipc.cc:277] connect failed: 接続を拒否されました I0000 00:00:1709071680.630163 3338 ipc_path_manager.cc:530] ClientIPCKey: 8b1fdbabc1345fed92d5eeb9a826448e I0000 00:00:1709071680.630165 3338 ipc_path_manager.cc:531] ProtocolVersion: 3 W0000 00:00:1709071680.630176 3338 unix_ipc.cc:277] connect failed: 接続を拒否されました E0000 00:00:1709071680.630179 3338 client.cc:596] Connection failure to session I0000 00:00:1709071680.630190 3338 unix_ipc.cc:302] connection closed (IPCClient destructed) I0000 00:00:1709071680.630305 3338 named_event.cc:263] NamedEventNotifier session is created I0000 00:00:1709071680.630759 3338 process.cc:226] posix_spawn: child pid is 4510 I0000 00:00:1709071680.630796 3338 ipc_path_manager.cc:530] ClientIPCKey: 8b1fdbabc1345fed92d5eeb9a826448e I0000 00:00:1709071680.630798 3338 ipc_path_manager.cc:531] ProtocolVersion: 3 W0000 00:00:1709071680.630809 3338 unix_ipc.cc:277] connect failed: 接続を拒否されました I0000 00:00:1709071680.630814 3338 ipc_path_manager.cc:530] ClientIPCKey: 8b1fdbabc1345fed92d5eeb9a826448e I0000 00:00:1709071680.630815 3338 ipc_path_manager.cc:531] ProtocolVersion: 3 W0000 00:00:1709071680.630821 3338 unix_ipc.cc:277] connect failed: 接続を拒否されました E0000 00:00:1709071680.630822 3338 client.cc:596] Connection failure to session I0000 00:00:1709071680.630826 3338 unix_ipc.cc:302] connection closed (IPCClient destructed) WARNING: All log messages before absl::InitializeLog() is called are written to STDERR E0000 00:00:1709071680.633946 4510 tiny_storage.cc:131] the file is missing the header. E0000 00:00:1709071680.633994 4510 registry.cc:73] cannot open registry I0000 00:00:1709071680.652657 4510 key_parser.cc:68] Init KeyParser Data I0000 00:00:1709071680.652985 4513 session_watch_dog.cc:116] Start sleeping 2m I0000 00:00:1709071680.831051 3338 server_launcher.cc:205] Mozc is launched successfully within 20s msec I0000 00:00:1709071680.831347 3338 ipc_path_manager.cc:530] ClientIPCKey: 4c533c9de1840ba05c23b7d604632173 I0000 00:00:1709071680.831363 3338 ipc_path_manager.cc:531] ProtocolVersion: 3 I0000 00:00:1709071680.831635 3338 ipc_path_manager.cc:408] server path: /usr/lib/mozc/mozc_server /usr/lib/mozc/mozc_server I0000 00:00:1709071680.831676 3338 unix_ipc.cc:159] 4 bytes sent I0000 00:00:1709071680.832463 4514 unix_ipc.cc:189] 4 bytes received I0000 00:00:1709071680.832599 4514 unix_ipc.cc:159] 2 bytes sent I0000 00:00:1709071680.832758 3338 unix_ipc.cc:189] 2 bytes received I0000 00:00:1709071680.832843 3338 unix_ipc.cc:331] Call succeeded I0000 00:00:1709071680.832888 3338 unix_ipc.cc:302] connection closed (IPCClient destructed) I0000 00:00:1709071680.833097 3338 unix_ipc.cc:159] 4 bytes sent I0000 00:00:1709071680.833293 4514 unix_ipc.cc:189] 4 bytes received I0000 00:00:1709071680.833363 4514 session_handler.cc:280] Getting config I0000 00:00:1709071680.834803 4514 character_form_manager.cc:702] CharacterFormManager::Clear() is called

yukawa commented 7 months ago

Reproduced a similar symptom on Windows 11.

Quick bisection in my local environment shows that this issue started happening from 34d479b73e3ed10196a488010f43abcdb54bd03a.

utuhiro78 commented 7 months ago
  • Whether this issue happens on both Ibus and other IMF (e.g. Fcitx, uim).

    • N/A

It happens on IBus and Fcitx5 (Arch Linux). c2fcbf6515c5884437977de46187c16a8cb7bb50 doesn't show the warnings.

phoepsilonix commented 7 months ago

The error was avoided by revert the following commit.

a81b563b80ee8be06c3f6527a7c4d1453ae32628 303b05b815a70a82159893b76de965aea4b7e64f f6f92e98b01e1c0e998779fb77e5f52ddbf2bf9a 34d479b73e3ed10196a488010f43abcdb54bd03a

git revert \
a81b563b80ee8be06c3f6527a7c4d1453ae32628 \
303b05b815a70a82159893b76de965aea4b7e64f \
f6f92e98b01e1c0e998779fb77e5f52ddbf2bf9a \
34d479b73e3ed10196a488010f43abcdb54bd03a \
--no-edit
hiroyuki-komatsu commented 7 months ago

Hi all, Thank you for the reports and investigations.

34d479b73e3ed10196a488010f43abcdb54bd03a is apparently the problematic change and 0c34a3f6c209a40eb3dfdf2edbef3077fd04e9fe is the fix of the issue.

phoepsilonix commented 7 months ago

I have confirmed that the SERVER_BROKEN_MESSAGE issue(34d479b73e3ed10196a488010f43abcdb54bd03a) has been resolved. Separately, the ibus-engine-mozc.log,mozc_renderer.log does not seem to break lines at the end of the sentence.

utuhiro78 commented 7 months ago

(https://github.com/google/mozc/commit/0c34a3f6c209a40eb3dfdf2edbef3077fd04e9fe) is the fix of the issue.

It works fine with Fcitx5. Thanks hiroyuki-komatsu and k0aaa !

k0aaa commented 7 months ago

Thank you all for your support! I have rebuilt mozc on my system with the latest commit.

Now mozc doesn't complain about incompatible engines anymore.

However, when I look at the logs, there is still a message about denied connections. Though it doesn't seem to be causing any imminent problems, as far as I can tell.

The log now looks like the following:

WARNING: All log messages before absl::InitializeLog() is called are written to STDERR W0000 00:00:1709118846.821850 3533 unix_ipc.cc:277] connect failed: 接続を拒否されました W0000 00:00:1709118846.821881 3533 unix_ipc.cc:277] connect failed: 接続を拒否されました E0000 00:00:1709118846.821883 3533 client.cc:596] Connection failure to session W0000 00:00:1709118846.822371 3533 unix_ipc.cc:277] connect failed: 接続を拒否されました W0000 00:00:1709118846.822388 3533 unix_ipc.cc:277] connect failed: 接続を拒否されました E0000 00:00:1709118846.822391 3533 client.cc:596] Connection failure to session WARNING: All log messages before absl::InitializeLog() is called are written to STDERR E0000 00:00:1709118846.825445 5033 tiny_storage.cc:131] the file is missing the header. E0000 00:00:1709118846.825495 5033 registry.cc:73] cannot open registry I2024-02-28 12:14:07.036449 addonmanager.cpp:195] Loaded addon mozc

So apparently the IPC connection is a separate issue from the incompatibility message one.

hiroyuki-komatsu commented 7 months ago

Thank you all for the confirmations.

phoepsilonix, would you create an issue? It'd be great if some actual output is attached.

k0aaa, would you confirm if Ibus-mozc has the same issue or not?

hiroyuki-komatsu commented 7 months ago

phoepsilonix, would you create an issue? It'd be great if some actual output is attached.

29672c60b2d316f57835ce95e5d8d8023f0d149e fixed the line break issue.

k0aaa commented 7 months ago

k0aaa, would you confirm if Ibus-mozc has the same issue or not?

The incompatible engine issue seems to be already resolved as aforementioned. As for the IPC connection denied message, there aren't any side-effects other than that error message in the fcitx5 logs, and I might need some help as I can't locate any ibus logs. (It doesn't seem to log to journalctl as verbosely as fcitx5 does, if it does log thereto at all.)

Side by side, I wonder if we should close the issue for now, as it doesn't appear to be very much significant at this point.

yukawa commented 7 months ago

Side by side, I wonder if we should close the issue for now, as it doesn't appear to be very much significant at this point.

+1 to close this for now. Regarding IPC connection denied message, we recently switched (c77285efa096e6e400cacffbcded980d24c5b17f) from Mozc's house-made glog clone to Abseil's logging library. It might have changed what's actually logged to the file, even though the actual behavior itself remained the same.