ASP.NET with MySQL: Server Connects are randomly failing

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

also getting error
400 Bad Request
with response
Error; Description: Input string was not in a correct format.
similar problem, all things are properly aligned. refreshing page a couple times allows for it to work again. very random as to when it will happen.

Maybe try to isolate the problem if it is input parameters ($_GET) or database related. Seems validation is trigger and wrong input is been passed.

It is very difficult for us to solve something we can’t reproduce.

As I said, there is no db connection. The server action contains one single step of an api call.
Also, there is no validation on get Param. It’s just one single, optional get Param.
If you iterate the server connect calls from browser side few times am some of them will break. It is happening very consistently for us.

Happy to show this over remote if required.

If you can deliver a test case that we can run, it will be great.

Try replacing the api call with static json as this is what it returns.

it’ll be difficult to share the dev env with you to test out - am trying.

about half hour worth of tests today haven’t yield the same problem again. am trying - once its back, will try to share with dev env so that you can see it for yourself. thanks.

one way we can reliably generate this issue is on reloading the page right after publishing new code from Wappler.

This has been fixed in Wappler 4.6

This topic was automatically closed after 47 hours. New replies are no longer allowed.