insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

Error thrown when installing plugins using snap-installed Insomnia

Open Ankhas opened this issue 2 years ago • 3 comments

Expected Behavior

Install a plugin is not resulting to an error and successfully install the desired plugin

Actual Behavior

When I'm trying to install a plugin from Preferences -> Plugins I get this error message:

image

Reproduction Steps

  1. Go to 'Preferences-Plugins'
  2. Enter "insomnia-plugin-usage-logger" (for example)
  3. Click on 'Install Plugin'

Is there an existing issue for this?

Additional Information

No response

Insomnia Version

2021.7.2

What operating system are you using?

Ubuntu

Operating System Version

20.04.1

Installation method

snap

Last Known Working Insomnia version

No response

Ankhas avatar Dec 16 '21 10:12 Ankhas

@Ankhas thank you for reporting this issue!

I was able to reproduce it as well on Kubuntu 21.10, example screenshot: Screenshot 2021-12-16 at 17 29 14

I was unable to reproduce it using Insomnia installed from .deb package on the same name, so perhaps @Ankhas you can try that as an alternative.

Leaving some more notes on how to reproduce: (In my case, Kubuntu, which is Ubuntu)

  1. Run snap find insomnia (optional)
  2. Run sudo snap install insomnia, wait for installation to finish
  3. Run snap run insomnia
  4. Open up preferences, switch to plugins tab
  5. Try to install insomnia-plugin-usage-logger

You should see an error like the one reported by @Ankhas:

Error: Yarn error /snap/insomnia/166/insomnia: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

    at file:///snap/insomnia/166/resources/app.asar/bundle.js:117470:16
    at ChildProcess.exithandler (child_process.js:319:5)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:443:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:674:12)

Wasn't able to reproduce on other systems, both on 2021.7.2 and previous 2021.6.0. Screenshot 2021-12-16 at 17 15 09

filfreire avatar Dec 16 '21 17:12 filfreire

Following issue seems to be still there. Any solution for this issue?

Dhavalc2012 avatar May 04 '22 13:05 Dhavalc2012

Error Installing Plugin in Insomnia

If you installed insomnia via snap, you will encounter this error if you try installing plugin. Screenshot from 2022-05-10 09-24-42

SOLUTION

Remove insomnia snap remove insomnia

Then

# Add to sources
echo "deb [trusted=yes arch=amd64] https://download.konghq.com/insomnia-ubuntu/ default all" \
    | sudo tee -a /etc/apt/sources.list.d/insomnia.list

# Refresh repository sources and install Insomnia
sudo apt-get update
sudo apt-get install insomnia

Nditah avatar May 10 '22 08:05 Nditah

be aware - removing the snap appeared to delete my working project (%HOME%/snap/insomnia)

warrenc5 avatar Nov 09 '22 02:11 warrenc5

@warrenc5 Yes you are right. From my understanding snap seems to have isolated environments and when you clean it, everything is purged. Perhaps taking backup may be the solution.

Dhavalc2012 avatar Nov 09 '22 03:11 Dhavalc2012

hi, I checked on the bug in the issue linked above. Here is my last comment with the root cause:


I do not know much about snap packages. It looks like the library is already contained. There is already one in the snap directory.

find /snap/insomnia/196/ | grep libnss3
/snap/insomnia/196/usr/lib/x86_64-linux-gnu/libnss3.so

I can see that the insomnia binary is looking in the wrong location. ldd gives me the following

ldd /snap/insomnia/196/insomnia | grep nss
	libnss3.so => /lib/x86_64-linux-gnu/libnss3.so (0x00007f8977434000)
	libnssutil3.so => /lib/x86_64-linux-gnu/libnssutil3.so (0x00007f8977403000)

My libnss3.so is in /usr/lib/x86_64-linux-gnu/libnss3.so and the snap one is in /snap/insomnia/196/usr/lib/x86_64-linux-gnu/libnss3.so. So the build process is messing up something since the executable looks in /lib/x86_64-linux-gnu/libnss3.so

lippertto avatar Apr 03 '23 12:04 lippertto

What is even stranger is that libnss3.so is found when I call the current insomnia version directly. So, calling /snap/bin/insomnia in a terminal gives the the error above. If i call /snap/insomnia/196/insomnia in the same terminal , I can install the plug-in without problems.

lippertto avatar Apr 03 '23 12:04 lippertto