[TIMOB-18838] ACS Photo uploads fail with 500 error
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2015-05-08T18:27:32.000+0000 |
| Affected Version/s | Release 4.0.0 |
| Fix Version/s | Release 4.0.0, Release 4.1.0 |
| Components | TiAPI |
| Labels | acs, photo, regression, upload |
| Reporter | Sebastian Klaus |
| Assignee | Vishal Duggal |
| Created | 2015-04-15T12:52:01.000+0000 |
| Updated | 2015-05-16T18:42:16.000+0000 |
Description
Photos returned a 500
[INFO] [iphone, 8.1, undefined] {
"success": false,
"error": true,
"code": 500,
"message": "Internal server error. The Appcelerator Cloud Services Team has just been notified of this problem."
}
Please have a look at it.
Could you include the parameters/URL used for this return to happen? And does it always reproduce? CC [~mgadiya]
I can confirm, that this only happens compiled with 4.0.0.Beta2. SDK 3.5.1.GA works as expected. This ist my code:
Working environment:Cloud.onsendstream = function (e) { progressBar.value = e.progress; }; Cloud.Photos.create({ photo: image, 'photo_sync_sizes[]': 'square_75', 'photo_sync_sizes[]': 'small_240', 'photo_sync_sizes[]': 'medium_500' }, function (e) { Cloud.onsendstream = Cloud.ondatastream = null; Ti.App.indicator.hide(); if (e.success) { var photo = e.photos[0]; self.fireEvent('upload.image.success', { url: photo.urls.original }); } else { console.log(e); self.fireEvent('upload.image.error', {}); } });Using latest ti.cloud 3.2.8Operating System Name = Mac OS X Version = 10.10.3 Architecture = 64bit # CPUs = 8 Memory = 17179869184 Node.js Node.js Version = 0.10.38 npm Version = 1.4.28 Titanium CLI CLI Version = 3.4.2 Titanium SDK SDK Version = 3.5.1.GA SDK Path = /Volumes/Data/Users/sebastian/Library/Application Support/Titanium/mobilesdk/osx/3.5.1.GA Target Platform = iphone[~fokkezb] can you reproduce this?
I will let that up to [~rtlechuga] if you don't mind ;)
Of course :-) Thank you
Problem can be reproduced on SDK 4.0.0 Bate2, and works well on SDK 3.5.1 as customer mentioned. Test Case:
Also I tried Curl command with REST API, It works well.var win = Ti.UI.createWindow({ backgroundColor:"white" }); var Cloud = require("ti.cloud"); Cloud.Users.login({ login: <email>, password: <password> }, function (e) { if (e.success) { var user = e.users[0]; Ti.API.info('Success:\n' + 'id: ' + user.id + '\n' + 'sessionId: ' + Cloud.sessionId + '\n' + 'first name: ' + user.first_name + '\n' + 'last name: ' + user.last_name); upload(); } else { alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e))); } }); function upload(e) { Cloud.Photos.create({ photo: Titanium.Filesystem.getFile('1.jpg') }, function (e) { if (e.success) { var photo = e.photos[0]; Ti.API.info('Success:\n' + 'id: ' + photo.id + '\n' + 'filename: ' + photo.filename + '\n' + 'size: ' + photo.size, 'updated_at: ' + photo.updated_at); } else { Ti.API.info('Error:\n' + JSON.stringify(e)); } }); } win.open();So I believe this is the problem from SDK.Any news for that? I think this is really urgent for all developer who are using ACS
Thank you for the bump. We will fix.
I am able to reproduce this today, using: MacOS 10.10.3 Studio 4.0.0.201505070727 Ti SDK 4.0.0.v20150507131012 Appc NPM 0.3.55 Appc CLI 0.2.280 Ti CLI 4.0.0-beta8 Alloy 1.6.0-beta4 Node v0.10.37
[~wkong] , [~ewieber] ran into similar problem and I looked up the logs on api node and this is showed up:
I think we may have possible ACS issue here.Started POST "/v1/photos/create.json?key=nLu8hACXPzfMdRPDBNP23ENDkfcqiqZ4&_session_id=PSx4ZylgHMBwO7ZI4_9ZzLLN_-Y" for 38.110.144.252 at 2015-05-07 21:24:20 +0000 MONGODB (0.9ms) acs_api['action_dispatch_session_mongoid_store_sessions'].find({:_id=>"PSx4ZylgHMBwO7ZI4_9ZzLLN_-Y"}).limit(-1) NoMethodError (undefined methodrewind' for #<String:0x0000000b8a3198>): config/initializers/SessionCookieMiddelware.rb:52:incall'I'm seeing this issue uploading photos to a destination other than ACS, only in the 4.0.0.x Ti SDK on iOS. Works on Android. I don't think this is an ACS issue. Looking into it more now. First error I see is:
Error when matching URL mapping [/(*)/(*)?/(*)?(.(*))?]:Invalid media type "charset="utf-8"": does not contain '/'Pulls pending APSHTTPClient - https://github.com/appcelerator/APSHTTPClient/pull/24 Titanium Mobile master - https://github.com/appcelerator/titanium_mobile/pull/6828 4_0_X - https://github.com/appcelerator/titanium_mobile/pull/6829
Booyah. Thank you, All!
Verified using: Mac OSX 10.10.3 Titanium SDK build: 4.0.0.v20150515213410 Appc CLI (NPM): 0.3.56 Appc CLI (Registry): 0.2.287 Using the code attached by Shuo, when uploading a photo to ACS the upload is now successful. Closing ticket