We have a plugin. Locally, it's working as expected.

When we push to dev, one of the actions begins to throw a 500 error.

The action is taking place via an ajax call, and the error in the console is:

POST http://website.com/admin/pluginName/controller/method 500 (Internal Server Error)

If I expand that error in the console, I see the following:

k.cors.a.crossDomain.send jquery-2.1.1.min.js?d=1421398025:4 
n.extend.ajax             jquery-2.1.1.min.js?d=1421398025:4 
n.(anonymous function)    controller:474 
(anonymous function)      jquery-2.1.1.min.js?d=1421398025:3 
n.event.dispatch          jquery-2.1.1.min.js?d=1421398025:3 
r.handle                  jquery-2.1.1.min.js?x=Q4rOzOLw2:3

Checking the Craft Error Logs I see:

Level: error
Category: exception.Guzzle\Http\Exception\ClientErrorResponseException
Message exception: 'Guzzle\Http\Exception\ClientErrorResponseException' with message 'Client error response

Any ideas on what is different about our dev environment vs. the local environment?

Any steps I can take to better diagnose how to solve this issue?

  • Is there any stack trace with the error in the logs?
    – Brad Bell
    Commented Jan 20, 2015 at 23:26

1 Answer 1


Brad's comment above helped us find the solution. I had been looking at the craft.log file in the control panel at /admin/utils and it doesn't output the stack trace. Look at the actual log file, we got more info on the issue which was that the ajax call was returning:

[status code] 401
[reason phrase] Unauthorized

The plugin on the site we have was trying to render a front-end template using Guzzle and the dev site is password protected, and the request was not making it through.

Possible solutions include:

  1. Updating the way the template is being processed to not require a front-end request
  2. Only use this functionality in locations that are not password protected
  3. Hurry up and finish the massive overhaul of the plugin you are working on so this issue doesn't exist any longer!

#3 it is!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.