Error at startup in setStatusCode, was working fine

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

I have a long running SS app with an outside developer who’s unavailable to help at the moment. My server became unresponsive and I rebooted, which usually works fine. This time the SS app won’t run due to this error:
Fatal error: Call to a member function setStatusCode() on a non-object in snip\framework\dev\Debug.php (snip/framework/dev/Debug.php/) on line 340

Six years ago this happened to someone on the forum, without resolution reported, here: All other Modules » Silverstripe CMS

I’m going to dive in and see what the issue might be, but I’m posting here to see if I can get any advice and also to post a resolution for posterity when I get it fixed.

Is there any more to that error? The stack trace should show where things are happening. I’m guessing that setStatusCode() is being called on something which is expected to be an HTTP response… but that isn’t being set properly.

I think it’s going to be case of working back in the stack trace to find out where the issue is. Has anything else changed? It’s quite unusual for things to just “stop working” without an underlying cause. Have there been any PHP version updates, etc.?

Closed. I jumped the gun in posting here, but maybe this why it never got answered six years ago.

Turned on debug mode, got a more meaningful reply that it couldn’t connect to the database. Found that MySQL couldn’t find the databases, even though it was properly configured to find them. Finally got a MySQL error from the terminal with an obscure message which google clarified as a User reached a hard open file limit error. Found a blog post on how to raise that limit (our database has grown over the years) and we were back live again before this posting came online at the forum. Thanks for being here, Silverstripe was and remains a good choice for our use case.

1 Like