Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
34.37k stars 1.94k forks source link

Error thrown when installing plugins using snap-installed Insomnia #4316

Open Ankhas opened 2 years ago

Ankhas commented 2 years ago

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

filfreire commented 2 years ago

@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

Dhavalc2012 commented 2 years ago

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

Nditah commented 2 years ago

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
warrenc5 commented 1 year ago

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

Dhavalc2012 commented 1 year ago

@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.

lippertto commented 1 year ago

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 commented 1 year ago

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.