Forums / General Questions / "Warning: An error occurred" and no debug logs

"Warning: An error occurred" and no debug logs

Views: 1,992

Results 1 to 14 of 14
24 Mar 2014, 7:08 PM
#1
emily avatar

emily

New Zenner

Join Date:
Oct 2004
Location:
Northeastern MN, USA
Posts:
59
Plugin Contributions:
0

"Warning: An error occurred" and no debug logs

I upgraded from 1.3.8 to 1.5.1 a few months ago and just recently the following started happening:

  • After order confirmation, the user gets the "Warning: An error occurred, please refresh" message. The user hits refresh and the order gets submitted twice.

  • Only one item from the order gets stored in the database, though all items get listed in PayPal or in Linkpoint.

I tried looking in both /cache/ and /logs/ for MyDebugxxxxxx.log and there aren't any in either place.

I'm not sure where to go next.

-emiLy & Ryan Quick
TheECstore.com

24 Mar 2014, 9:50 PM
#3
emily avatar

emily

New Zenner

Join Date:
Oct 2004
Location:
Northeastern MN, USA
Posts:
59
Plugin Contributions:
0

Re: "Warning: An error occurred" and no debug logs

The logs directory is writeable.

-emiLy & Ryan Quick
TheECstore.com

24 Mar 2014, 10:01 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: "Warning: An error occurred" and no debug logs

Check to see that your host hasn't disabled the ability to control the error-reporting capabilities of PHP. Take this code:

<?php
  define('DIR_FS_LOGS', 'c:/xampp/htdocs/test/logs');
  
  $debug_logfile_path = DIR_FS_LOGS . '/myDEBUG-' . time() . '-' . mt_rand(1000,999999) . '.log';

/**
 * Error reporting level to log
 * Default: E_ALL ^E_NOTICE
 */
  $errors_to_log = (version_compare(PHP_VERSION, 5.3, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE : version_compare(PHP_VERSION, 5.4, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT : E_ALL & ~E_NOTICE);


///// DO NOT EDIT BELOW THIS LINE /////

//////////////////// DEBUG HANDLING //////////////////////////////////

    ini_set('log_errors', '1');          // store to file
    ini_set('log_errors_max_len', '0');  // unlimited length of message output
    ini_set('display_errors', '0');      // do not output errors to screen/browser/client
    ini_set('error_log', $debug_logfile_path);  // the filename to log errors into
    ini_set('error_reporting', -1 ); // log only errors according to defined rules
 
 error_log ('did this get there?');
 
  
 echo 'log_errors: ' . ini_get ('log_errors') . "\n";
 echo 'log_errors_max_len: ' . ini_get ('log_errors_max_len') . "\n";
 echo 'display_errors: ' . ini_get ('display_errors') . "\n";
 echo 'error_log: ' . ini_get ('error_log') . "\n";
 echo 'error_reporting: ' . ini_get ('error_reporting');

Change the file-system path to that specified in your /includes/configure.php and save the file as some_special_filename.php in the root directory of your store. Navigate your browser to https://www.example.com/some_special_filename.php and make sure that the 'error_log" value displayed is the filepath that was set. Make sure to erase the file once you've run the test.

If the error_log directory doesn't match the DIR_FS_LOGS path, you should contact your webhost and ask them why they are preventing you from changing the error-reporting directives.

25 Mar 2014, 6:01 PM
#5
emily avatar

emily

New Zenner

Join Date:
Oct 2004
Location:
Northeastern MN, USA
Posts:
59
Plugin Contributions:
0

Re: "Warning: An error occurred" and no debug logs

Did that test (thank you!) and everything worked properly and it made a debug file in the logs folder. So apparently Zen Cart is not making the logs even though it should be capable of it. What do I look for next?

-emiLy & Ryan Quick
TheECstore.com

25 Mar 2014, 9:33 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: "Warning: An error occurred" and no debug logs

emiLy:

Did that test (thank you!) and everything worked properly and it made a debug file in the logs folder. So apparently Zen Cart is not making the logs even though it should be capable of it. What do I look for next?

While not privy to the plan considered by lat9 and anne, I would think something to try/check next wwould be to turn on logging for PayPal, attempt a transaction, and then turn off logging and report results (with whatever names obscured as desired.) Or if not at least that, then see if processing through a check/mail (sorry, forgot the specific term) to ensure that it is not something specifically ZC related.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

26 Mar 2014, 12:13 PM
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: "Warning: An error occurred" and no debug logs

emiLy:

Did that test (thank you!) and everything worked properly and it made a debug file in the logs folder. So apparently Zen Cart is not making the logs even though it should be capable of it. What do I look for next?
Re-check your /includes/configure.php file, to make sure that the DIR_FS_LOGS definition is exactly the same as the one you used in the test (no extra or missing /'s, for example).

28 Mar 2014, 3:09 AM
#8
emily avatar

emily

New Zenner

Join Date:
Oct 2004
Location:
Northeastern MN, USA
Posts:
59
Plugin Contributions:
0

Re: "Warning: An error occurred" and no debug logs

I didn't have a DIR_FS_LOGS definition in my configure.php file, so I added it. Still no logging taking place. Are there other definitions that are supposed to be in configure.php that govern logging? I don't know why it wasn't there in the first place.

-emiLy & Ryan Quick
TheECstore.com

28 Mar 2014, 3:23 AM
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: "Warning: An error occurred" and no debug logs

emiLy:

I didn't have a DIR_FS_LOGS definition in my configure.php file, so I added it. Still no logging taking place. Are there other definitions that are supposed to be in configure.php that govern logging? I don't know why it wasn't there in the first place.

Might I suggest that you "briefly" turn debug_autoload on? There may be an error that is occurring before the ZC error loader is able to detect and report. This can be done by going to your includes folder and modifying line 75 to a value of true from false. Load the page, then turn it off again by setting to false. Inspect the information presented to screen and compare to your configure.php file. This may be faster than trying to continue back and forth. Resolution should be provided back here to help others having a similar problem.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

28 Mar 2014, 3:33 AM
#10
emily avatar

emily

New Zenner

Join Date:
Oct 2004
Location:
Northeastern MN, USA
Posts:
59
Plugin Contributions:
0

Re: "Warning: An error occurred" and no debug logs

Line 75 of which file in the includes folder?

-emiLy & Ryan Quick
TheECstore.com

28 Mar 2014, 3:38 AM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: "Warning: An error occurred" and no debug logs

emiLy:

Line 75 of which file in the includes folder?

mc12345678:

Might I suggest that you "briefly" turn debug_autoload on? There may be an error that is occurring before the ZC error loader is able to detect and report. This can be done by going to your includes folder and modifying line 75 to a value of true from false. Load the page, then turn it off again by setting to false. Inspect the information presented to screen and compare to your configure.php file. This may be faster than trying to continue back and forth. Resolution should be provided back here to help others having a similar problem.

Doh, sorry. Can't you see my computer screen?! That would be line 75 of the application_top.php file found in the includes folder. (Different line number for the admin panel if had to do the same in the admin directory.

This may also not show the info needed to correct the issue, but is something that may show something. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Apr 2014, 4:52 PM
#12
emily avatar

emily

New Zenner

Join Date:
Oct 2004
Location:
Northeastern MN, USA
Posts:
59
Plugin Contributions:
0

Re: "Warning: An error occurred" and no debug logs

Finally getting back to this - I did the debug_autoload thing and I don't know if it gave me any clues. The last thing in the debug list, whether the page displays correctly or not, is:

actionPoint=>190 $products_viewed_counter = new_viewed_counter();

If the page won't display properly, I just get the Warning: An Error Occurred message after that.

-emiLy & Ryan Quick
TheECstore.com

2 Apr 2014, 5:18 PM
#13
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: "Warning: An error occurred" and no debug logs

emiLy:

Finally getting back to this - I did the debug_autoload thing and I don't know if it gave me any clues. The last thing in the debug list, whether the page displays correctly or not, is:

actionPoint=>190 $products_viewed_counter = new_viewed_counter();

If the page won't display properly, I just get the Warning: An Error Occurred message after that.

The "error" may actually be in lines before the last line. I once found that the FS path wasn't properly identified in the configure.php by looking at one of the early lines and seeing that a slash was missing. But there waas a whole lot of other things on screen as well. Btw, again, be sure to turn that off once you've seen the result(s)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Apr 2014, 6:37 PM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: "Warning: An error occurred" and no debug logs

What's your PHP version?
What are ALL the plugins/addons/modules you've added to your site? (that's most likely where your problem is, especially related to checkout)
Do you get any of these same errors on the Admin side?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.