0

I'm trying to put my webapp online using heroku.

Everything gone fine, until I do some GET/POST method request. Then it returns a 500 or 503 error.

When I do it locally, it works. But when I send the request in heroku, it doesn't.

[OBS.: I'm trying to do the request with postman too... Same error!]

Is it some kind of permission, maybe? Cross-domain request?

I don't know about it very much...

2015-07-23T18:58:33.476410+00:00 app[web.1]: 10.123.198.169 - - [23/Jul/2015:18:57:48 +0000] "GET /backend/public/index.php/api/excel HTTP/1.1" 200 146079 "http://heinz.herokuapp.com/public/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36
2015-07-23T19:00:35.115264+00:00 heroku[router]: at=info method=GET path="/backend/public/index.php/api/txt" host=heinz.herokuapp.com request_id=334dfd15-e371-4e2b-a455-9feabd33fc42 fwd="200.9.124.34" dyno=web.1 connect=2ms service=51ms status=500 bytes=4784
2015-07-23T19:00:35.107136+00:00 app[web.1]: 10.69.166.135 - - [23/Jul/2015:19:00:35 +0000] "GET /backend/public/index.php/api/txt HTTP/1.1" 500 4519 "http://heinz.herokuapp.com/public/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36
2015-07-23T19:01:05.036183+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/backend/public/index.php/api/excel" host=heinz.herokuapp.com request_id=1963804e-6ed9-4dcb-9099-c91b1bfb3448 fwd="200.9.124.34" dyno=web.1 connect=3ms service=30001ms status=503 bytes=0
2015-07-23T19:01:15.770662+00:00 app[web.1]: 10.136.104.47 - - [23/Jul/2015:19:00:35 +0000] "GET /backend/public/index.php/api/excel HTTP/1.1" 200 146079 "http://heinz.herokuapp.com/public/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36

$scope.putTheThingsOnline = function() {
      $http.get('../backend/public/index.php/api/excel').success(function() {});
      $http.get('../backend/public/index.php/api/txt').success(function() {
        return alert('Dados inseridos');
      });
      return alert('hello!');
    };
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>

[UPDATE]

I found the error, now I'm trying to get the solution. Here the real problem!

Looks like the problem is in the code, but I'm trying to solve it for a long time and nothing...

Community
  • 1
  • 1
Leo Ribeiro
  • 1,195
  • 1
  • 14
  • 25
  • There isn't enough information here to solve your problem. You need to figure out what error is being thrown that ultimately results in a 500 status code being returned to the client. The 503 is likely a side effect caused by the preceding 500. – Kevin B Jul 23 '15 at 19:29
  • Ok! Sorry, I'll put some more code here. Just a sec.. – Leo Ribeiro Jul 23 '15 at 19:34

1 Answers1

2

The fact that your app is deployed to Heroku doesn't seem to be the problem, the error codes you are getting are http errors and most likely are coming from inside of application.

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

If it were a heroku issue you would get error which belongs to codes starting with H or R or L - https://devcenter.heroku.com/articles/error-codes.

There could be several reasons for you to encounter this issue. I recommend checking heroku logs when you are trying to sent request to your app. - https://devcenter.heroku.com/articles/logging#log-retrieval

abhishek77in
  • 1,848
  • 21
  • 41