Soundcloud embed Timeout & wget returning Error 500 - embed

I have a wordpress blog in a VPS (Centos 6.8 x86) which some pages have a soundcloud embed. Whenever I try to view one of this pages, I receive a timeout error (http://prntscr.com/bpmm90).
GET
http://soundcloud.com/oembed
?maxwidth=0
&maxheight=0
&url=https%3A%2F%2Fsoundcloud.com%2F10de10%2Fsemana-dos-10-20-270616
&format=json
Operation timed out after 5000 milliseconds with 0 bytes received
Ok, I thought maybe I was doing something wrong in Wordpress, so I tried to 'wget' the same URL and... ERROR 500.
wget 'http://soundcloud.com'
--2016-07-06 18:46:01-- http://soundcloud.com/
Resolving soundcloud.com... 72.21.91.127
Connecting to soundcloud.com|72.21.91.127|:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2016-07-06 18:46:31 ERROR 500: Internal Server Error.
However, it all works fine if I try the same things on another server. I've already thought about if I was somehow blocked from accesing soundcloud through my VPS, but I barely did any call to the service.
The url in question is: http://soundcloud.com/oembed?maxwidth=0&maxheight=0&url=https%3A%2F%2Fsoundcloud.com%2F10de10%2Fsemana-dos-10-20-270616&format=json

Related

Heroku app: Error during WebSocket handshake: Unexpected response code: 200

I followed a tutorial on how to make a multiplayer tetris game, here is the repo:
https://github.com/Leftier/tetris
It worked just fine on localhost so I tried to deploy it in heroku (https://tetrixtest.herokuapp.com/ --ASD to move Q/E to rotate) but I get the following error:
WebSocket connection to 'wss://tetrixtest.herokuapp.com/' failed: Error during WebSocket handshake: Unexpected response code: 200
while trying to create the webSocket in this line (connection-manager.js line 14):
this.conn = new WebSocket(`wss://${window.location.hostname}:${window.location.port}`)
I don't know much about webSockets,
at first I thought that heroku was not able to handle websockets but that wasn't the case so I tried using the link directly as an argument instead of reading it from the browser but still the same issue.
I would like some clues/hints about why does this happens, I searched in google and github, but I only found issues related to socket.io
For me the solution was to turn on "Session affinity" by running this command heroku features:enable http-session-affinity
More info at https://devcenter.heroku.com/articles/session-affinity
Session affinity, sometimes referred to as sticky sessions, is a
platform feature that associates all HTTP requests coming from an
end-user with a single application instance (web dyno).

How do I change a 500 error into a 404 error and show a custom page?

I just launched a site and when I go to a non-existing page, I get a 500 Internal Server error instead of a 404 errror.
I was thinking that this was because I didn't have a 404.html page (just a guess), but I just created a 404.html page at the root and I still get 500 errors.
What should I do to make it so that when somebody types in a bad address they get redirected to my custom 404 error page?
There is no special stuff going on with my site, just HTML, CSS and a tiny bit of javaScript. Not a Rails app, not a Wordpress site, no PHP, etc. ..just HTML files on an Apache server.
The error I get when I go to a non-existing page or directory reads like this"
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator,
webmaster#subdomain.domain.com and inform them of the time the
error occurred, and anything you might have done that may have caused
the error.
More information about this error may be available in the server error
log.
Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.
After you have the Error 500 problem solved you can create a custom 404 page by editing your .htaccess file you should have one in the root of your directory.
Open the file with a text editor and add this:
ErrorDocument 404 http://www.yourwebsite.com/404page.html
You could also create a custom Error 500 by changing the above code to suite your needs.
It's pretty self explanatory but the last part is the directory that users will be directed to after they receive a 404 error.

502 (BAD GATEWAY) and 504 (GATEWAY TIMEOUT) in Wirecloud

Time ago we set up a PEP proxy to secure the API our widgets are using. All have being working correctly until today, that we are receiving a 502 Bad Gateway error code for every call going through the proxy.
We have checked the requests are reaching our server and it is responsing correctly to them. The parameters added by the proxy (x-nick-name, x-display-name...) are defined correctly too.
We have also checked the requests outside wirecloud and all go well: we get the token properly and use it in the subsequent calls without problem.
We do not know where this error comes from, any ideas?
EDIT 06/11/2015
After Alvaro's new setting we are receiving the following error in the response body:
{
"description": "Connection Error",
"details": "('Connection aborted.', error(104, 'Connection reset by peer'))"
}
EDIT 09/11/15
Today, the code received in the request's response is different: 504 GATEWAY TIMEOUT
{
"description": "Connection Error",
"details": "('Connection aborted.', error(104, 'Connection reset by peer'))"
}
EDIT 16/11/15
Answering to Mr. Alonso's question:
1.- If we request directly to the server, the response is correctly displayed in the application.
2.- Here you can see the logs from the PEP Proxy with the new line added. As you can see the request is redirected correctly but the info is not displayed in the app.
Seems that the problem is in the PEP proxy side.
I've checked using other tools like curl (I obtained the connection details from the server log). Making the same request using curl gives the same result than using WireCloud: connection reset by peer. Also, if I make the request without the X-Auth-Token header, your service responds with an 401 error code. This is important, because it means that there is not a communication problem between the Mashup portal and your server. I don't know why, but the PEP proxy seems to be crashing when making the authenticated request from the Mashup portal (the same command works executing it from my machine).
I suggest you to restart the PEP proxy. If the problem persist, please attach any available info about the crash from the PEP proxy logs.
You can check three things to give us more information:
Try to remove the PEP and send the request directly to your service.
Introduce a new log in PEP to print the headers of the response: line 41 of lib/HTTPClient.js, log.debug("Headers: ", headers);
Try to send a request to the root path (directly to the tomacat or apache)
If not perhaps we can talk in private to check more information

SQL Insert committed but not found on next request?

I have placed an after_commit callback in the RequestToken model that outputs "Committed Request Token xx". You can see in the log I included below, that the token record is committed and the next request the lookup on the object says it cannot be found. The issue occurs intermittently and if I refresh the page the record is found and the request goes through.
Environment
AWS EC2 + RDS, Ubuntu 10.04, Rails 3.2.8, MySQL2 0.3.11 gem, apache2 2.2.14, phusion passenger 3.0.11
Has anyone seen this before? Any suggestions?
Committed Request Token S8j311QckvEjnDftNW0e7FPHsavGWTelONcsE3X1
Rendered text template (0.0ms)
Completed 200 OK in 28ms (Views: 0.6ms | ActiveRecord: 21.8ms | Sphinx: 0.0ms)
Started GET "/oauth/authorize?oauth_token=S8j311QckvEjnDftNW0e7FPHsavGWTelONcsE3X1" for 96.236.148.63 at 2012-10-15 22:07:32 +0000
Processing by OauthController#authorize as HTML
Parameters: {"oauth_token"=>"S8j311QckvEjnDftNW0e7FPHsavGWTelONcsE3X1"}
Completed 500 Internal Server Error in 5ms
ActiveRecord::RecordNotFound (Couldn't find RequestToken with token = S8j311QckvEjnDftNW0e7FPHsavGWTelONcsE3X1):
200 Doesn't mean it saved. Probably failed a validation.

nginx modifying the jsonp response message

We are creating a web api application. In one of our API's if there are any validation errors, we are returning the error message in JSONP format. In the API Request URL user adds a query string parameter ?jsoncallback=xxxxxxxxxx like this.
On validation failure we are throwing a 400 bad request JSONP with response message in the below format:
xxxxxxxxxx({"error","error message"})
It is working good in all the environments, where there is no nginx. In our staging environment we have nginx configured.
Here it is modifying the output as below:
badrequest{"error","error message"})
Because of this our front end application is unable to read the response message.
Could you please let me know, what configuration setting of nginx could cause this problem?
Thanks in Advance
Venkat.
Actually the problem is not due to nginx.
It is due to IIS 7.5 in our staging server which is causing the problem.
Below configuration change in web.config has fixed it.
<httpErrors errorMode="Detailed" />