{ "id": "151516", "key": "AC-382", "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": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2015-11-21T18:48:06.000+0000", "created": "2015-09-26T05:11:28.000+0000", "labels": [ "arrowdb" ], "versions": [], "issuelinks": [], "assignee": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "updated": "2015-11-21T18:48:06.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "I keep getting this error:\r\nFailed to upload photo: undefined method `destroy' for nil:NilClass\r\n\r\nHere's the full response/log from Appcelerator Platform:\r\n\r\n{code}\r\nContent-Type: =#&custom_fields Content-Type: =#&photo=#&photo_sizes=[object Object]&key={REDACTED}&_session_id={REDACTED}\r\n\r\n{ \"photo_sync_sizes\": [ { \"\\r\": { \"original_filename\": null, \"content_type\": \"; charset=UTF-8\", \"headers\": \"Content-Disposition: form-data; name=\\\"photo_sync_sizes[]\\r\\nContent-Type: ; charset=UTF-8\\r\\nContent-Transfer-Encoding: 8bit\\r\\n\", \"tempfile\": [ null ] } } ], \"suppress_response_codes\\r\\nContent-Type: \": \"#\", \"custom_fields\\r\\nContent-Type: \": \"#\", \"photo\": \"#\", \"photo_sizes\": { \"preview\": { \"\\r\\nContent-Type: \": { \"original_filename\": null, \"content_type\": \"; charset=UTF-8\", \"headers\": \"Content-Disposition: form-data; name=\\\"photo_sizes[preview]\\r\\nContent-Type: ; charset=UTF-8\\r\\nContent-Transfer-Encoding: 8bit\\r\\n\", \"tempfile\": [ null ] } } }, \"key\": \"7Wwhj6FVnEBaEESoH5V56f8Fj6Y4fyEh\", \"_session_id\": \"gP_kNthCebYMjDhRfSMHfmjbkog\" }\r\n\r\n{code}\r\nI have been able to verify that it is in fact a TiBlob object that's being uploaded and it seems that maybe it's something happening on the server?\r\n\r\nI did some research and it appears to be a Ruby issue?", "attachment": [], "flagged": false, "summary": "Photo Uploads Broken on Platform", "creator": { "name": "matthewphewes", "key": "matthewphewes", "displayName": "Matthew Hewes", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "matthewphewes", "key": "matthewphewes", "displayName": "Matthew Hewes", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS and Android. No changes made to working code. Photo uploads have stopped working and have begun returning errors. Details below.", "comment": { "comments": [ { "id": "365044", "author": { "name": "matthewphewes", "key": "matthewphewes", "displayName": "Matthew Hewes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Harish,\r\n\r\nThat is not the problem. I am sending custom sizing through the API and it was previously returning the correct sizes and uploading the images. Something has happened since. My instance has somehow populated over 1.5gb of space while only 20 images have been uploaded, then photos broke entirely, giving me this error: Failed to upload photo: undefined method `destroy' for nil:NilClass. \r\n\r\nThis is happening on dev and production instances and currently happening in a live app.\r\n\r\nThank you!,\r\nMatthew", "updateAuthor": { "name": "matthewphewes", "key": "matthewphewes", "displayName": "Matthew Hewes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-09-26T18:10:48.000+0000", "updated": "2015-09-26T18:11:02.000+0000" }, { "id": "365045", "author": { "name": "matthewphewes", "key": "matthewphewes", "displayName": "Matthew Hewes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I also get the same error when uploading an image without any sizes specified.", "updateAuthor": { "name": "matthewphewes", "key": "matthewphewes", "displayName": "Matthew Hewes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-09-26T18:26:43.000+0000", "updated": "2015-09-26T18:26:43.000+0000" }, { "id": "365046", "author": { "name": "matthewphewes", "key": "matthewphewes", "displayName": "Matthew Hewes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Another update: It's happening in the platform backend form as well. When I try to upload a photo to a user's profile it gives the same error: Failed to upload photo: undefined method `destroy' for nil:NilClass", "updateAuthor": { "name": "matthewphewes", "key": "matthewphewes", "displayName": "Matthew Hewes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-09-26T19:01:21.000+0000", "updated": "2015-09-26T19:01:21.000+0000" }, { "id": "370338", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "We have tested the below code to upload photo in the platform. It's working as expected in Android and iOS.\r\n\r\n{code}\r\nvar win2 = Ti.UI.createWindow({\r\n backgroundColor : 'white'\r\n});\r\nvar Cloud = require('ti.cloud');\r\nCloud.Users.create({\r\n email : 'xyz@gmail.com',\r\n first_name : 'shajib',\r\n last_name : 'darda',\r\n password : '123456',\r\n password_confirmation : '123456'\r\n}, function(e) {\r\n if (e.success) {\r\n var user = e.users[0];\r\n alert('Success:\\n' + 'id: ' + user.id + '\\n' + 'sessionId: ' + Cloud.sessionId + '\\n' + 'first name: ' + user.first_name + '\\n' + 'last name: ' + user.last_name);\r\n } else {\r\n alert('Error:\\n' + ((e.error && e.message) || JSON.stringify(e)));\r\n }\r\n});\r\nvar button1 = Titanium.UI.createButton({\r\n title : 'Login',\r\n top : 10,\r\n width : 100,\r\n height : 50\r\n});\r\nbutton1.addEventListener('click', function(e) {\r\n Titanium.API.info(\"You clicked the button1\");\r\n Cloud.Users.login({\r\n login : 'xyz@gmail.com',\r\n password : '123456'\r\n }, function(e) {\r\n if (e.success) {\r\n var user = e.users[0];\r\n alert('Success:\\n' + 'id: ' + user.id + '\\n' + 'sessionId: ' + Cloud.sessionId + '\\n' + 'first name: ' + user.first_name + '\\n' + 'last name: ' + user.last_name);\r\n } else {\r\n alert('Error:\\n' + ((e.error && e.message) || JSON.stringify(e)));\r\n }\r\n });\r\n});\r\nvar button2 = Titanium.UI.createButton({\r\n title : 'Upload',\r\n top : 80,\r\n width : 100,\r\n height : 50\r\n});\r\nbutton2.addEventListener('click', function(e) {\r\n Cloud.Photos.create({\r\n photo : Titanium.Filesystem.getFile('index1.jpg')\r\n }, function(e) {\r\n if (e.success) {\r\n var photo = e.photos[0];\r\n alert('Success:\\n' + 'id: ' + photo.id + '\\n' + 'filename: ' + photo.filename + '\\n' + 'size: ' + photo.size, 'updated_at: ' + photo.updated_at);\r\n } else {\r\n alert('Error:\\n' + ((e.error && e.message) || JSON.stringify(e)));\r\n }\r\n });\r\n});\r\nwin2.add(button1);\r\nwin2.add(button2);\r\nwin2.open();\r\n{code}\r\n\r\nWe tested with SDK 5.1.0.v20151023172822,5.0.2.GA. CLI 5.0.4. iOS 9.1, Android 5.1.1.\r\n\r\n", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-11-16T11:47:19.000+0000", "updated": "2015-11-21T18:46:42.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }