awesome-wm-widgets icon indicating copy to clipboard operation
awesome-wm-widgets copied to clipboard

Docker widget attempt to call a nil value (method 'buttons')

Open DevonMorris opened this issue 4 years ago • 11 comments

I'm getting the following error trying to load the docker widget

docker.lua:353: attempt to call a nil value (method 'buttons')

It's strange because it worked on my laptop last night when I added the widget. When I transferred my dotfiles over to my desktop this morning, I encountered this issue just with the docker widget.

DevonMorris avatar Feb 20 '21 15:02 DevonMorris

Hm, I don't see anything suspicious there. Can you run the following command: docker container ls -a -s -n - is there anything wrong in the output? Can you share it? You can also comment lines 353-367 and see what happens, maybe there will be another, more useful log message.

streetturtle avatar Feb 20 '21 18:02 streetturtle

Here's the output, which looks fine.

CONTAINER ID   IMAGE                                                               COMMAND                  CREATED        STATUS                      PORTS     NAMES                      SIZE
75f4d3babc1a   local-x86_64-0_builder                                              "sleep infinity"         20 hours ago   Up 20 hours                           local-x86_64-0_builder_1   7.24MB (virtual 3.39GB)
17e013b41e4c   dog_dev_env                                                         "/ros_entrypoint.sh …"   45 hours ago   Exited (0) 44 hours ago               magical_mendel             69.8MB (virtual 7.35GB)
bcf5d7856cae   3f88974413a9                                                        "/ros_entrypoint.sh …"   45 hours ago   Exited (0) 45 hours ago               intelligent_goldberg       237kB (virtual 8.76GB)
1b026f7a95d4   docker.eng.torc.tech/ros_bridge_x86_64:v1.1.5                       "/entrypoint.sh rosl…"   46 hours ago   Up 46 hours                           rosbridge                  64.8kB (virtual 2.03GB)
45c93a6d371c   docker.eng.torc.tech/ocu_web_x86_64:allnutt_target-debug-speeds-3   "/bin/sh -c ./ocu"       46 hours ago   Up 46 hours                           ocu_web                    0B (virtual 934MB)
6c910d3115c1   3f88974413a9                                                        "/ros_entrypoint.sh …"   47 hours ago   Exited (100) 47 hours ago             goofy_northcutt            522MB (virtual 9.28GB)
7f22be860e6b   dog_dev_env                                                         "/ros_entrypoint.sh …"   47 hours ago   Exited (130) 47 hours ago             gallant_blackwell          1.21GB (virtual 8.49GB)
0c2df9fcb8c3   dog_dev_env                                                         "/ros_entrypoint.sh …"   2 days ago     Exited (0) 2 days ago                 nice_colden                237kB (virtual 7.28GB)
fa36c91ec9e6   dog_dev_env                                                         "/ros_entrypoint.sh …"   2 days ago     Exited (128) 2 days ago               gracious_blackwell         237kB (virtual 7.28GB)
6eb75727ae02   dog_dev_env                                                         "/ros_entrypoint.sh …"   2 days ago     Exited (1) 2 days ago                 practical_swirles          237kB (virtual 7.28GB)

And commenting those lines doesn't throw any error. It just leaves an unclickable docker widget in the bar.

DevonMorris avatar Feb 20 '21 18:02 DevonMorris

Here is the output of awesome --version in case it matters

awesome v4.3-895-g538586c1 (Too long)
 • Compiled against Lua 5.3.3 (running with Lua 5.3)
 • API level: 4
 • D-Bus support: yes
 • xcb-errors support: no
 • execinfo support: yes
 • xcb-randr version: 1.6
 • LGI version: 0.9.2
 • Transparency enabled: yes
 • Custom search paths: no

DevonMorris avatar Feb 20 '21 18:02 DevonMorris

Same error here on awesome v4.3-902-gaba1cf398-dirty.

SkyLeite avatar Mar 05 '21 13:03 SkyLeite

Could you please try the latest master. Maybe the issue was in the deprecated function (awful.util.table.join instead of gears.table.join), however I'm using the same version of awesome as you, and don't have this issue.

streetturtle avatar Mar 06 '21 01:03 streetturtle

I still have that issue being on commit https://github.com/streetturtle/awesome-wm-widgets/commit/9628b67801f79d98b6a2c5a9b90e3b3e439b69f5 and

$ awesome --version
awesome v4.3-1037-g149d18e0 (Too long)
 • Compiled against Lua 5.3.3 (running with Lua 5.3)
 • API level: 4
 • D-Bus support: yes
 • xcb-errors support: no
 • execinfo support: yes
 • xcb-randr version: 1.6
 • LGI version: 0.9.2
 • Transparency enabled: yes
 • Custom search paths: no 

gives me

error while running function!
stack traceback:
        ...nfig/awesome/awesome-wm-widgets/docker-widget/docker.lua:356: in function <...nfig/awesome/awesome-wm-widgets/docker-widget/docker.lua:90>
        (...tail calls...)
        /lhome/lindnfl/.config/awesome/rc.lua:570: in main chunk
error: ...nfig/awesome/awesome-wm-widgets/docker-widget/docker.lua:356: attempt to call a nil value (method 'buttons')
2021-06-02 16:00:14 W: awesome: a_glib_poll:471: Last main loop iteration took 0.282911 seconds! Increasing limit for this warning to that value.

rc.lua:570 is where the docker_widget() call is situated.

floli avatar Jun 02 '21 14:06 floli

Do you have more than one screen?

streetturtle avatar Jun 02 '21 14:06 streetturtle

Yes, that's correct. The machine has 3 screens plugged in. The bar I use the docker widget in has no screen parameter given, which makes it only appear one screen. (plan to change that later, but right how I am still playing around)

floli avatar Jun 02 '21 18:06 floli

Could you please try to instantiate widget before this line:

awful.screen.connect_for_each_screen(function(s)

and then use it in the wibox layout.

So it would look something like this:

local dw = docker_widget()
awful.screen.connect_for_each_screen(function(s)
...
    -- Add widgets to the wibox
    s.mywibox:setup {
....
                s.mytasklist, -- Middle widget
                { -- Right widgets
                    layout = wibox.layout.fixed.horizontal,
                    spacing = 8,
                    s.systray,
                    mykeyboardlayout,
                    dw,    <--- here

So in case of multiple screens there will be only on instance of docker widget.

streetturtle avatar Jul 18 '23 02:07 streetturtle

Maybe the same issue from https://github.com/streetturtle/awesome-wm-widgets/pull/373 ?

Aire-One avatar Jul 18 '23 11:07 Aire-One

Sorry, no change, still the same message.

I do not have the same line, but

local dw = docker_widget()

screen.connect_signal("request::desktop_decoration", function(s)
    -- Each screen has its own tag table.
    awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
  [...]
  -- use dw here

Error is docker.lua:372: attempts to call a nil value (method: 'buttons')

It happens even if I do not use dw.

floli avatar Jul 18 '23 12:07 floli