> For the complete documentation index, see [llms.txt](https://platform9.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://platform9.com/kb/pmo/solution/openstack-commands-fail-with-expecting-to-find-domain-in-user.md).

# OpenStack Commands Fail With "Expecting to Find Domain in User

## Problem

* While attempting to execute OpenStack commands from a self-service user using the OpenStack CLI, some of the commands fail with the following error.

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

```none
Expecting to find domain in user.  The server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error. (HTTP 400)
```

{% endtab %}
{% endtabs %}

## Environment

* Platform9 Managed OpenStack - All Versions
* Python-OpenstackClient - 4.0.0

## Cause

* The *.rc* downloaded for the self-service user from the Management Plane does not have the ***OS\_USER\_DOMAIN\_NAME*** parameter defined.

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

```none
export OS_AUTH_URL=[Management Plane URL]export OS_IDENTITY_API_VERSION=3export OS_REGION_NAME="[region]"export OS_USERNAME="[username]"export OS_PASSWORD="[password]"export OS_PROJECT_NAME="[Project Name]"export OS_PROJECT_DOMAIN_ID=${OS_PROJECT_DOMAIN_ID:-"default"}
```

{% endtab %}
{% endtabs %}

## Resolution

1. Check for the user Domain using the following command.

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

```none
# openstack user list --long
```

{% endtab %}
{% endtabs %}

2. Add the parameter export ***OS\_USER\_DOMAIN\_NAME=\[Domain name]*** to the RC file. It is mostly **default** in most of the cases. The entry looks as shown below.

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

```none
# export OS_USER_DOMAIN_NAME=default
```

{% endtab %}
{% endtabs %}

3. Verify commands which were previously failing now function as expected.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://platform9.com/kb/pmo/solution/openstack-commands-fail-with-expecting-to-find-domain-in-user.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
