<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Longhorn on Luis Logs</title>
    <link>https://luislogs.com/categories/longhorn/</link>
    <description>Recent content in Longhorn on Luis Logs</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 14 Mar 2024 18:00:30 +0900</lastBuildDate><atom:link href="https://luislogs.com/categories/longhorn/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Fixing Longhorn error FailedMount - exit status 32</title>
      <link>https://luislogs.com/posts/fixing-longhorn-error-failedmount-exit-status-32/</link>
      <pubDate>Thu, 14 Mar 2024 18:00:30 +0900</pubDate>
      
      <guid>https://luislogs.com/posts/fixing-longhorn-error-failedmount-exit-status-32/</guid>
      <description>A couple of days ago I started facing Longhorn issues after rebooting all three nodes. For some reason my adguard deployment was stuck trying to mount the PV. I&amp;rsquo;m running my adguard deployment with RWX and this means it&amp;rsquo;s mounted over NFS.
Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedMount 45m (x3 over 56m) kubelet Unable to attach or mount volumes: unmounted volumes=[adguard-conf-pv adguard-work-pv], unattached volumes=[], failed to process volumes=[]: timed out waiting for the condition Warning FailedMount 16m (x23 over 61m) kubelet MountVolume.</description>
      <content:encoded><![CDATA[<p>A couple of days ago I started facing Longhorn issues after rebooting all three nodes. For some reason my adguard deployment was stuck trying to mount the PV. I&rsquo;m running my adguard deployment with RWX and this means it&rsquo;s mounted over NFS.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">Events:
</span></span><span class="line"><span class="cl">  Type     Reason       Age                 From     Message
</span></span><span class="line"><span class="cl">  ----     ------       ----                ----     -------
</span></span><span class="line"><span class="cl">  Warning  FailedMount  45m (x3 over 56m)   kubelet  Unable to attach or mount volumes: unmounted volumes=[adguard-conf-pv adguard-work-pv], unattached volumes=[], failed to process volumes=[]: timed out waiting for the condition
</span></span><span class="line"><span class="cl">  Warning  FailedMount  16m (x23 over 61m)  kubelet  MountVolume.MountDevice failed for volume &#34;adguard-work-pv&#34; : rpc error: code = Internal desc = mount failed: exit status 32
</span></span><span class="line"><span class="cl">Mounting command: /usr/local/sbin/nsmounter
</span></span><span class="line"><span class="cl">Mounting arguments: mount -t nfs -o vers=4.1,noresvport,intr,hard 10.43.20.191:/adguard-work-pv /var/lib/kubelet/plugins/kubernetes.io/csi/driver.longhorn.io/6c472e8b20509432a91f0d78010890b28fd5ebac0d9e85d0554ba7a69c9dccbd/globalmount
</span></span><span class="line"><span class="cl">Output: mount.nfs: Protocol not supported
</span></span><span class="line"><span class="cl">  Warning  FailedMount  6m50s (x21 over 61m)  kubelet  Unable to attach or mount volumes: unmounted volumes=[adguard-work-pv adguard-conf-pv], unattached volumes=[], failed to process volumes=[]: timed out waiting for the condition
</span></span><span class="line"><span class="cl">  Warning  FailedMount  67s (x31 over 62m)    kubelet  MountVolume.MountDevice failed for volume &#34;adguard-conf-pv&#34; : rpc error: code = Internal desc = mount failed: exit status 32
</span></span><span class="line"><span class="cl">Mounting command: /usr/local/sbin/nsmounter
</span></span><span class="line"><span class="cl">Mounting arguments: mount -t nfs -o vers=4.1,noresvport,intr,hard 10.43.25.161:/adguard-conf-pv /var/lib/kubelet/plugins/kubernetes.io/csi/driver.longhorn.io/e5cf370525e8a07eda18f130064a2fb3712c6f4668904245d8622230e3defd8e/globalmount
</span></span><span class="line"><span class="cl">Output: mount.nfs: Protocol not supported
</span></span></code></pre></div><p>At first I was having some doubt on the NFS package — if it got updated and started causing issues with Longhorn. But this wasn&rsquo;t the case. Googling online landed me to one github issue that was opened fairly recently (<a href="https://github.com/longhorn/longhorn/issues/6857">link here</a>). <a href="https://github.com/andrewheberle">andrewheberle</a> shared a comment about facing the same issue after upgrading the kernel to 5.15.0-94.</p>
<p><a href="https://www.kolide.com/features/checks/ubuntu-unattended-upgrades">https://www.kolide.com/features/checks/ubuntu-unattended-upgrades</a></p>
<p>Checking my apt history, it looks like Ubuntu upgraded automatically last 8th of February: <code>less /var/log/apt/history.log</code></p>
<p>
    <img src="/posts/fixing-longhorn-error-failedmount-exit-status-32/photos/apt_history.png" alt="">
  </p>
<p>This looks to be due to unattended upgrades that are enabled by default upon OS installation.</p>
<p>You can check this by executing: <code>cat /etc/apt/apt.conf.d/20auto-upgrades</code></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">APT::Periodic::Update-Package-Lists &#34;1&#34;;
</span></span><span class="line"><span class="cl">APT::Periodic::Unattended-Upgrade &#34;1&#34;;
</span></span></code></pre></div><p>In my case I disabled both updating of package list and unattended upgrades by changing the value from <strong>1</strong> to <strong>0</strong>.</p>
<p>Before we start the rollback, let&rsquo;s check the available linux kernel images with <code>dpkg -l | grep linux-image</code>. We should be able to see our target kernel version. In this case 5.15.0-92 should be there.</p>
<p>
    <img src="/posts/fixing-longhorn-error-failedmount-exit-status-32/photos/dpkg.png" alt="">
  </p>
<p>After verification then we can start uninstallation of the new kernel image. On the next reboot, the kernel should be running with the next latest available kernel version.</p>
<p>Refeferences:</p>
<ul>
<li><a href="https://www.geekersdigest.com/how-to-downgrade-to-a-lower-kernel-version-in-ubuntu-linux/">https://www.geekersdigest.com/how-to-downgrade-to-a-lower-kernel-version-in-ubuntu-linux/</a></li>
<li><a href="https://askubuntu.com/questions/1303568/downgrade-kernel-by-deleting-new-one-from-boot">https://askubuntu.com/questions/1303568/downgrade-kernel-by-deleting-new-one-from-boot</a></li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">sudo apt remove linux-headers-5.15.0-97-generic -y
</span></span><span class="line"><span class="cl">sudo apt remove linux-headers-5.15.0-97 linux-headers-5.15.0-97-generic linux-modules-5.15.0-97-generic linux-image-unsigned-5.15.0-97-generic -y
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">sudo apt remove linux-headers-5.15.0-94-generic -y
</span></span><span class="line"><span class="cl">sudo apt remove linux-headers-5.15.0-94 linux-headers-5.15.0-94-generic linux-modules-5.15.0-94-generic linux-image-unsigned-5.15.0-94-generic -y
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"># then reboot
</span></span><span class="line"><span class="cl">sudo shutdown -r now
</span></span></code></pre></div><p>
    <img src="/posts/fixing-longhorn-error-failedmount-exit-status-32/photos/apt_remove.png" alt="">
  </p>
<p>Post reboot check the version:
<code>uname -r</code></p>
<p>The longhorn volumes are also successfully mounted this time with no errors.</p>
<p>P.S. This known issue seems to be logged already in <a href="https://longhorn.io/kb/troubleshooting-rwx-volume-fails-to-attached-caused-by-protocol-not-supported/">this Longhorn KB article</a></p>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
