{"type":"rich","version":"1.0","provider_name":"phorkie","provider_url":"https:\/\/p.cweiske.de\/","title":"Specified native messaging host not found.","author_name":"Christian Weiske","cache_age":86400,"width":900,"height":900,"html":"<!-- embedding all files of https:\/\/p.cweiske.de\/145 -->\n<link rel=\"stylesheet\" href=\"https:\/\/p.cweiske.de\/css\/embed.css\"\/>\n<div class=\"phork\" id=\"145\">\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  \n<div class=\"document\">\n\n\n<p>I had the problem on Linux with Chromium:<\/p>\n<blockquote>\nSpecified native messaging host not found.<\/blockquote>\n<p>The reason for the problem was that I the native messaging host manifest file in <tt class=\"docutils literal\"><span class=\"pre\">\/etc\/opt\/chrome\/native-messaging-hosts\/<\/span><\/tt> and <tt class=\"docutils literal\"><span class=\"pre\">~\/.config\/google-chrome\/NativeMessagingHosts\/<\/span><\/tt> - but Chromium uses <tt class=\"docutils literal\">chromium<\/tt> instead of <tt class=\"docutils literal\"><span class=\"pre\">google-chrome<\/span><\/tt> as app config name.<\/p>\n<p>The error vanished when I used <tt class=\"docutils literal\"><span class=\"pre\">~\/.config\/chromium\/NativeMessagingHosts\/<\/span><\/tt>.<\/p>\n<\/div>\n\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/145\/rev-raw\/8123476751bd2fad25a68dbea34a337ea84026c9\/0 host-not-found.rst\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/145#0 host-not-found.rst\">0 host-not-found.rst<\/a>\n <\/div>\n<\/div>\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  \n<div class=\"document\">\n\n\n<p>After Chrome found the host, I got the following message:<\/p>\n<blockquote>\nError when communicating with the native messaging host.<\/blockquote>\n<p>Enabling debugging in chromium helped:<\/p>\n<pre class=\"literal-block\">\n$ chromium-browser --enable-logging --v=1 --enable-logging=stderr\n<\/pre>\n<p>With that I saw the real error message:<\/p>\n<blockquote>\nNative Messaging host tried sending a message that is 808 613 980 bytes long.<\/blockquote>\n<p>The problem was that I changed the native messaging script from <tt class=\"docutils literal\">bash<\/tt> to <tt class=\"docutils literal\">sh<\/tt>, but the message length output with <tt class=\"docutils literal\">sh<\/tt>'s <tt class=\"docutils literal\">printf<\/tt> did not work. I ended up using <tt class=\"docutils literal\">\/usr\/bin\/printf<\/tt> (the GNU version).<\/p>\n<\/div>\n\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/145\/rev-raw\/8123476751bd2fad25a68dbea34a337ea84026c9\/1 communication-error.rst\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/145#1 communication-error.rst\">1 communication-error.rst<\/a>\n <\/div>\n<\/div>\n<\/div>\n"}
