<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed><type>rich</type><version>1.0</version><provider_name>phorkie</provider_name><provider_url>https://p.cweiske.de/</provider_url><title>Specified native messaging host not found.</title><author_name>Christian Weiske</author_name><cache_age>86400</cache_age><width>900</width><height>900</height><html>&lt;!-- embedding all files of https://p.cweiske.de/145 --&gt;
&lt;link rel="stylesheet" href="https://p.cweiske.de/css/embed.css"/&gt;
&lt;div class="phork" id="145"&gt;
    &lt;div class="phork-file"&gt;
 &lt;div class="phork-content"&gt;
  
&lt;div class="document"&gt;


&lt;p&gt;I had the problem on Linux with Chromium:&lt;/p&gt;
&lt;blockquote&gt;
Specified native messaging host not found.&lt;/blockquote&gt;
&lt;p&gt;The reason for the problem was that I the native messaging host manifest file in &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;/etc/opt/chrome/native-messaging-hosts/&lt;/span&gt;&lt;/tt&gt; and &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;~/.config/google-chrome/NativeMessagingHosts/&lt;/span&gt;&lt;/tt&gt; - but Chromium uses &lt;tt class="docutils literal"&gt;chromium&lt;/tt&gt; instead of &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;google-chrome&lt;/span&gt;&lt;/tt&gt; as app config name.&lt;/p&gt;
&lt;p&gt;The error vanished when I used &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;~/.config/chromium/NativeMessagingHosts/&lt;/span&gt;&lt;/tt&gt;.&lt;/p&gt;
&lt;/div&gt;

 &lt;/div&gt;
 &lt;div class="phork-meta"&gt;
  &lt;a href="https://p.cweiske.de/145/rev-raw/8123476751bd2fad25a68dbea34a337ea84026c9/0 host-not-found.rst" style="float: right"&gt;view raw source&lt;/a&gt;
  &lt;a href="https://p.cweiske.de/145#0 host-not-found.rst"&gt;0 host-not-found.rst&lt;/a&gt;
 &lt;/div&gt;
&lt;/div&gt;
    &lt;div class="phork-file"&gt;
 &lt;div class="phork-content"&gt;
  
&lt;div class="document"&gt;


&lt;p&gt;After Chrome found the host, I got the following message:&lt;/p&gt;
&lt;blockquote&gt;
Error when communicating with the native messaging host.&lt;/blockquote&gt;
&lt;p&gt;Enabling debugging in chromium helped:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ chromium-browser --enable-logging --v=1 --enable-logging=stderr
&lt;/pre&gt;
&lt;p&gt;With that I saw the real error message:&lt;/p&gt;
&lt;blockquote&gt;
Native Messaging host tried sending a message that is 808 613 980 bytes long.&lt;/blockquote&gt;
&lt;p&gt;The problem was that I changed the native messaging script from &lt;tt class="docutils literal"&gt;bash&lt;/tt&gt; to &lt;tt class="docutils literal"&gt;sh&lt;/tt&gt;, but the message length output with &lt;tt class="docutils literal"&gt;sh&lt;/tt&gt;'s &lt;tt class="docutils literal"&gt;printf&lt;/tt&gt; did not work. I ended up using &lt;tt class="docutils literal"&gt;/usr/bin/printf&lt;/tt&gt; (the GNU version).&lt;/p&gt;
&lt;/div&gt;

 &lt;/div&gt;
 &lt;div class="phork-meta"&gt;
  &lt;a href="https://p.cweiske.de/145/rev-raw/8123476751bd2fad25a68dbea34a337ea84026c9/1 communication-error.rst" style="float: right"&gt;view raw source&lt;/a&gt;
  &lt;a href="https://p.cweiske.de/145#1 communication-error.rst"&gt;1 communication-error.rst&lt;/a&gt;
 &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</html></oembed>
