kimchi icon indicating copy to clipboard operation
kimchi copied to clipboard

Unable to create bridge virbr0: File already exists

Open nerijus opened this issue 10 years ago • 19 comments

On CentOS 7, latest kimchi trunk:

src/kimchid

Loaded plugins: fastestmirror libvirt: error : Unable to create bridge virbr0: Failas jau egzistuoja (it translates as "File already exists", I was unable to get English message with both LANG=C and LC_ALL=C).

nerijus avatar Dec 15 '14 16:12 nerijus

Hi Nerijus,

could you please describe more the scenario. Did you run a bare metal or a VM? Before running, default network was already created?

ramonmedeiros avatar Jan 13 '15 12:01 ramonmedeiros

I updated to svn trunk and do not get this error on CentOS 7 anymore, but do get it on Fedora 21. It's bare metal, a few VM's created with virt-manager. I run kimchi on the host. ifconfig shows virbr0 interface up, it is probably created by virt-manager/libvirt.

nerijus avatar Jan 13 '15 14:01 nerijus

After the host reboot I got this error on CentOS 7 again too.

nerijus avatar Jan 13 '15 23:01 nerijus

Hi, Nerijus I met the same problem, the error occurred while start the 'nat' type network. I found it can be solved in this way:

  1. start firewall service (systemctl start firewalld)
  2. let the port through (firewall-cmd --zone=public --add-port=8000(8001)/tcp --permanent)

gouzongmei avatar Jan 14 '15 06:01 gouzongmei

I cannot start firewalld, because I use another firewall (shorewall). I have 8001 tcp port opened from outside. I added 8000 too, but it did not help.

nerijus avatar Jan 15 '15 12:01 nerijus

Is it possible for kimchid to not try to start networks? Because I use libvirt, and everything (including VMs) is started by libvirtd when the host boots.

nerijus avatar Jan 15 '15 12:01 nerijus

Could you please post your networks xml.

ramonmedeiros avatar Feb 11 '15 16:02 ramonmedeiros

Also put the output of brctl show

ramonmedeiros avatar Feb 11 '15 16:02 ramonmedeiros

/etc/libvirt/qemu/networks/default.xml:

<network>
  <name>default</name>
  <uuid>ee499638-e505-4fcc-8722-26b78ac69fb1</uuid>
  <bridge name="virbr0"/>
  <mac address='52:54:00:DB:F7:A0'/>
  <forward/>
  <ip address="192.168.122.1" netmask="255.255.255.0">
    <dhcp>
      <range start="192.168.122.2" end="192.168.122.254"/>
    </dhcp>
  </ip>
</network>

nerijus avatar Feb 11 '15 16:02 nerijus

brctl show

bridge name bridge id       STP enabled interfaces
br0     8000.549f350629ca   no      em2
                            vnet0
                            vnet1
                            vnet2
virbr0      8000.525400dbf7a0   yes     virbr0-nic

nerijus avatar Feb 11 '15 16:02 nerijus

Hi, i reproduce this error on Fedora 19. I run two tests:

Fedora 19 x86 No default network No virbr0 bridge

Results: default network created: worked fine

Fedora 19 x86 No default network virbr0 bridge created (brctl addbr virbr0)

Results: Fail:

libvirt: Network Driver error : Network not found: no network with matching name 'default' libvirt: error : Unable to create bridge virbr0: File exists

Seems to be a libvirt issue(since kimchi does not specify virbr0 when creates the bridge). I will take a look.

ramonmedeiros avatar Feb 11 '15 17:02 ramonmedeiros

Hi @nerijus,

i proposed a solution at the mailing list:

http://lists.ovirt.org/pipermail/kimchi-devel/2015-February/009777.html

Tested here in my laptop. Everytime a virbr0 exists, the fix makes kimchi to create default network using virbr1 or a next number available

ramonmedeiros avatar Feb 13 '15 17:02 ramonmedeiros

Why to create additional virbr at all?

nerijus avatar Feb 14 '15 10:02 nerijus

I applied the patch in http://lists.ovirt.org/pipermail/kimchi-devel/2015-February/009779.html to 1.4.1, but still the same error: Unable to create bridge virbr0: File already exists

nerijus avatar Apr 12 '15 13:04 nerijus

I am using the following patch for now:

--- a/src/kimchi/model/networks.py
+++ b/src/kimchi/model/networks.py
@@ -79,7 +79,7 @@
                 else:
                     kimchi_log.error("Fatal: Cannot activate default network "
                                      "because of %s, exit kimchid", e.message)
-                    sys.exit(1)
+                    #sys.exit(1)

     def create(self, params):
         conn = self.conn.get()

nerijus avatar Apr 13 '15 22:04 nerijus

Hi Nerijus, we are trying to fix the problem on libvirt. I will notify you if we have news

ramonmedeiros avatar Apr 28 '15 14:04 ramonmedeiros

Can anyone explain me, what this problem is about at all? Why kimchi cannot use the existing virbr0 and insists on creating a new interface?

nerijus avatar Apr 28 '15 15:04 nerijus

Hi, I see the same issue with wok branch.. Steps followed - Environment: x86 Operating system: Fedora Browser: Google Chrome Steps performed:

  1. Installed WOK without any plugins (https://github.com/kimchi-project/kimchi/tree/wok)
  2. Started wokd daemon
  3. Installed kimchi-wok plugin
  4. Restarted wokd daemon. It fails with the below error

systemctl status wokd

● wokd.service - Wok - Webserver Originated from Kimchi Loaded: loaded (/usr/lib/systemd/system/wokd.service; disabled) Active: failed (Result: exit-code) since Wed 2015-07-22 12:31:36 IST; 1min 41s ago Process: 13062 ExecStop=/bin/kill -TERM $MAINPID (code=exited, status=1/FAILURE) Process: 13051 ExecStart=/usr/bin/wokd (code=exited, status=1/FAILURE) Main PID: 13051 (code=exited, status=1/FAILURE)

Jul 22 12:31:36 localhost.localdomain wokd[13051]: nginx: [emerg] bind() to 0.0.0.0:8001 failed (98: Address already in use) Jul 22 12:31:36 localhost.localdomain wokd[13051]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use) Jul 22 12:31:36 localhost.localdomain wokd[13051]: nginx: [emerg] still could not bind() Jul 22 12:31:36 localhost.localdomain wokd[13051]: libvirt: error : Unable to create bridge virbr0: File exists Jul 22 12:31:36 localhost.localdomain wokd[13051]: WARNING: no 'numpy' module, HyBi protocol will be slower Jul 22 12:31:36 localhost.localdomain systemd[1]: wokd.service: main process exited, code=exited, status=1/FAILURE Jul 22 12:31:36 localhost.localdomain kill[13062]: kill: not enough arguments Jul 22 12:31:36 localhost.localdomain systemd[1]: wokd.service: control process exited, code=exited status=1 Jul 22 12:31:36 localhost.localdomain systemd[1]: Unit wokd.service entered failed state. Jul 22 12:31:36 localhost.localdomain systemd[1]: wokd.service failed.

output from brctl -

brctl show

bridge name bridge id STP enabled interfaces virbr0 8000.000000000000 yes

sureshab avatar Jul 22 '15 12:07 sureshab

Fatal: Unable to activate network default.
Details: error creating bridge interface virbr0: File exists
Failed to import plugin plugins.kimchi.Kimchi, error: Network default does not exist or is not active. Please, check the configuration in /etc/kimchi/template.conf to ensure it lists only valid networks. 

I have the same error with 2.5.0 release. Any fix for this?

goooroooX avatar Aug 23 '18 15:08 goooroooX