Error no tty present

Hi all,

When instantiating a new machine gives the following error:


Mon Jul 22 10:13:25 2019 [Z0][VMM][D]: Message received: LOG I 7 Successfully execute transfer manager driver operation: tm_context.
Mon Jul 22 10:13:26 2019 [Z0][VMM][D]: Message received: LOG I 7 Command execution fail: /var/tmp/one/vnm/bridge/pre PFZNPjxJRD43PC9JRD48REVQTE9ZX0lELz48VEVNUExBVEU+PENPTlRFWFQ+PERJU0tfSUQ+PCFbQ0RBVEFbMl1dPjwvRElTS19JRD48RVRIMF9DT05URVhUX0ZPUkNFX0lQVjQ+PCFbQ0RBVEFbXV0+PC9FVEgwX0NPTlRFWFRfRk9SQ0VfSVBWND48RVRIMF9ETlM+PCFbQ0RBVEFbXV0+PC9FVEgwX0ROUz48RVRIMF9HQVRFV0FZPjwhW0NEQVRBW11dPjwvRVRIMF9HQVRFV0FZPjxFVEgwX0dBVEVXQVk2PjwhW0NEQVRBW11dPjwvRVRIMF9HQVRFV0FZNj48RVRIMF9JUD48IVtDREFUQVsxNzIuMjYuMC4xMF1dPjwvRVRIMF9JUD48RVRIMF9JUDY+PCFbQ0RBVEFbXV0+PC9FVEgwX0lQNj48RVRIMF9JUDZfUFJFRklYX0xFTkdUSD48IVtDREFUQVtdXT48L0VUSDBfSVA2X1BSRUZJWF9MRU5HVEg+PEVUSDBfSVA2X1VMQT48IVtDREFUQVtdXT48L0VUSDBfSVA2X1VMQT48RVRIMF9NQUM+PCFbQ0RBVEFbMDI6MDA6YWM6MWE6MDA6MGFdXT48L0VUSDBfTUFDPjxFVEgwX01BU0s+PCFbQ0RBVEFbXV0+PC9FVEgwX01BU0s+PEVUSDBfTVRVPjwhW0NEQVRBW11dPjwvRVRIMF9NVFU+PEVUSDBfTkVUV09SSz48IVtDREFUQVtdXT48L0VUSDBfTkVUV09SSz48RVRIMF9TRUFSQ0hfRE9NQUlOPjwhW0NEQVRBW11dPjwvRVRIMF9TRUFSQ0hfRE9NQUlOPjxFVEgwX1ZMQU5fSUQ+PCFbQ0RBVE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+PFZOX01BRD48IVtDREFUQVticmlkZ2VdXT48L1ZOX01BRD48L05JQz48L1RFTVBMQVRFPjwvVk0+

Mon Jul 22 10:13:26 2019 [Z0][VMM][D]: Message received: LOG I 7 sudo: no tty present and no askpass program specified
Mon Jul 22 10:13:26 2019 [Z0][VMM][D]: Message received: LOG I 7 /var/tmp/one/vnm/vlan.rb:166:in get_bridges': undefined methodeach’ for nil:NilClass (NoMethodError)
Mon Jul 22 10:13:26 2019 [Z0][VMM][D]: Message received: LOG I 7 from /var/tmp/one/vnm/vlan.rb:36:in activate' Mon Jul 22 10:13:26 2019 [Z0][VMM][D]: Message received: LOG I 7 from /var/tmp/one/vnm/bridge/pre:29:in
Mon Jul 22 10:13:26 2019 [Z0][VMM][D]: Message received: LOG I 7 ExitCode: 1
Mon Jul 22 10:13:26 2019 [Z0][VMM][D]: Message received: LOG I 7 Failed to execute network driver operation: pre.
Mon Jul 22 10:13:26 2019 [Z0][VMM][D]: Message received: DEPLOY FAILURE 7 bridge: -


It has been fixed by applying this modification in sudoers

oneadmin ALL=(ALL) NOPASSWD: ALL

This does not convince me at all since we grant total permissions to the oneadmin user, how could we configure it in the most optimal way?

Versions of the related components and OS (frontend, hypervisors, VMs):
1 Front-End (ubuntu 18.04)
3 Nodes hypervisors (ubuntu 18.04)

The package opennebula-common should have this set up for you. This should be the content of /etc/sudoers.d/opennebula on 5.8.1

Defaults:oneadmin !requiretty
Defaults:oneadmin secure_path = /sbin:/bin:/usr/sbin:/usr/bin

Cmnd_Alias ONE_MISC = /sbin/mkfs, /bin/sync, /sbin/mkswap
Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip6tables, /sbin/ip, /sbin/ipset, /usr/bin/arping
Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvs, /sbin/vgdisplay, /sbin/lvchange, /sbin/lvscan, /sbin/lvextend
Cmnd_Alias ONE_ISCSI = /usr/bin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm
Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl
Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm
Cmnd_Alias ONE_CEPH = /usr/bin/rbd
Cmnd_Alias ONE_MARKET = /usr/lib/one/sh/create_container_image.sh
Cmnd_Alias ONE_HA = /bin/systemctl start opennebula-flow, /bin/systemctl stop opennebula-flow, /bin/systemctl start opennebula-gate, /bin/systemctl stop opennebula-gate, /usr/sbin/service opennebula-flow start, /usr/sbin/service opennebula-flow stop, /usr/sbin/service opennebula-gate start, /usr/sbin/service opennebula-gate stop

oneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ONE_NET, ONE_LVM, ONE_ISCSI, ONE_OVS, ONE_XEN, ONE_CEPH, ONE_MARKET, ONE_HA
1 Like

Solved

thanks