# Instances Fail to Create: "sudo: sorry, you are not allowed to set the following environment variables: LD\_LIBRARY\_PATH, PYTHONPATH

## Problem

Instances fail to create, with an error similar to the following being observed in the */var/log/pf9/ostackhost.log* file on the hypervisor which it was assigned.

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

```none
TRACE nova.compute.manager [instance: 9743b651-c8cd-417b-aa0e-14548e4cdf5d] Command: /opt/pf9/venv/bin/python -m oslo_concurrency.prlimit --as=1073741824 --cpu=30 -- sudo LD_LIBRARY_PATH=/opt/pf9/python/pf9-lib:/opt/pf9/venv/lib/python2.7:${LD_LIBRARY_PATH} PYTHONPATH=/opt/pf9/python/lib/python2.7:/opt/pf9/venv/lib/python2.7:${PYTHONPATH} nova-rootwrap /opt/pf9/etc/nova/rootwrap.conf env LC_ALL=C LANG=C qemu-img info /nova/instances/_base/239272945039cce0d9dfc973dae8f2a096a8348d.partTRACE nova.compute.manager [instance: 9743b651-c8cd-417b-aa0e-14548e4cdf5d] Exit code: 1TRACE nova.compute.manager [instance: 9743b651-c8cd-417b-aa0e-14548e4cdf5d] Stdout: u''TRACE nova.compute.manager [instance: 9743b651-c8cd-417b-aa0e-14548e4cdf5d] Stderr: u'sudo: sorry, you are not allowed to set the following environment variables: LD_LIBRARY_PATH, PYTHONPATH<br>'
```

{% endtab %}
{% endtabs %}

## Environment

* Platform9 Managed OpenStack - v4.5 and Higher
* Nova
* LDAP

## Cause

LDAP sudoers policy is interfering – overwriting the local ***/etc/sudoers.d/pf9-\**** policies.

## Resolution

1. In ***/etc/nsswitch.conf***, comment out the following line – if present.

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

```none
# sudoers: files ldap
```

{% 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/instances-fail-to-create-sudo-sorry-you-are-not-allowed-to-set.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.
