Skip to content
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

luci-app-dockerman missing main menu items #6885

Closed
Loafter opened this issue Feb 3, 2024 · 17 comments
Closed

luci-app-dockerman missing main menu items #6885

Loafter opened this issue Feb 3, 2024 · 17 comments

Comments

@Loafter
Copy link

Loafter commented Feb 3, 2024

luci-app-dockerman broken. It shows only the configuration button, and the full list appears only after reinstallation

to reproduce the bug:

  1. install luci-app-dockerman with depends
  2. check that after installation full menu available
    Annotation 2024-02-03 215940
  3. reboot router
    Now full menus is missing available only configuration
    Annotation 2024-02-03 220237
  4. remove luci-app-dockerman package
  5. install luci-app-dockerman package
  6. it appears again
  7. Annotation 2024-02-03 215940

DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='23.05.2'
DISTRIB_REVISION='r23630-842932a63d'
DISTRIB_TARGET='x86/64'
DISTRIB_ARCH='x86_64'
DISTRIB_DESCRIPTION='OpenWrt 23.05.2 r23630-842932a63d / LuCI openwrt-23.05 branch git-24.006.68745-9128656'

@systemcrash
Copy link
Contributor

Anyone with lua experience who can look at this? dockerman needs porting to js anyway.

@stokito
Copy link
Contributor

stokito commented Feb 27, 2024

Looks similar to #6280

@systemcrash before converting the dockerman to JS we should check and grab changes from upstream https://github.com/lisaac/luci-app-dockerman.

We may convert easily some parts but for other we'll need to call a lua script which is a shim for a Docker REST API. That may be resolved later, this is not critical to still have some non UI parts in Lua.

Basically I started from this task but there wasn't a good solution and I paused and switched to other tasks.

So if you'll have a desire to convert the dockerman to JS please let me know and I'll join. I have it somewhere in a middle of my TODO.

@systemcrash
Copy link
Contributor

Is ucode an option?

@stokito
Copy link
Contributor

stokito commented Feb 27, 2024

It should be possible to make in a plain shell. Still, that's not blocking to convert the UI to JS.

@tignioj
Copy link

tignioj commented Feb 28, 2024

Same issue.

@dannil
Copy link
Contributor

dannil commented Mar 17, 2024

When fixing #6998 I discovered that I was able to make the menu behave as before by installing dockerd on my host. I'm definitely not fluent in Lua but it looks like the code which configures the menus exits early if it can't contact either the remote or local socket. This may also be related to #6985 however, if my suspicion is correct, the solution would probably be to make the menus behave appropriately even if a socket connection can't be made instead of forcing dockerd to be a mandatory dependency (see discussion in that PR for more context).

local remote = luci.model.uci.cursor():get_bool("dockerd", "globals", "remote_endpoint")
if remote then
local host = luci.model.uci.cursor():get("dockerd", "globals", "remote_host")
local port = luci.model.uci.cursor():get("dockerd", "globals", "remote_port")
if not host or not port then
return
end
else
local socket = luci.model.uci.cursor():get("dockerd", "globals", "socket_path") or "/var/run/docker.sock"
if socket and not nixio.fs.access(socket) then
return
end
end
if (require "luci.model.docker").new():_ping().code ~= 200 then
return
end

@JKSTAFF
Copy link

JKSTAFF commented Mar 26, 2024

My guess is that the order of service startup and page loading may be causing the display error.
Here is my reproduce. After a normal system boot, when I could access the incomplete luci-dockerman, type docker command in console (take docker ps as an example ) reported this:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

So I waited for all containers to autostart, and then docker command returned to usable. At this time, I clear the luci cache under the tmp and now I can access the missing menu again through the subpath.

@flhofer
Copy link

flhofer commented Mar 29, 2024

Hi,
you can simply change the startup order by changing the priority in /etc/rc.d/

I, for example, set it to 45, before uhttpd at 50.
mv S99dockerd S45dockerd

Now it is visible again. Note that the priority in the web interface does not update. That might be because its generated at trigger only.

@JKSTAFF
Copy link

JKSTAFF commented Mar 29, 2024

Hi, you can simply change the startup order by changing the priority in /etc/rc.d/

Thank you for reply but I already tried that way (in my build it's nginx instead of httpd) and cause the same result.
I also changed dockerd start priority in /etc/init.d

@flhofer
Copy link

flhofer commented Mar 29, 2024

Hi @JKSTAFF

I also changed dockerd start priority in /etc/init.d

What do you mean by that?

Don't confuse init.d with rc.d. The latter sets the order and contains only symlinks to the scripts in init.d. The S or K stands for start or kill, and the 2-digit number is the order, where 99 is last. If you use nginx as server, you might check what order that is and change the number accordingly.

Let me know if you need further explanation

@JKSTAFF
Copy link

JKSTAFF commented Mar 29, 2024

Hi @flhofer Thank you for your patience and explanation. In my build modifying /etc/rc.d/S99dockerd lower than 60 takes precedence over nginx(S60).

I also changed dockerd start priority in /etc/init.d

I mean I also modified /etc/init.d/dockerd like this:

#!/bin/sh /etc/rc.common

USE_PROCD=1
START=99 → 50   ## I changed here

extra_command "uciadd" "<interface> <device> <zone> Add docker bridge configuration to network and firewall uci config"
..............

At least it doesn't work for me

@Loafter
Copy link
Author

Loafter commented Mar 29, 2024

Yep.
Guys look like this bug still appears. I have two x86 OpenWrt Host with latest 23.05.3 version and latest 24 luci-docker plugin. and one of this host display full menu items and second with missing menu items, difference only with count of container, with displayed have only one container and onother about 7 containers

@flhofer
Copy link

flhofer commented Mar 29, 2024

@Loafter @JKSTAFF, so it looks like if you have many containers to run at the start, the daemon is not responsive right away. In my case, it works as I have only two smaller containers. Maybe we need some autostart delay for dockerd's containers.

@Rategh
Copy link

Rategh commented Jun 16, 2024

I'm experiencing the same issue with OpenWrt on a Raspberry Pi. I only have one container running, and I'm using the latest versions of Docker and the Luci app.

@zxn10
Copy link

zxn10 commented Aug 18, 2024

I'm having the same issue. The dropdown menu appears inconsistently - sometimes it shows up, and other times it doesn't.

I don't believe it's related to the service start order. I ran docker ps and confirmed that all my containers are running fine. However, after restarting uhttps, the menu still didn't appear in Luci

@stokito
Copy link
Contributor

stokito commented Oct 8, 2024

The #6985 will fix this

@systemcrash
Copy link
Contributor

Closed by #6985

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants