0

I'm having a problem with an existing Mojolicous app. I have added some new routes, views, controllers, and models, and am returning database results to view using Rose::DB::Object ORM.

I updated the production version today with code that had been working great on Morbo. But, on apache2/plack/psgi mod_perl config the new Models are only returning the queries about 1 in 5 sometimes 1 in 10 times.

I've eliminated a number of variables, like I can query the database directly and get my results no problem. Older Model's and their queries always work.

It appears that only this new functionality is intermittent. I have narrowed requests to only one server and have restarted apache. But, am now at the point that I don't understand why the issue is persisting.

I think this is some kind of mod_perl wonky behavior, but don't know why an apache restart doesn't fix it.

Any help or ideas would be awesome.

dudeman
  • 503
  • 3
  • 11
  • Are there any error messages in the logs? – alexk Mar 17 '15 at 11:28
  • The error I get in the logs is at the view. I get a variable not imported error (Variable "$tag" is not imported). Which is really weird because even if the query that populates that variable in the controller comes back empty it would still be imported. So, what I think is that there is old code answering these requests. But, I don't know how to find and fix that. – dudeman Mar 17 '15 at 14:36
  • Update on this. I put a die in the controller, restarted apache, and noted that it shows in the logs intermittently. – dudeman Mar 17 '15 at 15:27

1 Answers1

0

I did finally resolve this and it turned out to be something simple. I was missing the use statement for my controller in my main application script. The script where I setup the routes. I'm not sure I understand why it was working intermittently in production and working all the time in development. But, once I added:

use TheApp::Controller::Tags; in the main app pm it worked consistently.

In retrospect it feels like I should have figured it out sooner, but the fact that it worked part of the time led me down the wrong path. Hopefully this will help someone else sometime.

dudeman
  • 503
  • 3
  • 11