Hi All,
I have a server action which gets binary data in response from server.
I get the following error, and it is very rare, not able to simulate always.
Can anyone tell me what exactly it is, i have mentioned the log below :-
Id4ba6d5cc-596a-4cb8-b389-7c85912Time of Log2020-08-11 16:53:46Request Keydbca77-e727-42bf-a514-e6317f2a6eModuleConnect_AppTenantUserSession IduKciiXsRXUSULYrbCdg==Serveroutsys-dev-vm
SourceMessageUnexpected token u in JSON at position 0Environment InformationeSpaceVer: Id=15105, PubId=0, CompiledWith=11.7.3.7036RequestUrl: http://app-dev.com/Connect/moduleservices/log?clientTimeInMillis=1597164827394 (Method: POST)
AppDomain: /LM/W3SVC/1/ROOT/Connect_App-60-13241612329383269FilePath: E:\OutSystems\Platform Server\running\Connect_App.059706539\ClientIp: 10.248.141.6 X-Forwarded-For: 157.33.238.49:41872DeviceUUID: 7c3074bd1251449cLocale: en-USDateFormat: yyyy-MM-ddPID: 5336 ('w3wp', Started='8/11/2020 1:32:09 AM', Priv=1230Mb, Virt=2115918Mb)TID: 208Thread Name:.NET: 4.0.30319.42000DeviceModel: SM-G615FUDeviceUUID: 7c3074bd1251449cOperatingSystem: Android 8.1.0NativeShell: 8.3.2AppVersionCode: 190AppVersionName: 0.26NetworkStatus: OnlineNetworkType: LTECordova: 8.1.0Client-Side LogStackDownloadImageSyntaxError: Unexpected token u in JSON at position 0at JSON.parse (<anonymous>)at l.onSuccess (https://app-dev.com/Connect/scripts/OutSystems.js?PGHrEBzLHyLxW9cX_pLDCA:3:27625)at HttpRequest.onSuccess (https://app-dev.com/Connect/scripts/OutSystems.js?PGHrEBzLHyLxW9cX_pLDCA:2:29201)at https://app-dev.com/Connect/scripts/plugins/com.outsystems.plugins.http/www/request-manager.js:240:22at Array.forEach (<anonymous>)at RequestManager.invokeCallbacks (https://app-dev.com/Connect/scripts/plugins/com.outsystems.plugins.http/www/request-manager.js:230:23)at RequestManager._handleSuccess (https://app-dev.com/Connect/scripts/plugins/com.outsystems.plugins.http/www/request-manager.js:164:22)at RequestManager._handleSend (https://app-dev.com/Connect/scripts/plugins/com.outsystems.plugins.http/www/request-manager.js:79:14)at Object.callbackFromNative (https://app-dev.com/Connect/scripts/cordova.js?7KqI9_oL9hClomz1RdzTqg:287:58)at processMessage (https://app-dev.com/Connect/scripts/cordova.js?7KqI9_oL9hClomz1RdzTqg:1129:17)
Anyone on this?
Regards,
Dhiraj M.
Hi Dhiraj,
It seems like the response you are receiving in JSON is not always coming according to the structure you have created to parse it and the reason you getting the error. Maybe, you can put a log and print the JSON response, to check if it is coming as you expected.
Also, have a look at the below forum, It might help you.
https://stackoverflow.com/questions/42145287/uncaught-syntaxerror-unexpected-token-u-in-json-at-position-0-at-json-parse-a
Sachin
Sachin Mahawar wrote:
Hi Sachin,
Thanks for replying.
My response is binary always.
Also it is very rare, i am not able to reproduce this always,
so where should i place the log i am not sure.
Thanks,
Dhiraj.
Can you give a little more information.are you trying to any html code in outsystems expression?
Please check below comment:
JSON should start with a valid JOSN value – an object, array, string, number, or false/true/null This response started with a <(hence the “Unexpected token<").
That unexpected token, < is a strong clue that the response was HTML instead of JSON.