Issue with the rails (2.3.11) server(production side) - ruby-on-rails

I am stuck with a very unusual issue. I am trying to call a webservice request from the server (actully an ajax 2 step request from the client side) for which i am getting an xml formatted response which i am parsing using a treeview. The issue is..its working well in development mode on local server but showing error in production with the same codes. When I initiate a request I get a response for the first step in string format but showing error "error loading xmlDoc: xmlDoc is undefined" for the second request which suppose to be initiated directly after the first response.
codes are available here:
https://github.com/domthu/microaquadt/blob/master/app/views/oligo_sequences/edit.html.erb
error is somewhere on the function starting from line 195.
Any help or suggestion would be much appreciated...!!!!

Related

Google One Tap throws error with cryptic message

After implementing Google One Tap I noticed some JS errors on the client side (these client-side errors are caught in the browser and sent to the backend; I can see them in the backend logs but cannot reproduce the issue in the client side) for which the stack trace looks like this:
Error: A
at Object._.ad (/_/gsi/_/js/k=gsi.gsi.en_US.PmiGgqd91Pc.O/am=CQ/d=1/ct=zgms/rs=AF0KOtWwHiXCDsPbTZybnAb2zlX1YPJDGg/m=gis_client_library:109:138)
at /_/gsi/_/js/k=gsi.gsi.en_US.PmiGgqd91Pc.O/am=CQ/d=1/ct=zgms/rs=AF0KOtWwHiXCDsPbTZybnAb2zlX1YPJDGg/m=gis_client_library:299:24
at He.<anonymous> (/_/gsi/_/js/k=gsi.gsi.en_US.PmiGgqd91Pc.O/am=CQ/d=1/ct=zgms/rs=AF0KOtWwHiXCDsPbTZybnAb2zlX1YPJDGg/m=gis_client_library:241:164)
at uc (/_/gsi/_/js/k=gsi.gsi.en_US.PmiGgqd91Pc.O/am=CQ/d=1/ct=zgms/rs=AF0KOtWwHiXCDsPbTZybnAb2zlX1YPJDGg/m=gis_client_library:87:200)
at He._.l.dispatchEvent (/_/gsi/_/js/k=gsi.gsi.en_US.PmiGgqd91Pc.O/am=CQ/d=1/ct=zgms/rs=AF0KOtWwHiXCDsPbTZybnAb2zlX1YPJDGg/m=gis_client_library:85:347)
at Be (/_/gsi/_/js/k=gsi.gsi.en_US.PmiGgqd91Pc.O/am=CQ/d=1/ct=zgms/rs=AF0KOtWwHiXCDsPbTZybnAb2zlX1YPJDGg/m=gis_client_library:179:210)
at Fe (/_/gsi/_/js/k=gsi.gsi.en_US.PmiGgqd91Pc.O/am=CQ/d=1/ct=zgms/rs=AF0KOtWwHiXCDsPbTZybnAb2zlX1YPJDGg/m=gis_client_library:181:245)
at He._.l.zc (/_/gsi/_/js/k=gsi.gsi.en_US.PmiGgqd91Pc.O/am=CQ/d=1/ct=zgms/rs=AF0KOtWwHiXCDsPbTZybnAb2zlX1YPJDGg/m=gis_client_library:186:212)
at He._.l.Nb (/_/gsi/_/js/k=gsi.gsi.en_US.PmiGgqd91Pc.O/am=CQ/d=1/ct=zgms/rs=AF0KOtWwHiXCDsPbTZybnAb2zlX1YPJDGg/m=gis_client_library:186:187)
The JS code that throws this error is embedded in a <script> tag inside an <iframe> that displays the One Tap login popup and it seems to expect an AJAX response with a specific prefix; the statement that throws the error basically looks like this (minified JS):
if (!a.startsWith(")]}'\n")) throw console.error("malformed JSON response:", a), Error("A");
I checked the network requests and noticed that there is an XHR request that returns the response in this format; the endpoint is https://accounts.google.com/gsi/status (with some extra request parameters) but I cannot find any documentation from google for this endpoint.
Does anyone know would could be the cause of this error?
Thank you

Quectel M95 HTTP POST timeout error

I'm trying to send a POST to a server but I always get the +CME ERROR: 3821. I know that this means "HTTP to read timeout". Then, I tried to change the server to another one, just to test, and then I get the same error 3821. My AT commands list is:
AT+CGATT=1
AT+QIFGCNT=0
AT+QICSGP=1,"zap.vivo.com.br"
AT+QIACT
AT+QILOCIP (IP OK!)
AT+QHTTPURL=38,30
CONNECT
http://www.posttestserver.com/post.php
OK
AT+QHTTPPOST=10,50,80
CONNECT
helloworld
OK
+CME ERROR: 3821
Does anyone know what is wrong?
I solved it by using directly
AT+QHTTPPOST=10,50
and not
AT+QHTTPPOST=10,50,10
hello even the issue is one year old i am writing answer if any one needs. In the source file of "ril_http.c" of Quectel modules, add delay of minimum 10ms in HTTP call back handler. it will solve the timeout error and will able to post it successfully.

ServiceStack request giving 500 for large request

I am using ServiceStack with MVC4 and getting 500 error when request parameters are long. I am posting ProductIds seperated by commas to controller via AJAX. In controller I have following call to servicestack API to retrieve data.
ResponseDTO res = restClient.Get(new RequestDTO { ProductIDs = ids});
//ResponseDTO res = restClient.Get(new RequestDTO { ProductIDs = "1234,1235,1236"});
If i submit small parameters in above, it works fine with no error. But when parameter string is in range of 1800 characters, it simply fails on above line and gives 500 Internal Server Error:
NetworkError: 500 Internal Server Error - http://localhost/Products/GetProducts
Exception Details: ServiceStack.ServiceClient.Web.WebServiceException: Not Found
is there a limit on GET method for posting large parameter request? Why does it fail for large request when for small parameters it successfully calls API, retrieves data via SQL procedure and sends to view correctly. What can I look into to solve this? Thank you!
p.s. when i debug via VS2012, i see exception details I see Message:Not Found and StatusCode: 404.
As Scott mentioned above, we tried POST for all methods and it fixed issue. I knew GET had limit on browser URL length but didnt think it matters as we had ServiceStack framework and all of their examples were using GET. Thanks again Scott.

AccessTokenAuthorizationCodeRequestC "error":"invalid_request"

At the second call to Client.ProcessUserAuthorization(); after I get the code from the oauth server, I get an exception: Error occurred while sending a direct message or getting the response.
Here is the last part from the log file taken with log4net, the full log is recorded in this gist: https://gist.github.com/tonyeung/5513769
2013-05-03 15:14:41,292 (GMT-5) [10] DEBUG DotNetOpenAuth.Messaging.Channel - Sending AccessTokenAuthorizationCodeRequestC request.
2013-05-03 15:14:41,393 (GMT-5) [10] DEBUG DotNetOpenAuth.Http - HTTP POST http://localhost:38828/OAuth/Token
2013-05-03 15:14:41,450 (GMT-5) [10] ERROR DotNetOpenAuth.Http - http://localhost:38828/OAuth/Token returned 400 BadRequest: Bad Request
2013-05-03 15:14:41,450 (GMT-5) [10] DEBUG DotNetOpenAuth.Http - WebException from http://localhost:38828/OAuth/Token:
{"error":"invalid_request"}
I've uploaded the solution to https://github.com/tonyeung/dotnetopenauth
The entry point is in the about action on the home controller of the Client project.
The solution is in VS2012, the latest nuget dnoa package. Nuget restore is on.
Please note that I'm implementing pieces as I need them in order to understand how the library works. I'm sure that this error is due to a missing implementation somewhere, but I'm not sure what it is?
So it looks like I was missing implementations for IsAuthorizationValid and CreateAccessToken in the Authorization Server. Please check the github repository for the stubs i put in that makes the error go away.
EDIT:
There was also a database validation error that I didn't trap. So basically any error on the server side will cause this message it looks like.
EDIT2:
There was also an issue where if the url of the page contains any non url encoded values it will throw an invalid request. In my case, my login page had a querystring parameter of returnUrl, and I had set it to /Home, which it DID NOT like, had to be: %2FHome

Adobe Flex 3 : Fault Event doesnt return XML Feed sent from Server

I am working on a flex application which communicates with a Rails backened.
When i request for some data, It sends back xml feed.
In some cases, if given parameters are not valid, then rails return an error feed with status code = 422 as following
email is wrong
But I dont get this feed in FaultEvent of Flex, How could i read error feed?
Thanks
Are you getting the result in ResultEvent in such cases? I am not sure for what all HTTP error codes FaultEvent will get invoke(I know only it goes for 404 and 500). May be its still going to ResultEvent as a valid result!
You can use HTTPService instead of URLLoader.
Flex HTTP results will not include the actual underlying HTTP response codes. It just doesn't work. (TM)

Resources