Bluetooth devices not getting connected

Asked by Navin Talati on 2021-01-28

Upon booting, when the ubuntu starts after logingin (i.e. after applying password), it gives warning window as under:
----------------------------------------------------------------------------------------
Fail to apply network settings
You might not be able to connect to the Bluetooth network via this machine.

Exception.

g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.Failed: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/blueman/main/DbusService.py", line 124, in _handle_method_call
    ok(method(*args))
  File "/usr/lib/python3/dist-packages/blueman/plugins/mechanism/Network.py", line 57, in _reload_network
    nc.apply_settings()
  File "/usr/lib/python3/dist-packages/blueman/main/NetConf.py", line 384, in apply_settings
    self.del_ipt_rules()
  File "/usr/lib/python3/dist-packages/blueman/main/NetConf.py", line 329, in del_ipt_rules
    call(["/sbin/iptables", "-t", table, "-D", chain] + rule.split(" "))
  File "/usr/lib/python3.8/subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/sbin/iptables'
---------------------------------------------------------------------------------------------

Actually I am not understanding the above content. The machine shows all the Bluetooth devices upon scan but none of the device get connected with the system. The O.S is Ubuntu 20.04 LTS

What may be the cause and how to resolve?

Regards.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2021-02-01
Last reply:
2021-02-01
Bernard Stafford (bernard010) said : #1

For diagnostic,
ctl+alt+T to open a terminal.
Print the terminal output here of:
lsb_release -a; uname -a
systemctl status bluetooth

Manfred Hampl (m-hampl) said : #3
Navin Talati (n-m-talati) said : #4

REPLY REFERENCE: #1 as under.

------OUTPUT--------------------------------------
navin@linux:~$ lsb_release -a; uname -a
LSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
Linux linux 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
navin@linux:~$ systemctl status bluetooth
● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor pre>
     Active: active (running) since Sat 2021-01-30 20:55:42 IST; 45min ago
       Docs: man:bluetoothd(8)
   Main PID: 1150 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 9105)
     Memory: 2.0M
     CGroup: /system.slice/bluetooth.service
             └─1150 /usr/lib/bluetooth/bluetoothd

Jan 30 20:55:32 linux systemd[1]: Starting Bluetooth service...
Jan 30 20:55:32 linux bluetoothd[1150]: Bluetooth daemon 5.53
Jan 30 20:55:42 linux systemd[1]: Started Bluetooth service.
Jan 30 20:55:42 linux bluetoothd[1150]: Starting SDP server
Jan 30 20:55:44 linux bluetoothd[1150]: Bluetooth management interface 1.14 ini>
lines 1-16/16 (END)...skipping...
● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-01-30 20:55:42 IST; 45min ago
       Docs: man:bluetoothd(8)
   Main PID: 1150 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 9105)
     Memory: 2.0M
     CGroup: /system.slice/bluetooth.service
             └─1150 /usr/lib/bluetooth/bluetoothd

Jan 30 20:55:32 linux systemd[1]: Starting Bluetooth service...
Jan 30 20:55:32 linux bluetoothd[1150]: Bluetooth daemon 5.53
Jan 30 20:55:42 linux systemd[1]: Started Bluetooth service.
Jan 30 20:55:42 linux bluetoothd[1150]: Starting SDP server
Jan 30 20:55:44 linux bluetoothd[1150]: Bluetooth management interface 1.14 initialized
~
~
.............large gap with this (~) symbol.......
~
~
lines 1-16/16 (END)

.............large gap ................

● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-01-30 20:55:42 IST; 45min ago
       Docs: man:bluetoothd(8)
   Main PID: 1150 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 9105)
     Memory: 2.0M
     CGroup: /system.slice/bluetooth.service
             └─1150 /usr/lib/bluetooth/bluetoothd

Jan 30 20:55:32 linux systemd[1]: Starting Bluetooth service...
Jan 30 20:55:32 linux bluetoothd[1150]: Bluetooth daemon 5.53
Jan 30 20:55:42 linux systemd[1]: Started Bluetooth service.
Jan 30 20:55:42 linux bluetoothd[1150]: Starting SDP server
Jan 30 20:55:44 linux bluetoothd[1150]: Bluetooth management interface 1.14 initialized
~
~
.............large gap with this (~) symbol.......
~
~
lines 1-16/16 (END)
-------------------------------------------END--------------------------------------------

Manfred Hampl (m-hampl) said : #5

You have to press the q key to end this display and to get back to the terminal prompt.

Navin Talati (n-m-talati) said : #6

According to #5, the output is as under:

---------------------------------- OUTPUT---------------------------------------
navin@linux:~$ lsb_release -a; uname -a
LSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
Linux linux 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
navin@linux:~$ systemctl status bluetooth
● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor pre>
     Active: active (running) since Mon 2021-02-01 13:30:41 IST; 5min ago
       Docs: man:bluetoothd(8)
   Main PID: 1148 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 9105)
     Memory: 2.0M
     CGroup: /system.slice/bluetooth.service
             └─1148 /usr/lib/bluetooth/bluetoothd

Feb 01 13:30:30 linux systemd[1]: Starting Bluetooth service...
Feb 01 13:30:40 linux bluetoothd[1148]: Bluetooth daemon 5.53
Feb 01 13:30:41 linux systemd[1]: Started Bluetooth service.
Feb 01 13:30:41 linux bluetoothd[1148]: Starting SDP server
Feb 01 13:30:48 linux bluetoothd[1148]: Bluetooth management interface 1.14 ini>
navin@linux:~$
----------------------------------------END---------------------------------------------

Manfred Hampl (m-hampl) said : #7

"FileNotFoundError: [Errno 2] No such file or directory: '/sbin/iptables'"

There seems to be some inconsistency.

Up to Ubuntu bionic, there was the file /sbin/iptables but in focal it has been replaced by /usr/sbin/iptables-legacy, /usr/sbin/iptables-nft and others.

The problem now seems to be that the blueman package from Ubuntu focal tries to call an iptables executable that is not available any more. This has already been reported in Bug #1878996

My suggestion for a workaround:

Issue the command
sudo gedit /usr/lib/python3/dist-packages/blueman/main/NetConf.py

In the editor that opens in line 322 and in line 329 replace
... ["/sbin/iptables", ...
by
... ["/usr/sbin/iptables", ...

save the file and close the editor.
Then reboot and report whether this has any effect.

Can you help with this problem?

Provide an answer of your own, or ask Navin Talati for more information if necessary.

To post a message you must log in.