OpenURI::HTTPError Exception: 500 Internal Server Error - ruby

Unable to open URL "http://www.diretaimoveisbh.com.br//Resultado.asp?nTransacao=V&vid_tipoimovel=&vId_bairro=&pagina=11" with open-uri, It keeps throwing error "OpenURI::HTTPError Exception: 500 Internal Server Error", I searched everywhere but didnt got any solution.
Please help If anyone here know how to resolve that issue.
Thanks in advance.

If you get a 500 back from the server, something is really broken somewhere, probably on the server. Maybe the URL is broken too.
Expect issues retrieving the data you want unless you receive a 200 back from the server. 200 code means everything you expect should be there, 4xx or 5xx code is something completely different, see for more info.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
In the meantime, you may try/catch the exception, but keep in mind, its most likely not going to contain anything (except maybe error information) in the payload until its returning a 200.

Related

What does "200 connection established" HTTP response status code mean?

I know about 200 OK but what is 200 connection established?
To give some background, I am testing out XMLHTTPRequest in an old firefox browser(version 26 to be exact) and I see this as the response code. I am not able to view either the response headers or body so there definitely seems to be some issue. In newer browsers I see 200 OK and there are no issues with the response. I want to understand what this response code means so that I can debug.
In addition I would like to know if this code indicate a problem with the client or server?
Thanks for any help.
The status code is just "200". What follows is the "reason phrase", and it's up to the server to make one up. Note that in HTTP/2 and /3, there is no reason phrase at all.
So; just ignore it.

IIS 10 Failed Request 500 - General_Request_Start Failed To Complete

I'm trying to understand why after deployment my server is returning 500 - Internal server error for a simple GET request that checks the server's status which is supposed to return 200 (when I run it locally with unit tests I wrote, it works fine). I retrieved the failed request log, but can't quite seem to understand what the problem is.
In several events the severity column shows: Failed To Complete
The Request summary shows:
These are the Errors and Warnings shown:
Does anyone know why I might be getting theses errors, or why I might be getting a 500 Internal Server error response?
I will add that I already have a GET request that is working:
https://myalertsserver.cloudapp.net/providers/management/alerts which returns 200.
and when I try:
https://myalertsserver.cloudapp.net/providers/status I get a 404 Error.
It seems to me like it has to do with something in the configuration, but I can't seem to understand what.
Thanks in advance.

express graphql always sends 500 Internal server error for any thrown error from resolver

I am using express graphql in my node app . and it graphql always sends 500 Internal server error for any thrown error from resolver. Please suggest any solution so i will get proper response and status code
The express-graphql sends the HTTP error 500 whenever detects there is no data returned. Definitely, in case of exception is thrown there won't be a returning data. Although it looks like an obvious bug the developers have their own opinion on that. They seemed to decide providing an option to disable the feature so that the server shouldn't set the 500 error. At least the open issue on that is still there.
Checking out the sources I've found these options to get around the problem:
To set any other response code than 200 (e.g. 299 (custom)) in your resolver.
To set the response code in your error formatting handler. This seems to be the most optimal solution.
Just to pick up some other library =)

AJAX error, Drupal 7

I got an AJAX error while running Drupal 7.
"An AJAX error occured.
HTTP result code: 500
Debugging information follows:
Path: system/AJAX
StatusText: error
Response text:"
There is no response text. I have looked everywhere and tried a couple of things, but nothing works. Anyone have an idea on how to fix it?
Thanks
Check your watchdog table, if nothing there check the php error log.
Also use Firebug's console to check what is returned after the ajax request for any clues.
Can also try disabling third party modules one at a time to find out what is causing the error.

What other 5xx errors could be occuring and how to I find/track them?

I have a Classic ASP/VBScript site running on IIS 6, and a program called SmarterStats (found via an earlier question) providing various stats and info from the server logs. This is an internal site, and we do use integrated authentication (AUTH_TYPE = Negotiate).
I'm looking at the report on response codes, and it says that in the last 7 days there have been 255 responses with a 5xx error code... naturally not the most useful stat I could get back.
I have a custom error page for 500 and 500.100 errors that logs the specifics for me to follow up on - and that log is virtually empty. I've tested with an intentionally broken page, and a standard user account, and it is working as expected - custom message, log entry made. (and checked with "friendly error messages" on and off - works either way)
The only entry I have in the log is a single entry for an error -2147024843 (authentication related, took too long to get a response), and that's it... what other errors could be happening and how can I find/track them?
Should I route all the different types of 5xx errors through my custom page? Or is there something else I should be doing?
Resolution: I'm going to go with running all 5xx errors through the custom page. For reasons that leave me totally baffled, the errors have stopped... I've not changed anything, no one has changed anything on that server - but the errors have stopped. Go figure.
It seems like logging all 5xx errors via your custom page might be a good idea. Your logging seems to be working, but SmarterStats seems like it might be giving you bogus data?
What version of SmarterStats are you using?
My hosting provider has Version 5.2 and I can see a detailed list of which pages have produced a 5xx error by going to Report Items > Server Responses > 5xx - Server Errors in the navigation tree. The report that gets displayed has a table listing the pages that have produced the error codes so you can then go investigate those pages to see what may be causing the error.
Depending on your site the error might be perfectly normal, for example I have some custom HTTP handlers which implement a standardised HTTP protocol which actually specifies that 5xx errors should be thrown under certain circumstances.
Though this shouldn't apply to an internal only site on public websites it is sometimes the case that badly written crawlers will access your pages in such a way as to produce an error

Resources