openlens-node-pod-menu icon indicating copy to clipboard operation
openlens-node-pod-menu copied to clipboard

Menu items not available after enabling

Open pmbsa opened this issue 2 years ago • 15 comments

Hi, thank you for this addon, I was wondering if anybody has seen an issue where the addon is installed and enabled but we get no additional options for pod logs etc, only the default openlens options?

I had to install it via the tar download, no direct access to github but it installed fine and enabled fine.

thanks Paul

pmbsa avatar Mar 21 '23 15:03 pmbsa

I believe its probably down to the restricted internet access again. Fro developer view I can see the error below, looks like it needs to get out to download some stuff and I dont think it can. I have configured OL to use our proxy but the settings dont cater for requiring authentication so I suspect its failing

BrowserConsole.js:47 [EXTENSIONS-LOADER]: can't load renderer for "@alebcay/openlens-node-pod-menu": Error: Cannot find module 'C:\Users\8798238\AppData\Roaming\OpenLens\node_modules\@alebcay\openlens-node-pod-menu\dist\renderer.js'
Require stack:
- electron/js2c/renderer_init
    at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
    at i._resolveFilename (node:electron/js2c/renderer_init:33:1095)
    at Module._load (node:internal/modules/cjs/loader:785:27)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at i._load (node:electron/js2c/renderer_init:33:356)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at ExtensionLoader.requireExtension (https://1f3515d….lens.app:59766/build/lens.js?5a1bf22…:542270:20)
    at https://1f3515d….lens.app:59766/build/lens.js?5a1bf22…:542222:53
    at Array.map (<anonymous>) 

pmbsa avatar Mar 21 '23 15:03 pmbsa

Happened here, the same exception. But after a hard refresh (cmd+R) started working again 🤷.

alexeyatbluescape avatar Apr 02 '23 22:04 alexeyatbluescape

The same here, OpenLens 6.4.15, behind proxy, had to install using TGZ file. The same error as above, hard refresh did not help.

slavong avatar May 09 '23 08:05 slavong

I got the same problem. In my case, it seems to be that OpenLens is looking for the extension code in a different place, than where the extension was installed, from OpenLens GUI.

Installed: ~/.var/app/dev.k8slens.OpenLens/.k8slens/extensions/alebcay--openlens-node-pod-menu

Expected: ~/.var/app/dev.k8slens.OpenLens/config/OpenLens/node_modules/@alebcay

By copying the files to the expected folder, it started working.

brpaz avatar May 13 '23 08:05 brpaz

Thank you very much @brpaz, that helped me solve this same issue. Here's how I solved it for myself using @brpaz's advice.

I opened up Dev Tools in OpenLens to check what error was being thrown.

I saw that it was failing to find the plugin NPM package files in the location, which in my case was $HOME/.config/OpenLens/node_modules since I am on Ubuntu 23.04.

So I opened up a bash prompt at $HOME/.config/OpenLens and ran the following command:

npm install @alebcay/openlens-node-pod-menu

That fixed the issue and now I have the long-missing Pod menu in OpenLens.

UmarFKhawaja avatar May 16 '23 22:05 UmarFKhawaja

Thanks everyone for the info. Can someone please open an issue upstream for this? From what has been presented so far, this looks like an issue with the extension loading and installation process within Lens itself (this extension does not, for instance, dictate the npm command listed above as a workaround, or control the path into which it is installed).

Upstream may also ask for other information in the issue description, hence why I would appreciate if someone who has run into the issue to report there; I have not been able to reproduce this locally and am missing parts of what they're asking for.

alebcay avatar May 18 '23 02:05 alebcay

We had the same problem. This worked for us under MacOS:

  • Install the extension with the UI (note: it will install "forever")
  • Wait for 1 or 2 minutes and then close OpenLens
  • Execute on Terminal to create a symlink:
mkdir ~/Library/Application\ Support/OpenLens/node_modules/\@alebcay

ln -s ~/.k8slens/extensions/alebcay--openlens-node-pod-menu ~/Library/Application\ Support/OpenLens/node_modules/\@alebcay/openlens-node-pod-menu 
  • Start OpenLens again
  • Enable the extension if necessary

mfriess2 avatar Jul 04 '23 10:07 mfriess2

same problem here, installed on windows :

debug :

BrowserConsole.js:47 [EXTENSIONS-LOADER]: can't load renderer for "@alebcay/openlens-node-pod-menu": Error: Cannot find module 'C:\Users\xxxxxxxx\AppData\Roaming\OpenLens\node_modules\@alebcay\openlens-node-pod-menu\dist\renderer.js'
Require stack:
- electron/js2c/renderer_init
    at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
    at i._resolveFilename (node:electron/js2c/renderer_init:33:1095)
    at Module._load (node:internal/modules/cjs/loader:785:27)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at i._load (node:electron/js2c/renderer_init:33:356)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at ExtensionLoader.requireExtension (https://0db381312a321e2d62459b2eb7f4dbee.lens.app:37052/build/OpenLens.js?d8e99657584b2f5b7773:488590:20)
    at https://0db381312a321e2d62459b2eb7f4dbee.lens.app:37052/build/OpenLens.js?d8e99657584b2f5b7773:488542:53
    at Array.map (<anonymous>) {extension: {…}}

so i tried to find a renderer.js file in the .tar but there is not this file there is the file renderer.tsx i renamed .js and put in a dist directory i created : C:\Users\xxxxxxxx\AppData\Roaming\OpenLens\node_modules@alebcay\openlens-node-pod-menu\dist
but it didn't work

why is there no "renderer.js" file while the logs request it ?

Awot83 avatar Jul 18 '23 15:07 Awot83

It sounds like you are trying to download/use the source files from this repository, which is uncompiled TypeScript. The build process converts this into plain JavaScript which OpenLens consumes as a plugin.

You can see that the version pushed to npm contains the renderer.js:

$ curl "https://registry.npmjs.org/@alebcay/openlens-node-pod-menu/-/openlens-node-pod-menu-0.1.2.tgz" | tar tzf -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4456  100  4456    0     0   9958      0 --:--:-- --:--:-- --:--:-- 10104
package/LICENSE
package/dist/renderer.js
package/package.json
package/README.md

Installing by providing the package name to OpenLens should from npmjs and thus contain the expected files.

alebcay avatar Jul 19 '23 12:07 alebcay

thanks, it works perfectly now with the tgz you send

Awot83 avatar Jul 19 '23 12:07 Awot83

Success: Installation works perfectly (for me on a Mac) if I install using "@albecay/openlens-node-pod-menu"

If instead I give the URL to the .tgz or select the downloaded .tgz in the file system, OpenLens claims that the installation was successful, but the Status flickers rapidly(!) back and forth between Enabled/Disabled until I restart OpenLens. After restarting, the Status is then steady (Enabled), but the menus still do not show up, and none of the solutions shown above make any difference. Attempting to uninstall did not remove the extension, and I had to edit various json files to truly uninstall the extension before I could install using the '@'-reference.

I hope this helps someone :)

kuschuermann avatar Aug 24 '23 14:08 kuschuermann

I had same issue: windows without github acces and OpenLens 6.5.2-366 without logs button.

I was download https://github.com/alebcay/openlens-node-pod-menu/archive/refs/tags/v0.1.2.tar.gz, unpack it and install from Extention page. Nothing was change :) Than I was download https://registry.npmjs.org/@alebcay/openlens-node-pod-menu/-/openlens-node-pod-menu-0.1.2.tgz and copy "dist" folder from it in c:\Users%USER%\AppData\Roaming\OpenLens\node_modules\alebcay\openlens-node-pod-menu

Restart OpenLens - and works!

altsgamer avatar Sep 08 '23 14:09 altsgamer

uninstall and then reinstalling fixed this for me

marafa-sugarcrm avatar Oct 04 '23 16:10 marafa-sugarcrm

On Windows: For me, it looks like it was creating either a symbolic link or a shortcut. When I recreated the folder and copied the contents over, it started working. Here's what my folder looked like: image The second folder is the "original". The one with the correct name is the one I created manually.

rakker91 avatar Oct 09 '23 19:10 rakker91

On Windows doesn't seem to work here. The extensions were "installed" and green, but no button. I went into c:\Users%USER%\AppData\Roaming\OpenLens\node_modules\ and followed @rakker91 advice of renaming the shortcut, creating a folder and copying files into it, then deleting the shortcut, and now I open lens and the extension menu is empty.

This could definitely be improved.

Dunge avatar Nov 07 '23 22:11 Dunge