Wappler Version : 3.6.1
Operating System : Win10 Pro 20H2
Server Model: ASP.NET
Database Type: MySQL (no DB added in Wappler project though - 100% server actions are API calls, no DB interaction at all directly via Wappler)
Hosting Type: AWS (uploaded via FTP directly)
Other Info: Project first created in Wappler in Jan 2019. have been updating gradually to newer versions.
PROBLEM:
Server Connect fails on client side with this error:
Status Code: 500 Internal Server Error
Full error response:
{
"message": "Unexpected token c in expression {{$_GET.clientid}}",
"lastAction": {
"name": "api1",
"module": "api",
"action": "send",
"options": {
"url": "https://thirdpartyapi.com",
"method": "POST",
"dataType": "json",
"data": {
"ClientID": "{{$_GET.clientid}}"
},
"params": {
"workflow": "WorkflowName"
},
"headers": {
"token": "{{$_SESSION.token}}",
"id": "{{$_GET.clientid}}"
},
"schema": []
},
"output": false,
"meta": [
{
"type": "object",
"name": "data",
"sub": [
{
"type": "text",
"name": "SomeID"
},
{
"type": "text",
"name": "StatusID"
}
]
},
{
"type": "object",
"name": "headers",
"sub": [
{
"type": "text",
"name": "access-control-allow-headers"
},
{
"type": "text",
"name": "access-control-allow-methods"
},
{
"type": "text",
"name": "access-control-allow-origin"
},
{
"type": "text",
"name": "cache-control"
},
{
"type": "text",
"name": "content-length"
},
{
"type": "text",
"name": "content-type"
},
{
"type": "text",
"name": "date"
},
{
"type": "text",
"name": "expires"
},
{
"type": "text",
"name": "pragma"
},
{
"type": "text",
"name": "server"
},
{
"type": "text",
"name": "status"
},
{
"type": "text",
"name": "x-aspnet-version"
},
{
"type": "text",
"name": "x-powered-by"
}
]
}
],
"outputType": "object"
},
"orgException": {
"ClassName": "System.Exception",
"Message": "Unexpected token c in expression {{$_GET.clientid}}",
"Data": null,
"InnerException": null,
"HelpURL": null,
"StackTraceString": " at DMXzone.ServerConnect.Lexer.Tokenize(String input) in C:\\Develop\\Server Connect\\ASPNET_Source\\DMXzone Server Connect\\Lexer.cs:line 136\r\n at DMXzone.ServerConnect.Parser.ParseExpression(String expression, Scope scope) in C:\\Develop\\Server Connect\\ASPNET_Source\\DMXzone Server Connect\\Parser.cs:line 105\r\n at DMXzone.ServerConnect.Parser.Parse(JToken data, Scope scope) in C:\\Develop\\Server Connect\\ASPNET_Source\\DMXzone Server Connect\\Parser.cs:line 77\r\n at DMXzone.ServerConnect.Parser.Parse(JToken data, Scope scope) in C:\\Develop\\Server Connect\\ASPNET_Source\\DMXzone Server Connect\\Parser.cs:line 46\r\n at DMXzone.ServerConnect.App.Execute(JToken action) in C:\\Develop\\Server Connect\\ASPNET_Source\\DMXzone Server Connect\\App.cs:line 378\r\n at DMXzone.ServerConnect.ServerConnect.ExecuteAction(JToken action) in C:\\Develop\\Server Connect\\ASPNET_Source\\DMXzone Server Connect\\ServerConnect.cs:line 234",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": "8\nTokenize\nDMXzone.ServerConnect, Version=1.1.1.3, Culture=neutral, PublicKeyToken=null\nDMXzone.ServerConnect.Lexer\nSystem.Collections.Generic.Queue`1[DMXzone.ServerConnect.Token] Tokenize(System.String)",
"HResult": -2146233088,
"Source": "DMXzone.ServerConnect",
"WatsonBuckets": null
}
}
How to reproduce
- Unfortunately, there is no reliable way to reproduce this - we are working on new feature additions and testing on localhost. 8 out of 10 times the server connect just works fine, 2 times it doesn’t. its a very simple sc passing just one variable to the server action and the API call returns back a simple JSON object.
- The underlying API call made to https://thirdpartyapi.com/ (actual URL withheld to maintain privacy) is not the problem because the requests are not even reaching there - extensive API logging done at that end clearly tell us this.
- if we randomly run the API from Postman, it hasn’t failed on us at all!!!
- so this and the error message that points to some Wappler files tells us that its likely an issue on Wappler side of things.
please fix this issue. if more info is required, please let us know.
cc:@sid