# OVSDB Error: Writing Transaction Failed: /etc/openvswitch/conf.db: Cannot Truncate: Permission Denied

## Problem

* The ***pf9-neutron-ovs-agent*** service fails to start.
* On failure, the following log trace is seen in */var/log/pf9/pf9-neutron-ovs-agent.log.*

{% tabs %}
{% tab title="None" %}

```none
487 189236 ERROR ovsdbapp.backend.ovs_idl.command [-] Error executing command: RuntimeError: OVSDB Error: {"details":"writing transaction failed: /etc/openvswitch/conf.db: cannot truncate to length 489420","error":"I/O error","io-error":"Permission denied"}487 189236 ERROR ovsdbapp.backend.ovs_idl.command Traceback (most recent call last):487 189236 ERROR ovsdbapp.backend.ovs_idl.command  File "/opt/pf9/pf9-neutron/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/command.py", line 30, in execute487 189236 ERROR ovsdbapp.backend.ovs_idl.command    txn.add(self)487 189236 ERROR ovsdbapp.backend.ovs_idl.command  File "/opt/pf9/python/lib/python2.7/contextlib.py", line 24, in __exit__487 189236 ERROR ovsdbapp.backend.ovs_idl.command    self.gen.next()487 189236 ERROR ovsdbapp.backend.ovs_idl.command  File "/opt/pf9/pf9-neutron/lib/python2.7/site-packages/ovsdbapp/api.py", line 94, in transaction487 189236 ERROR ovsdbapp.backend.ovs_idl.command    self._nested_txn = None487 189236 ERROR ovsdbapp.backend.ovs_idl.command  File "/opt/pf9/pf9-neutron/lib/python2.7/site-packages/ovsdbapp/api.py", line 54, in __exit__487 189236 ERROR ovsdbapp.backend.ovs_idl.command    self.result = self.commit()487 189236 ERROR ovsdbapp.backend.ovs_idl.command  File "/opt/pf9/pf9-neutron/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/transaction.py", line 62, in commit487 189236 ERROR ovsdbapp.backend.ovs_idl.command    raise result.ex487 189236 ERROR ovsdbapp.backend.ovs_idl.command RuntimeError: OVSDB Error: {"details":"writing transaction failed: /etc/openvswitch/conf.db: cannot truncate to length 489420","error":"I/O error","io-error":"Permission denied"}487 189236 ERROR ovsdbapp.backend.ovs_idl.command488 189236 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent [-] OVSDB Error: {"details":"writing transaction failed: /etc/openvswitch/conf.db: cannot truncate to length 489420","error":"I/O error","io-error":"Permission denied"} Agent terminated!: RuntimeError: OVSDB Error: {"details":"writing transaction failed: /etc/openvswitch/conf.db: cannot truncate to length 489420","error":"I/O error","io-error":"Permission denied"}Traceback (most recent call last):  File "/opt/pf9/pf9-neutron/lib/python2.7/site-packages/eventlet/queue.py", line 118, in switch    self.greenlet.switch(value)  File "/opt/pf9/pf9-neutron/lib/python2.7/site-packages/eventlet/greenthread.py", line 214, in main    result = function(*args, **kwargs)  File "/opt/pf9/pf9-neutron/lib/python2.7/site-packages/ryu/lib/hub.py", line 65, in _launch    raise eSystemExit: 1
```

{% endtab %}
{% endtabs %}

## Environment

* Platform9 Managed OpenStack - v3.6.0 and Higher
* Neutron
* CentOS 7.x

## Cause

Setting ***SELinux*** to ***Enforcing*** prevents ***neutron-ovs-agent*** from connecting to */etc/openvswitch/conf.db*.

{% tabs %}
{% tab title="None" %}

```none
$ getenforceEnforcing
```

{% endtab %}
{% endtabs %}

## Resolution

1. On the fly, set ***SELinux*** to ***Permissive***.

{% tabs %}
{% tab title="None" %}

```none
# setenforce 0
```

{% endtab %}
{% endtabs %}

2. For the change to remain persistent across reboots, disable SELinux in */etc/sysconfig/selinux.*

{% tabs %}
{% tab title="None" %}

```none
# sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/sysconfig/selinux
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://platform9.com/kb/pmo/solution/ovsdb-error-writing-transaction-failed-etc-openvswitch-conf-db.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
