# Image Upload Fails due to Missing Endpoint

## Problem

* Image upload is failing via CLI due to missing `admin` endpoint.

```bash
$ echo $OS_INTERFACE
admin

$ openstack image create --insecure --container-format bare --disk-format qcow2 --file <IMAGE_PATH> <IMAGE_NAME>
admin endpoint for image service in [REGION_NAME] region not found
```

## Environment

* Platform9 Cloud Director Virtualization - v2025.4 and Higher
* Component - Image Library

## Cause

* Image uploads greater than 1 Gi are recommended to be performed via CLI command. Also, adding an admin endpoint interface is a prerequisite before uploading the image via CLI.
* The `admin` endpoint is missing from glance service catalog; that blocks any Glance administrative tasks.

```bash
$ openstack catalog show image
+-----------+---------------------------------------------------------------------------+
| Field     | Value                                                                     |
+-----------+---------------------------------------------------------------------------+
| endpoints | [REGION_NAME]                                                             |
|           |   public: https:__[FQDN]_glance_                                          |
|           | [REGION_NAME]                                                             |
|           |   internal: http:__glance-api.[REGION_NAME].svc.cluster.local:9292_       | 
| id        | [IMAGE_UUID]                                                              |
| name      | glance                                                                    |
| type      | image                                                                     |
+-----------+---------------------------------------------------------------------------+
```

* It can also be verified by listing endpoint information for a image service.

```bash
$ openstack --insecure endpoint list --service image --region <REGION_NAME>
+------------------+---------------+--------------+--------------+-----------+-----------+---------------------------------------------------------+
| ID               | Region        | Service Name | Service Type | Enabled   | Interface | URL                                                     |
+------------------+---------------+--------------+--------------+-----------+-----------+---------------------------------------------------------+
| [ENDPOINT_UUID1] | [REGION_NAME] | glance       | image        | True      | public    | https:__[FQDN]_glance_                                  |
| [ENDPOINT_UUID1] | [REGION_NAME] | glance       | image        | True      | internal  | http:__glance-api.[REGION_NAME].svc.cluster.local:9292_ |
+----------------------------------+--------------+--------------+-----------+-----------+-----------+---------------------------------------------+
```

## Resolution

* Manually creating admin endpoint for the image service will allow the images to be uploaded.

```bash
$ openstack endpoint create --region <REGION_NAME> image admin https:__<GLANCE_HOST_IP>:9494
```

* Verfiy the newly created `admin` endpoint.

```bash
$ openstack catalog show image
+-----------+---------------------------------------------------------------------------+
| Field     | Value                                                                     |
+-----------+---------------------------------------------------------------------------+
| endpoints | [REGION_NAME]                                                             |
|           |   public: https:__[FQDN]_glance_                                          |
|           | [REGION_NAME]                                                             |           |           |   admin: https:__[HOST_IP]:9494                                           |
|           | [REGION_NAME]                                                             |
|           |   internal: http:__glance-api.[REGION_NAME].svc.cluster.local:9292_       |
| id        | [IMAGE_UUID]                                                              |
| name      | glance                                                                    |
| type      | image                                                                     |
+-----------+---------------------------------------------------------------------------+
```

## Additional Information

* When the `OS_INTERFACE` is set as `public`*\[default configuration]*, image upload fails with the below error. This is because, **nginx** placed in front of Glance API, blocks an image upload (or download) as the file size exceeds the configured limit *\[not more than 1Gi]*.

```bash
HttpException: 413: Client Error for url: https:__[FQDN]_glance_v2_images_[IMAGE_UUID]_file, 413 Request Entity Too Large: nginx
```


---

# 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/pcd/image-library/image-upload-fails-due-to-missing-endpoint.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.
