mKeRix/ansible-playbooks

Ansible install Failed to get capabilities of file '/usr/bin/node'

wtangofoxtrot opened this issue · 6 comments

Describe the bug
Unable to install via ansible on rpi4 nodes that are running raspios bulleye, keep getting the error. Running ansible from OSx on RPI4s

TASK [room-assistant : Set node capabilities] ****************************************************************************************************************************************************************************
fatal: [pi-downstairs.local]: FAILED! => {"changed": false, "msg": "Unable to get capabilities of /usr/bin/node", "stderr": "Failed to get capabilities of file '/usr/bin/node' (Operation not supported)\n", "stderr_lines": ["Failed to get capabilities of file '/usr/bin/node' (Operation not supported)"], "stdout": "", "stdout_lines": []}

To reproduce
install on rpi running raspbian desktop Debian GNU/Linux 11 (bullseye), not having this issues with pi's runnnig bullseye with raspbian lite

Relevant logs
Log output that correlates to the bug. You can get debug output with room-assistant -v.
ansible logs:


PLAY [all] ***************************************************************************************************************************************************************************************************************
Thursday 07 April 2022  22:24:40 -0700 (0:00:00.028)       0:00:00.028 ********
Thursday 07 April 2022  22:24:40 -0700 (0:00:00.027)       0:00:00.027 ********

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************
ok: [pi-downstairs.local]
Thursday 07 April 2022  22:24:49 -0700 (0:00:08.927)       0:00:08.956 ********
Thursday 07 April 2022  22:24:49 -0700 (0:00:08.927)       0:00:08.955 ********

TASK [Stop room-assistant service] ***************************************************************************************************************************************************************************************
fatal: [pi-downstairs.local]: FAILED! => {"changed": false, "msg": "Could not find the requested service room-assistant: host"}
...ignoring
Thursday 07 April 2022  22:24:51 -0700 (0:00:02.063)       0:00:11.020 ********
Thursday 07 April 2022  22:24:51 -0700 (0:00:02.063)       0:00:11.019 ********

TASK [nodejs : Download NodeJS] ******************************************************************************************************************************************************************************************
skipping: [pi-downstairs.local]
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.029)       0:00:11.050 ********
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.029)       0:00:11.049 ********
[WARNING]: flush_handlers task does not support when conditional
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.008)       0:00:11.058 ********
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.008)       0:00:11.058 ********

TASK [nodejs : Add npm module binaries to PATH] **************************************************************************************************************************************************************************
skipping: [pi-downstairs.local]
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.031)       0:00:11.090 ********
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.031)       0:00:11.089 ********

TASK [geerlingguy.nodejs : Set up the Nodesource RPM directory.] *********************************************************************************************************************************************************
skipping: [pi-downstairs.local]
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.031)       0:00:11.122 ********
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.031)       0:00:11.121 ********

TASK [geerlingguy.nodejs : Import Nodesource RPM key (CentOS < 7).] ******************************************************************************************************************************************************
skipping: [pi-downstairs.local]
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.033)       0:00:11.156 ********
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.033)       0:00:11.155 ********

TASK [geerlingguy.nodejs : Import Nodesource RPM key (CentOS 7+).] *******************************************************************************************************************************************************
skipping: [pi-downstairs.local]
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.037)       0:00:11.193 ********
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.037)       0:00:11.193 ********

TASK [geerlingguy.nodejs : Add Nodesource repositories for Node.js (CentOS < 7).] ****************************************************************************************************************************************
skipping: [pi-downstairs.local]
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.043)       0:00:11.237 ********
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.043)       0:00:11.236 ********

TASK [geerlingguy.nodejs : Add Nodesource repositories for Node.js (CentOS 7+).] *****************************************************************************************************************************************
skipping: [pi-downstairs.local]
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.037)       0:00:11.274 ********
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.036)       0:00:11.273 ********

TASK [geerlingguy.nodejs : Ensure Node.js AppStream module is disabled (CentOS 8+).] *************************************************************************************************************************************
skipping: [pi-downstairs.local]
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.041)       0:00:11.315 ********
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.041)       0:00:11.315 ********

TASK [geerlingguy.nodejs : Ensure Node.js and npm are installed.] ********************************************************************************************************************************************************
skipping: [pi-downstairs.local]
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.041)       0:00:11.357 ********
Thursday 07 April 2022  22:24:51 -0700 (0:00:00.041)       0:00:11.357 ********

TASK [geerlingguy.nodejs : Ensure dependencies are present.] *************************************************************************************************************************************************************
ok: [pi-downstairs.local]
Thursday 07 April 2022  22:24:56 -0700 (0:00:04.551)       0:00:15.909 ********
Thursday 07 April 2022  22:24:56 -0700 (0:00:04.551)       0:00:15.909 ********

TASK [geerlingguy.nodejs : Add Nodesource apt key.] **********************************************************************************************************************************************************************
ok: [pi-downstairs.local]
Thursday 07 April 2022  22:25:00 -0700 (0:00:04.584)       0:00:20.494 ********
Thursday 07 April 2022  22:25:00 -0700 (0:00:04.584)       0:00:20.493 ********

TASK [geerlingguy.nodejs : Add NodeSource repositories for Node.js.] *****************************************************************************************************************************************************
ok: [pi-downstairs.local] => (item=deb https://deb.nodesource.com/node_14.x bullseye main)
ok: [pi-downstairs.local] => (item=deb-src https://deb.nodesource.com/node_14.x bullseye main)
Thursday 07 April 2022  22:25:04 -0700 (0:00:04.170)       0:00:24.664 ********
Thursday 07 April 2022  22:25:04 -0700 (0:00:04.170)       0:00:24.663 ********

TASK [geerlingguy.nodejs : Update apt cache if repo was added.] **********************************************************************************************************************************************************
skipping: [pi-downstairs.local]
Thursday 07 April 2022  22:25:04 -0700 (0:00:00.037)       0:00:24.702 ********
Thursday 07 April 2022  22:25:04 -0700 (0:00:00.037)       0:00:24.701 ********

TASK [geerlingguy.nodejs : Ensure Node.js and npm are installed.] ********************************************************************************************************************************************************
ok: [pi-downstairs.local]
Thursday 07 April 2022  22:25:09 -0700 (0:00:04.710)       0:00:29.413 ********
Thursday 07 April 2022  22:25:09 -0700 (0:00:04.711)       0:00:29.412 ********

TASK [geerlingguy.nodejs : Define nodejs_install_npm_user] ***************************************************************************************************************************************************************
ok: [pi-downstairs.local]
Thursday 07 April 2022  22:25:09 -0700 (0:00:00.055)       0:00:29.468 ********
Thursday 07 April 2022  22:25:09 -0700 (0:00:00.055)       0:00:29.467 ********

TASK [geerlingguy.nodejs : Create npm global directory] ******************************************************************************************************************************************************************
ok: [pi-downstairs.local]
Thursday 07 April 2022  22:25:10 -0700 (0:00:01.086)       0:00:30.554 ********
Thursday 07 April 2022  22:25:10 -0700 (0:00:01.086)       0:00:30.553 ********

TASK [geerlingguy.nodejs : Add npm_config_prefix bin directory to global $PATH.] *****************************************************************************************************************************************
ok: [pi-downstairs.local]
Thursday 07 April 2022  22:25:13 -0700 (0:00:02.293)       0:00:32.848 ********
Thursday 07 April 2022  22:25:13 -0700 (0:00:02.293)       0:00:32.847 ********

TASK [geerlingguy.nodejs : Ensure npm global packages are installed.] ****************************************************************************************************************************************************
Thursday 07 April 2022  22:25:13 -0700 (0:00:00.030)       0:00:32.878 ********
Thursday 07 April 2022  22:25:13 -0700 (0:00:00.030)       0:00:32.878 ********

TASK [geerlingguy.nodejs : Install packages defined in a given package.json.] ********************************************************************************************************************************************
skipping: [pi-downstairs.local]
Thursday 07 April 2022  22:25:13 -0700 (0:00:00.087)       0:00:32.966 ********
Thursday 07 April 2022  22:25:13 -0700 (0:00:00.087)       0:00:32.966 ********

TASK [room-assistant : Install system dependencies] **********************************************************************************************************************************************************************
ok: [pi-downstairs.local]
Thursday 07 April 2022  22:25:22 -0700 (0:00:09.692)       0:00:42.659 ********
Thursday 07 April 2022  22:25:22 -0700 (0:00:09.692)       0:00:42.658 ********

TASK [room-assistant : Install room-assistant] ***************************************************************************************************************************************************************************
changed: [pi-downstairs.local]
Thursday 07 April 2022  22:26:03 -0700 (0:00:41.034)       0:01:23.693 ********
Thursday 07 April 2022  22:26:03 -0700 (0:00:41.034)       0:01:23.693 ********

TASK [room-assistant : Install peer dependencies] ************************************************************************************************************************************************************************
Thursday 07 April 2022  22:26:03 -0700 (0:00:00.030)       0:01:23.724 ********
Thursday 07 April 2022  22:26:03 -0700 (0:00:00.030)       0:01:23.723 ********

TASK [room-assistant : Find NodeJS] **************************************************************************************************************************************************************************************
ok: [pi-downstairs.local]
Thursday 07 April 2022  22:26:04 -0700 (0:00:00.932)       0:01:24.657 ********
Thursday 07 April 2022  22:26:04 -0700 (0:00:00.933)       0:01:24.656 ********

TASK [room-assistant : Set node capabilities] ****************************************************************************************************************************************************************************
fatal: [pi-downstairs.local]: FAILED! => {"changed": false, "msg": "Unable to get capabilities of /usr/bin/node", "stderr": "Failed to get capabilities of file '/usr/bin/node' (Operation not supported)\n", "stderr_lines": ["Failed to get capabilities of file '/usr/bin/node' (Operation not supported)"], "stdout": "", "stdout_lines": []}

PLAY RECAP ***************************************************************************************************************************************************************************************************************
pi-downstairs.local        : ok=12   changed=1    unreachable=0    failed=1    skipped=13   rescued=0    ignored=1

Playbook run took 0 days, 0 hours, 1 minutes, 26 seconds
Thursday 07 April 2022  22:26:06 -0700 (0:00:01.373)       0:01:26.030 ********
===============================================================================
room-assistant : Install room-assistant -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 41.03s
room-assistant : Install system dependencies ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 9.69s
Gathering Facts --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 8.93s
geerlingguy.nodejs : Ensure Node.js and npm are installed. -------------------------------------------------------------------------------------------------------------------------------------------------------- 4.71s
geerlingguy.nodejs : Add Nodesource apt key. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4.58s
geerlingguy.nodejs : Ensure dependencies are present. ------------------------------------------------------------------------------------------------------------------------------------------------------------- 4.55s
geerlingguy.nodejs : Add NodeSource repositories for Node.js. ----------------------------------------------------------------------------------------------------------------------------------------------------- 4.17s
geerlingguy.nodejs : Add npm_config_prefix bin directory to global $PATH. ----------------------------------------------------------------------------------------------------------------------------------------- 2.29s
Stop room-assistant service --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.06s
room-assistant : Set node capabilities ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1.37s
geerlingguy.nodejs : Create npm global directory ------------------------------------------------------------------------------------------------------------------------------------------------------------------ 1.09s
room-assistant : Find NodeJS -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.93s
geerlingguy.nodejs : Install packages defined in a given package.json. -------------------------------------------------------------------------------------------------------------------------------------------- 0.09s
geerlingguy.nodejs : Define nodejs_install_npm_user --------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.06s
geerlingguy.nodejs : Add Nodesource repositories for Node.js (CentOS < 7). ---------------------------------------------------------------------------------------------------------------------------------------- 0.04s
geerlingguy.nodejs : Ensure Node.js and npm are installed. -------------------------------------------------------------------------------------------------------------------------------------------------------- 0.04s
geerlingguy.nodejs : Ensure Node.js AppStream module is disabled (CentOS 8+). ------------------------------------------------------------------------------------------------------------------------------------- 0.04s
geerlingguy.nodejs : Import Nodesource RPM key (CentOS 7+). ------------------------------------------------------------------------------------------------------------------------------------------------------- 0.04s
geerlingguy.nodejs : Update apt cache if repo was added. ---------------------------------------------------------------------------------------------------------------------------------------------------------- 0.04s
geerlingguy.nodejs : Add Nodesource repositories for Node.js (CentOS 7+). ----------------------------------------------------------------------------------------------------------------------------------------- 0.04s
Thursday 07 April 2022  22:26:06 -0700 (0:00:01.374)       0:01:26.031 ********
===============================================================================
room-assistant --------------------------------------------------------- 53.07s
geerlingguy.nodejs ----------------------------------------------------- 21.88s
gather_facts ------------------------------------------------------------ 8.93s
systemd ----------------------------------------------------------------- 2.06s
nodejs ------------------------------------------------------------------ 0.07s
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
total ------------------------------------------------------------------ 86.00s

Relevant configuration
Paste the relevant parts of your configuration below.

all:
  hosts:
    'pi-downstairs.local':
  vars:
    ansible_user: pi
    room_assistant_global_config:
      global:
        integrations:
          - homeAssistant
          #- bluetoothClassic
          - bluetoothLowEnergy
      homeAssistant:
        mqttUrl: mqtt://<some ip>:1883
        mqttOptions:
          username: <>
          password: <>
      bluetoothLowEnergy:
        timeout: 60
        maxDistance: 15
        allowlist:
          - 'some bleid' # iphone companion app

Expected behavior
Install should proceed to the next step

Environment

  • room-assistant version: [e.g. 2.0.0]
  • installation type: unsure, installed via ansible then connected to mqtt in hass.io?
  • hardware: Raspberry Pi 4
  • OS: macOS

Additional context
Add any other context about the problem here.

I have same issue. but i am running rasbian-lite 32bit

did some digging, ansible is trying to get the linux capabilities of node and I see something strange. On the impacted rpi's i see

$ getpcaps $(pidof node)
103637: =

but on a working pi i get

$ getpcaps $(pidof node)
778: cap_net_raw=ep

Ive tried uninstalling node and letting ansible do the install but the issue persists.

My problem is that it is installed, but i cannot update the config with ansible, it goes all the way to stop the service and check for dependencies but then i get the same error as you.

and my linux capability of node is this
$ getpcaps $(pidof node)
712: cap_net_raw=ep

I have this same issue. I believe it is related to this issue: ansible-collections/community.general#993

I fixed this issue by using the community.general collection instead of just using capabilities:. I have a pull request #21 if you want to see my changes.

I can confirm that this is working.
Thanks @redleader36 !