{ "id": "76301", "key": "AC-2785", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-06-25T04:03:54.000+0000", "created": "2011-06-13T14:04:47.000+0000", "labels": [ "httpclient", "iphone", "mobile", "onerror", "xhr" ], "versions": [], "issuelinks": [], "assignee": { "name": "tguntharp", "key": "tguntharp", "displayName": "Tony Guntharp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:47:42.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "The following error is thrown approximately 75% of the time when requesting web service via HTTPClient:\r\n\r\nError Domain=ASIHTTPRequestErrorDomain Code=1 \"A connection failure occurred\" UserInfo=0x6d14d80 {NSUnderlyingError=0x6d13ca0 \"The operation couldn't be completed. (kCFErrorDomainCFNetwork error -1005.)\", NSLocalizedDescription=A connection failure occurred}\r\n\r\nCannot resolve.", "attachment": [], "flagged": false, "summary": "Sporadic connection failure with HTTPClient.", "creator": { "name": "robmarston", "key": "robmarston", "displayName": "Rob Marston", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "robmarston", "key": "robmarston", "displayName": "Rob Marston", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Developer 1.2.2., Titanium SDK 1.6.2, IOS SDK 4.2 on Mac OS X 10.6.6. ", "comment": { "comments": [ { "id": "156663", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "In order for us to progress this issue, please edit your ticket to include a proper [Use-case|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases].\r\n\r\nAlso, please provide a link to the Q&A question where you have sought help from the community prior to raising this ticket. Kindly read the [Submitting Bug Reports|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-SubmittingBugReports] guide for more info about this.\r\n\r\nThank you", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-06-13T17:18:49.000+0000", "updated": "2011-06-13T17:18:49.000+0000" }, { "id": "156676", "author": { "name": "robmarston", "key": "robmarston", "displayName": "Rob Marston", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Apologies. The community post can be found at http://developer.appcelerator.com/question/120964/sporadic-server-error-a-connection-failure-occurred. Here's the use case:\r\n\r\nvar curr_marble = {id:1);\r\nvar list = {id:2025};\r\nvar user = {username:'USERNAME',password:'PASSWORD'};\r\nvar auth = 'Basic '+Titanium.Utils.base64encode(user.username+':'+user.password); \r\nvar xhr = Titanium.Network.createHTTPClient();\r\nxhr.setTimeout(0);\r\nxhr.onerror = function(e) {\r\nTitanium.API.info(e.error);\r\n};\r\nxhr.onload = function() {\r\nTitanium.API.info(this.responseText);\r\n};\r\nxhr.open(\"POST\",\"http://api.marblejarapp.com/1/marbles.json\");\r\nxhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\r\nxhr.setRequestHeader('Authorization',auth); \r\nif (Titanium.Network.online) {\r\nxhr.send({marbletype:curr_marble.id,list:list.id});\r\n} else {\r\nalert(\"Network unavailable, please try again.\");\r\n};\r\n\r\n*My username and password have been obfuscated for security purposes. Happy to send you actual login credentials.\r\n\r\nOriginally I had though the sound (local mp3) that played before the HTTP request was initiated was causing the error but as it turns out it happens regardless. Additional examples and files available. ", "updateAuthor": { "name": "robmarston", "key": "robmarston", "displayName": "Rob Marston", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-13T19:48:52.000+0000", "updated": "2011-06-13T19:48:52.000+0000" }, { "id": "157781", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "It seems the user has [found the answer|http://developer.appcelerator.com/question/120964/sporadic-server-error-a-connection-failure-occurred] but not updated this ticket. :/\n\nThe solution was:\n\n{code}\nxhr = Titanium.Network.createHTTPClient({enableKeepAlive:false});\n{code}", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-06-25T04:03:54.000+0000", "updated": "2011-06-25T04:03:54.000+0000" }, { "id": "163100", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Closing after 30 days of inactivity.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-16T16:54:58.000+0000", "updated": "2011-08-16T16:54:58.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }