cfn/F17/WordPress_Single_Instance.template returns"ERROR: in <"byte string">, position 0"

Bug #1240289 reported by Angus Salkeld
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Critical
Jason Dunsmore

Bug Description

So this might be a heat bug, but looks like some odd character in the template.

Revision history for this message
Angus Salkeld (asalkeld) wrote :

This template is referenced in the devstack tutorial it really needs to work!

Changed in heat-templates:
importance: Undecided → Critical
Angus Salkeld (asalkeld)
Changed in heat-templates:
assignee: nobody → Angus Salkeld (asalkeld)
Revision history for this message
Angus Salkeld (asalkeld) wrote :
Download full text (5.7 KiB)

Some more debug:

heat -d create wp-url -u https://raw.github.com/openstack/heat-templates/master/cfn/F17/WordPress_Single_Instance.template -P "KeyName=dropbear_angus;InstanceType=m1.tiny"
curl -i -X POST -H 'X-Auth-Key: menticaquaci' -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Auth-Url: http://openstack-controller-vip.eng.bne.redhat.com:5000/v2.0' -H 'X-Auth-User: asalkeld' -H 'User-Agent: python-heatclient' -d '{"stack_name": "wp-url", "disable_rollback": true, "template_url": "https://raw.github.com/openstack/heat-templates/master/cfn/F17/WordPress_Single_Instance.template", "parameters": {"KeyName": "dropbear_angus", "InstanceType": "m1.tiny"}, "timeout_mins": 60}' http://192.168.1.101:8004/v1/1027066049c049beb2422586d1959d1b/stacks
DEBUG (http:114) curl -i -X POST -H 'X-Auth-Key: menticaquaci' -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Auth-Url: http://openstack-controller-vip.eng.bne.redhat.com:5000/v2.0' -H 'X-Auth-User: asalkeld' -H 'User-Agent: python-heatclient' -d '{"stack_name": "wp-url", "disable_rollback": true, "template_url": "https://raw.github.com/openstack/heat-templates/master/cfn/F17/WordPress_Single_Instance.template", "parameters": {"KeyName": "dropbear_angus", "InstanceType": "m1.tiny"}, "timeout_mins": 60}' http://192.168.1.101:8004/v1/1027066049c049beb2422586d1959d1b/stacks

HTTP/1.1 500 Internal Server Error
date: Thu, 17 Oct 2013 04:59:46 GMT
content-length: 243
content-type: application/json; charset=UTF-8

{"explanation": "The server has either erred or is incapable of performing the requested operation.", "code": 500, "error": {"message": "", "traceback": " in \"<string>\", position 1", "type": "ReaderError"}, "title": "Internal Server Error"}

DEBUG (http:124)
HTTP/1.1 500 Internal Server Error
date: Thu, 17 Oct 2013 04:59:46 GMT
content-length: 243
content-type: application/json; charset=UTF-8

{"explanation": "The server has either erred or is incapable of performing the requested operation.", "code": 500, "error": {"message": "", "traceback": " in \"<string>\", position 1", "type": "ReaderError"}, "title": "Internal Server Error"}

ERROR:

(no error message above)

-----------------------------------------------------------------------------------------------------------
2013-10-17 15:59:46.041 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTPS connection (1): raw.github.com
2013-10-17 15:59:46.980 DEBUG requests.packages.urllib3.connectionpool [-] "GET /openstack/heat-templates/master/cfn/F17/WordPress_Single_Instance.template HTTP/1.1" 200 1706 from (pid=2955) _make_request /usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:289
2013-10-17 15:59:46.982 ERROR root [-] Unexpected error occurred serving API: 'utf8' codec can't decode byte #x8b: invalid start byte
  in "<string>", position 1
2013-10-17 15:59:46.982 TRACE root Traceback (most recent call last):
2013-10-17 15:59:46.982 TRACE root File "/home/asalkeld/work/heat/heat/common/wsgi.py", line 661, in __call__
2013-10-17 15:59:46.982 TRACE root request, **action_args)
2013-10-17 15:59:46.982 TRACE root File "/home/asalkeld/work/heat/heat/co...

Read more...

Angus Salkeld (asalkeld)
Changed in heat-templates:
status: New → Triaged
Revision history for this message
Angus Salkeld (asalkeld) wrote :

So the problem is in heat/common/urlfetch.py

If I make the following change this problem goes away:
diff --git a/heat/common/urlfetch.py b/heat/common/urlfetch.py
index 02e75cf..228f46f 100644
--- a/heat/common/urlfetch.py
+++ b/heat/common/urlfetch.py
@@ -55,6 +55,9 @@ def get(url, allowed_schemes=('http', 'https')):
             raise IOError('Failed to retrieve template: %s' % str(uex))

     try:
+ resp = requests.get(url)
+ return resp.text
+

affects: heat-templates → heat
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/52335

Changed in heat:
status: Triaged → In Progress
Steven Hardy (shardy)
tags: added: havana-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/52476

Changed in heat:
assignee: Angus Salkeld (asalkeld) → Jason Dunsmore (jasondunsmore)
Angus Salkeld (asalkeld)
Changed in heat:
milestone: none → icehouse-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/52476
Committed: http://github.com/openstack/heat/commit/6ad4f5c9ad46c049dcf98909bb13429f152b971f
Submitter: Jenkins
Branch: master

commit 6ad4f5c9ad46c049dcf98909bb13429f152b971f
Author: Jason Dunsmore <email address hidden>
Date: Thu Oct 17 10:14:43 2013 -0500

    Prevent urlfetch from returning encoded chars

    raw.read() is returning unprintable characters. Iterate over the
    decoded characters instead.

    Closes-bug: #1240289

    Change-Id: Ifa61dcc34286f2203407c657b5eb5ee2a099744d

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.