-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Netman does not warn about missing docker installation #113
Comments
To clarify here, what took 5-6 seconds to open on your mac? Was it Neovim itself? Or the Netman neotree extension? I need to pin down where in the process netman hangs on this. |
Okay well, more details! With the main branch version of Netman had no problems. With the 1.1 version with Neotree extension had to wait 5 to 6 seconds to have it ready to go. When I discovered that Netman was searching for docker in the logs, I installed docker with brew and after that I got Neovim to open instantly. I don't know what is faulty, I just know that the actual release doesn't stop for docker availability, which v1.1 does with active neotree extension. No error or warn about missing docker was printed in someway on Neovim with main branch and 1.1 version. |
i can confirm the issue, as soon I try to add netman to neo-tree I get a freeze as soon I try to open neo-tree. (yes I don't have docker installed as well) |
That is interesting. When you open Neotree, the neotree driver reaches out to the API and fetches all available providers (seen here) I will investigate this a bit more to see if I can figure out why the API is returning docker when docker shouldn't be valid (in your case). Thank you both of you :) |
Ok so good news and more good news. I can recreate this issue using the below minimal configuration -- Minimal configuration
-- mini.lua
require("packer").startup(function(use)
use "wbthomason/packer.nvim"
use {
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
requires = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
}
}
use {
"miversen33/netman.nvim",
branch = "v1.1"
}
end)
vim.g.netman_log_level = 0
require("neo-tree").setup({
sources = {
"netman.ui.neo-tree"
}
}) Also attaching the logs for this. After a quick peek in, you can see the following lines in the logs
So everything is "working" as expected (docker indeed is failing to be found), and when you open neotree after the eternity it takes Netman to fail, you indeed do not see docker listed as a provider. The main issue it seems is that instead of |
can you maybe check if docker socket is connectable or something? |
I am (basically) doing that, albeit via I thought podman has an alias for |
Ok so I figured out what is going on here. The lua
As such, I grab both of these in the
If you check the docker provider init code, you will see that we are actually looking for non 0 exit code to verify that docker is not installed. IE, an exit code of 0 means docker is available. That logic is actually working correctly, the issue is actually a bit upstream. Because I am never checking to see if the PID returned by Except the job never started in the first place This can be proven with the following bit of simple code to verify local SHELL = require("netman.tools.shell")
local command = {"garbage_command_that_doesnt_exist"}
local shell = SHELL:new(command)
log({output = shell:run(200), pid = shell._pid}) This outputs the following log
Notice, pid is not valid here. So the fix should be simple enough, lets verify that the pid is valid instead of assuming it is. |
I tried the new branch you put up there on my WSL Ubuntu with no docker installed. Same configuration (Packer, Netman, Neotree). It opens up fast, problem solved. I now paste down there the logs.txt, few lines declaring the unexistence of docker on the machine (also which docker doesn't print nothing).
|
Its interesting that the log appears to check that twice within about 5 seconds, that seems wrong. However, I will consider that "ok" for the time being. I will also clean up the docker code a bit more to accept All in though, I think this solves it, I am going to merge the PR into v1.1 and then begin the fun of merge conflict resolution between my various branches on v1.1 🙃 😂 |
I have merged into v1.1 and deleted the test branch. @darrott be sure to remove that branch and switch back to whatever you were using before :) |
that was quick, thanks mike! |
Tried same config on a Linux machine with docker installed and Neovim with Netman (1.1) installed opened instantly. On my Mac (Air M2) it took like 5 to 6 seconds to open. Thanks to logs.txt I found out that Netman was trying to find docker unsuccessfully, but when Neovim finished loading no error/warn was given.
Platform: MacOS
Netman version: 1.1
Neotree installed and configured to work with Netman
The text was updated successfully, but these errors were encountered: