# Glance: Failed to Upload Image Data Due to HTTP Error

## Problem

* Uploading an image to Glance or creating a snapshot of an instance fails silently.
* The following exception is seen in */var/log/pf9/ostackhost.log* on the host where the instance resides.

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

```none
682 INFO nova.image.pf9_glance [req-4941d293-b910-4c01-9406-ecd62f791127 admin@platform9.net Platform9] Exception http://x.x.x.x:9292 calling 'upload' with args (u'99358bc4-a28f-4a9b-9371-5f57a4aa4a30', [open file '/opt/pf9/data/instances//snapshots/tmpXzQvoR/1adc831bbf5f47cb8cf50de291685e2b', mode 'r' at 0x7f66645e4810]), {}: 503 Service Unavailable
```

{% endtab %}
{% endtabs %}

* On the Glance node, the Glance API logs in */var/log/glance/api.log* logs the following error.

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

```none
121 196167 ERROR glance.api.v2.image_data [req-5ed23d37-6a16-4bdb-ac30-3e7844d65775 fe3228bb597f49d4b9931c7f5a52e2e6 55c66611af2543bba534d89dedf21a1d - default default] Failed to upload image data due to HTTP error 277 196167 INFO eventlet.wsgi.server [req-5ed23d37-6a16-4bdb-ac30-3e7844d65775 fe3228bb597f49d4b9931c7f5a52e2e6 55c66611af2543bba534d89dedf21a1d - default default] 10.4.10.111 - - [26/Dec/2018 18:26:06] "PUT /v2/images/99358bc4-a28f-4a9b-9371-5f57a4aa4a30/file HTTP/1.1" 503 351 0.638097
```

{% endtab %}
{% endtabs %}

## Environment

* Platform9 Managed OpenStack - v3.7.0 and Higher

## Cause

The directory on the Glance nodes where the snapshots/images are uploaded have incorrect permissions.

## Resolution

1. The directory where the Glance images are uploaded should have the following permissions.

* Ownership: **pf9:pf9group**
* Permission: **755**

## Additional Information

* In this scenario, enabling the debug mode for Glance won't help.
* To identify the issue, capture the **`strace`** of the Glance process when uploading an image or taking a snapshot.

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

```none
# strace -xvfttT -s 2048 -o /tmp/glance_strace.txt -p [pid of glance api process]
```

{% endtab %}
{% endtabs %}

* To stop the **strace** capture, press Ctrl+C.


---

# 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/glance-failed-to-upload-image-data-due-to-http-error.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.
