Jump to content

Unable to complete this request due to an error


ryan
 Share

Recommended Posts

If you get this error message:

Unable to complete this request due to an error

That means that ProcessWire is in production mode (as it is by default) and is not reporting errors as a security best practice. However, if you are just installing ProcessWire or developing a site in it, this error message is hardly helpful. Here are three ways you can find out what error occurred:

  • Look at the last line in the file /site/assets/logs/errors.txt. You have to examine this file directly on your file system as PW makes this file non-web accessible.
  • If you entered your email address for the admin user account when you installed ProcessWire, it will email the fatal error message to you. Though if you are running PW on a machine that doesn't send email, that may not help.
  • Edit the file /site/config.php and change the line that says $config->debug = false; to: $config->debug = true; That will force PW to output it's error messages rather than saying "Unable to complete this request due to an error." Note however that you do not want "debug" turned on with a production site, as it's not good security to reveal technical details like this to users of your site.

Any one of the above 3 methods will reveal exactly what error occurred. Regardless of where you found it, the error message will include the following in this order (each separated by a colon ':')

  • Date and time that the error occurred
  • Current user when the error occurred
  • URL of the page that was being viewed
  • Detailed error message with PHP file, line number and sometimes a debug backtrace

Most often, examining the information above will make it clear what the problem is. However, if it doesn't, post your error message here (being careful not to reveal any personal server details). Or if you prefer, private-message it to me or email it to me at http://ryancramer.com/contact/.

Hope this helps a few people. I noticed repeat instances of "Unable to complete this request due to an error" in our Google Analytics, so it's clear some are experiencing this message and arriving at our site. I wanted to make sure we had a proper answer.

  • Like 2
Link to comment
Share on other sites

  • 3 years later...

Hello Ryan. I am perplexed. I transferred a site into a new server. I'm getting this error but nothing is written in the errors.txt file. The site works fine on my local machine. My IT team inspected every settings I made and everything is ok. Running 2.5.3. I cannot login either. Debug is set to true but to know avail.

I don't know what I am missing.

Ps: I have put the allowed addresses in the config file. While it is "tci" on my local machine, it is "tcidemo.innobec.com" on dev server.

Link to comment
Share on other sites

Did you try another index.php ?

Did you check on any database commands in your local database

that should not be there anymore in the server database ? E.g.

some CPanels don't like database commands created in a local

environment.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

I'm having the same issue Guy Verville had.

Downloaded a website from production to local, imported the database, changed mysql authentication on config.php (checked it thrice) and the same error occurs. Nothing on errors.txt, and changing debug to true adds nothing to the message.

I also changed permissions of everything to 775. Nothing seems to work.

I'm clueless.

*EDIT* : Also tried invalid DB login info to see if something would change. Nothing.

*EDIT 2* : Placing echos all over index.php I eventually narrowed it down and discovered the previous coder messed with the file. Problem fixed.

  • Like 1
Link to comment
Share on other sites

If there's nothing in the errors.txt the error does happen before pw's error handling kicks in. So probably some error either in config.php (simply checked by adding die() in various places and see if the error persists) or with any autoloading modules or in init.php. Also check your php/mysql/apache versions for any obvious mismatches.

  • Like 3
Link to comment
Share on other sites

  • 6 months later...
On 22 April 2016 at 4:52 PM, LostKobrakai said:

If there's nothing in the errors.txt the error does happen before pw's error handling kicks in. So probably some error either in config.php (simply checked by adding die() in various places and see if the error persists) or with any autoloading modules or in init.php. Also check your php/mysql/apache versions for any obvious mismatches.

Just spent an hour trying to work out why a site wouldn't load. Tried everything Ryan mentioned in this post and other posts. Was about to post a Support forum post when I saw LostKobrakai's suggestion last second.

Posted the php on an online php syntax checker and lord and behold, a single comma character was the culprit ...,...

Thanks Lostkobrakai for the suggestion

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...