Method calls don't return and page requires refresh (Heroku?)

I’m sorry I can’t find a better way of explaining the issue my app is running into. For months method calls have run, and on the callback (error or result) being called, a message would run or the page would redirect.

All of a sudden (with no apparent change in code), this has stopped happening. Seemingly the data gets added to the database but the redirect or error message never happen.

I’m wondering if this has anything to do with the stack being on Heroku. I’m not seeing any errors, or hard limits being reached though. Also there are no errors being logged that I can see.

Has anyone else run into anything similar? Either on Heroku or elsewhere? Or can give me a potential starting point for debugging? Thank you

If you do the following:

  1. open chrome dev tools
  2. select the network tab
  3. filter by “ws”
  4. refresh the page
  5. submit the method that doesn’t redirect as expected

Do you see any result/update response from the server?

We had a similar issue a while back, it was caused by the mongo primary failing over, writes still worked, but the oplog didn’t, so some method calls hung

1 Like

Thanks that’s great information, I was wondering if it could be mongo related, I think I need to upgrade our mlab plan on Heroku. I’d test your steps above but frustratingly it’s currently working ok.

The problem seems to come and go. I wonder whether it’s a possible “timeout” issue?

It’s possible, it depends on what type of timeout you’re talking about: a connection timeout should reconstruct the connection and retry the method (also visible from the websocket debugging). If it’s a mongo timeout, it should result in an error - but the timeouts are typically pretty long, how much work is being done in these methods?

It’s possible its a connection issue between server -> mlab, however this should create some logging, though it will likely be outside of your standard logging practices (e.g., not captured by Kadira, or custom logging), so you might need to connect to the server and get the console output to check

Thanks again, I’m trying to make sense of Heroku’s metrics graphs and I am seeing various incidents of timeouts but pretty hard to determine what’s causing them. Under normal operations these methods/writes are extremely simple and fast, certainly nothing which would take more than several hundred milliseconds at most.

I’m hoping it might be something to do with the mlab level the app is currently on which though it has enough storage, it’s advising against using it in production (the only reason I haven’t switched so far is it’s a manual process)

This is in Heroku docs about timeouts, I’m hoping it’s mlab that’s causing it

> Another class of timeouts occur when an external service used by your application is unavailable or 
  overloaded. In this case, your web app is highly likely to timeout unless you move the work to the 
  background