Apache::ASP Powered by ModPerl & Apache Powered by Apache::ASP
Demo ASP: syntax_error.asp 2018-09-19

We are creating a perl syntax error... this should demonstrate how error handling is done. Please check the error log file if you are interested in the output there.

You can turn this error messaging off by setting the Debug variable in the ASP config to 1 or 0.

Also here is an example of how you can use debugging, an API extension $Response->Debug(@args), in your script. The debug output will show up below, and in your error logs. This user style debugging is turned off with the same Debug setting set to 0.

Try this script also with buffering on.

This script by default does a runtime syntax error. If you would like to see a script compile error, click here.

view this file's source

Errors Output

  1. error including compile_error.inc, not compiled: Bareword "code" not allowed while "strict subs" in use at /usr/local/proj/asp/eg/compile_error.inc line 5. , /usr/local/share/perl5/Apache/ASP.pm line 1522
Debug Output
  1. RUN ASP (v2.63) for /usr/local/proj/asp/eg/syntax_error.asp
  2. call srand() post fork
  3. GlobalASA package Apache::ASP::Demo
  4. global.asa was not cached for __ASP__usr_local_proj_asp_eg__xxApache::ASP::Demo
  5. compiling global.asa Apache::ASP::Demo __ASP__usr_local_proj_asp_eg__xxApache::ASP::Demo exists 1 - asp: Apache::ASP=HASH(0x5630ff7b1ee0); compiled: HASH(0x5630ff7ad8b8); exists: 1; package: Apache::ASP::Demo; - --- - exists: 0; mtime: 0;
  6. global.asa routines - Application_OnEnd: 1; Application_OnStart: 1; Script_OnEnd: 1; Script_OnFlush: 1; Script_OnStart: 1; Session_OnEnd: 1; Session_OnStart: 1;
  7. creating dbm for file /tmp/asp_demo/server/internal, db SDBM_File, serializer: Data::Dumper
  8. creating dbm for file /tmp/asp_demo/server/application, db SDBM_File, serializer: Data::Dumper
  9. refreshing 00ac694199f772dd5ba52ada22e2abbf with timeout 1537378900
  10. new session id 00ac694199f772dd5ba52ada22e2abbf
  11. creating dbm for file /tmp/asp_demo/00/00ac694199f772dd5ba52ada22e2abbf, db SDBM_File, serializer: Data::Dumper
  12. tieing session 00ac694199f772dd5ba52ada22e2abbf
  13. clearing starting session
  14. forcing groups cleanup
  15. testing internal time for cleanup groups
  16. current_master - Checked: 1537378268; PID: 20333; ServerID: 5926a0ce1244e405; - is_master - 0
  17. 1537378290 time is stale, is_master 0 - Checked: 1537378268; PID: 20333; ServerID: 5926a0ce1244e405;
  18. is_master 1 after update 3c7a196adb2695d6 - 20440
  19. groups - 0e; 01; 0d; 0a; 00; 0c; 02; 08; 03; 09; 07; 0b; 0f; 04; 06; 05
  20. group check 0e, next in 6 sec
  21. checking group ids -
  22. group check 01, next in 13 sec
  23. checking group ids -
  24. group check 0d, next in 16 sec
  25. checking group ids - 0db74aeae4667667ea611f14779b9f56; 0df328ad6c9d2d3f65e7e5303068ba58
  26. resetting timeout for deletion lock on 0db74aeae4667667ea611f14779b9f56
  27. creating dbm for file /tmp/asp_demo/0d/0db74aeae4667667ea611f14779b9f56, db SDBM_File, serializer: Data::Dumper
  28. Session_OnEnd - session: 0db74aeae4667667ea611f14779b9f56;
  29. executing Session_OnEnd
  30. creating dbm for file /tmp/asp_demo/0d/0db74aeae4667667ea611f14779b9f56, db SDBM_File, serializer: Data::Dumper
  31. deleting session - files_deleted: 1; session_id: 0db74aeae4667667ea611f14779b9f56;
  32. resetting timeout for deletion lock on 0df328ad6c9d2d3f65e7e5303068ba58
  33. creating dbm for file /tmp/asp_demo/0d/0df328ad6c9d2d3f65e7e5303068ba58, db SDBM_File, serializer: Data::Dumper
  34. Session_OnEnd - session: 0df328ad6c9d2d3f65e7e5303068ba58;
  35. executing Session_OnEnd
  36. creating dbm for file /tmp/asp_demo/0d/0df328ad6c9d2d3f65e7e5303068ba58, db SDBM_File, serializer: Data::Dumper
  37. deleting session - files_deleted: 1; session_id: 0df328ad6c9d2d3f65e7e5303068ba58;
  38. group check 0a, next in 27 sec
  39. checking group ids -
  40. group check 00, next in 21 sec
  41. checking group ids - 00ac694199f772dd5ba52ada22e2abbf
  42. 00ac694199f772dd5ba52ada22e2abbf not timed out with 1537378900
  43. group check 0c, next in 28 sec
  44. checking group ids -
  45. group check 02, next in 15 sec
  46. checking group ids - 027f00acb971dd9d0ca92ba0685477ba; 02c79f17a90977bede8c532d70daad1a
  47. resetting timeout for deletion lock on 027f00acb971dd9d0ca92ba0685477ba
  48. creating dbm for file /tmp/asp_demo/02/027f00acb971dd9d0ca92ba0685477ba, db SDBM_File, serializer: Data::Dumper
  49. Session_OnEnd - session: 027f00acb971dd9d0ca92ba0685477ba;
  50. executing Session_OnEnd
  51. creating dbm for file /tmp/asp_demo/02/027f00acb971dd9d0ca92ba0685477ba, db SDBM_File, serializer: Data::Dumper
  52. deleting session - files_deleted: 1; session_id: 027f00acb971dd9d0ca92ba0685477ba;
  53. resetting timeout for deletion lock on 02c79f17a90977bede8c532d70daad1a
  54. creating dbm for file /tmp/asp_demo/02/02c79f17a90977bede8c532d70daad1a, db SDBM_File, serializer: Data::Dumper
  55. Session_OnEnd - session: 02c79f17a90977bede8c532d70daad1a;
  56. executing Session_OnEnd
  57. creating dbm for file /tmp/asp_demo/02/02c79f17a90977bede8c532d70daad1a, db SDBM_File, serializer: Data::Dumper
  58. deleting session - files_deleted: 1; session_id: 02c79f17a90977bede8c532d70daad1a;
  59. group check 08, next in 1 sec
  60. checking group ids -
  61. group check 03, next in 15 sec
  62. checking group ids - 033424aae4aa1ce1ed26cd7aa6f054df
  63. resetting timeout for deletion lock on 033424aae4aa1ce1ed26cd7aa6f054df
  64. creating dbm for file /tmp/asp_demo/03/033424aae4aa1ce1ed26cd7aa6f054df, db SDBM_File, serializer: Data::Dumper
  65. Session_OnEnd - session: 033424aae4aa1ce1ed26cd7aa6f054df;
  66. executing Session_OnEnd
  67. creating dbm for file /tmp/asp_demo/03/033424aae4aa1ce1ed26cd7aa6f054df, db SDBM_File, serializer: Data::Dumper
  68. deleting session - files_deleted: 1; session_id: 033424aae4aa1ce1ed26cd7aa6f054df;
  69. group check 09, next in 11 sec
  70. checking group ids -
  71. group check 07, next in 22 sec
  72. checking group ids -
  73. group check 0b, next in 1 sec
  74. checking group ids -
  75. group check 0f, next in 25 sec
  76. checking group ids - 0fa90933e44ec6176322a0956c05d4c5
  77. resetting timeout for deletion lock on 0fa90933e44ec6176322a0956c05d4c5
  78. creating dbm for file /tmp/asp_demo/0f/0fa90933e44ec6176322a0956c05d4c5, db SDBM_File, serializer: Data::Dumper
  79. Session_OnEnd - session: 0fa90933e44ec6176322a0956c05d4c5;
  80. executing Session_OnEnd
  81. creating dbm for file /tmp/asp_demo/0f/0fa90933e44ec6176322a0956c05d4c5, db SDBM_File, serializer: Data::Dumper
  82. deleting session - files_deleted: 1; session_id: 0fa90933e44ec6176322a0956c05d4c5;
  83. group check 04, next in 9 sec
  84. checking group ids -
  85. group check 06, next in 14 sec
  86. checking group ids - 06014a03293b1a42041b7813b0ac9c6a
  87. resetting timeout for deletion lock on 06014a03293b1a42041b7813b0ac9c6a
  88. creating dbm for file /tmp/asp_demo/06/06014a03293b1a42041b7813b0ac9c6a, db SDBM_File, serializer: Data::Dumper
  89. Session_OnEnd - session: 06014a03293b1a42041b7813b0ac9c6a;
  90. executing Session_OnEnd
  91. creating dbm for file /tmp/asp_demo/06/06014a03293b1a42041b7813b0ac9c6a, db SDBM_File, serializer: Data::Dumper
  92. deleting session - files_deleted: 1; session_id: 06014a03293b1a42041b7813b0ac9c6a;
  93. group check 05, next in 10 sec
  94. checking group ids - 05710d41046c00fe43b883a2fcbcb3d4; 05e18e57a51c96a4aa36e9bc2aa34843
  95. resetting timeout for deletion lock on 05710d41046c00fe43b883a2fcbcb3d4
  96. creating dbm for file /tmp/asp_demo/05/05710d41046c00fe43b883a2fcbcb3d4, db SDBM_File, serializer: Data::Dumper
  97. Session_OnEnd - session: 05710d41046c00fe43b883a2fcbcb3d4;
  98. executing Session_OnEnd
  99. creating dbm for file /tmp/asp_demo/05/05710d41046c00fe43b883a2fcbcb3d4, db SDBM_File, serializer: Data::Dumper
  100. deleting session - files_deleted: 1; session_id: 05710d41046c00fe43b883a2fcbcb3d4;
  101. resetting timeout for deletion lock on 05e18e57a51c96a4aa36e9bc2aa34843
  102. creating dbm for file /tmp/asp_demo/05/05e18e57a51c96a4aa36e9bc2aa34843, db SDBM_File, serializer: Data::Dumper
  103. Session_OnEnd - session: 05e18e57a51c96a4aa36e9bc2aa34843;
  104. executing Session_OnEnd
  105. creating dbm for file /tmp/asp_demo/05/05e18e57a51c96a4aa36e9bc2aa34843, db SDBM_File, serializer: Data::Dumper
  106. deleting session - files_deleted: 1; session_id: 05e18e57a51c96a4aa36e9bc2aa34843;
  107. cleanup groups - deleted: 2;
  108. Application_OnEnd
  109. executing Application_OnEnd
  110. Application_OnStart
  111. executing Application_OnStart
  112. Session_OnStart - session: 00ac694199f772dd5ba52ada22e2abbf;
  113. executing Session_OnStart
  114. updating LastSessionTimeout from 1537378598
  115. parse file /usr/local/proj/asp/eg/syntax_error.asp
  116. parsing /usr/local/proj/asp/eg/syntax_error.asp
  117. found header.inc at /usr/local/proj/asp/eg/header.inc
  118. runtime exec of dynamic include header.inc args ()
  119. parse file /usr/local/proj/asp/eg/header.inc
  120. parsing /usr/local/proj/asp/eg/header.inc
  121. start parse of data - 1145
  122. undefing sub Apache::ASP::Demo::__ASP__usr_local_proj_asp_eg_header_incx3436ef45a26199e890479d9a7f0923bcxINC code CODE(0x5630ffee7ff0)
  123. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP__usr_local_proj_asp_eg_header_incx3436ef45a26199e890479d9a7f0923bcxINC]
  124. start parse of data - 1484
  125. undefing sub Apache::ASP::Demo::__ASP__local_proj_asp_eg_synta__error_aspx912a61bdf9084209b6314417f66088c7xINC code CODE(0x5630ffee8128)
  126. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP__local_proj_asp_eg_synta__error_aspx912a61bdf9084209b6314417f66088c7xINC]
  127. register include /usr/local/proj/asp/eg/header.inc with success
  128. parse file /usr/local/proj/asp/eg/compile_error.inc
  129. parsing /usr/local/proj/asp/eg/compile_error.inc
  130. start parse of data - 116
  131. undefing sub Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC code CODE(0x5630ffef8e20)
  132. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC]
  133. undefing sub Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC code CODE(0x5630ffef8e20)
  134. register include compile_error.inc with error:
  135. Script_OnStart
  136. executing Script_OnStart
  137. [syntax_error.asp] - Script_OnStart /usr/local/proj/asp/eg/syntax_error.asp in global.asa
  138. executing Apache::ASP::Demo::__ASP__local_proj_asp_eg_synta__error_aspx912a61bdf9084209b6314417f66088c7xINC
  139. Script_OnFlush
  140. executing Script_OnFlush
  141. [syntax_error.asp] - Script_OnFlush: about to flush 1 bytes to client
  142. building headers
  143. sending cgi headers
  144. executing Apache::ASP::Demo::__ASP__usr_local_proj_asp_eg_header_incx3436ef45a26199e890479d9a7f0923bcxINC
  145. Script_OnFlush
  146. executing Script_OnFlush
  147. [syntax_error.asp] - Script_OnFlush: about to flush 871 bytes to client
  148. Script_OnFlush
  149. executing Script_OnFlush
  150. [syntax_error.asp] - Script_OnFlush: about to flush 82 bytes to client
  151. done executing include code Apache::ASP::Demo::__ASP__usr_local_proj_asp_eg_header_incx3436ef45a26199e890479d9a7f0923bcxINC
  152. Script_OnFlush
  153. executing Script_OnFlush
  154. [syntax_error.asp] - Script_OnFlush: about to flush 537 bytes to client
  155. [syntax_error.asp] - Debugging - can; take - just: about; - any; kind - of reference - or scalar
  156. Script_OnFlush
  157. executing Script_OnFlush
  158. [syntax_error.asp] - Script_OnFlush: about to flush 77 bytes to client
  159. Script_OnFlush
  160. executing Script_OnFlush
  161. [syntax_error.asp] - Script_OnFlush: about to flush 269 bytes to client
  162. parse file /usr/local/proj/asp/eg/compile_error.inc
  163. parsing /usr/local/proj/asp/eg/compile_error.inc
  164. start parse of data - 116
  165. undefing sub Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC code CODE(0x5630ffef8e20)
  166. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC]
  167. undefing sub Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC code CODE(0x5630ffef8e20)
  168. error including compile_error.inc, not compiled: Bareword "code" not allowed while "strict subs" in use at /usr/local/proj/asp/eg/compile_error.inc line 5. , /usr/local/share/perl5/Apache/ASP.pm line 1522
  169. ASP Done Processing Apache::ASP=HASH(0x5630ff7b1ee0) - Application: Apache::ASP::Application=HASH(0x5630ffe47158); GlobalASA: Apache::ASP::GlobalASA=HASH(0x5630ff7adf30); Internal: Apache::ASP::State=HASH(0x5630ffa085b0); Request: Apache::ASP::Request=HASH(0x5630ffeae278); Response: Apache::ASP::Response=HASH(0x5630ffec58c0); Server: Apache::ASP::Server=HASH(0x5630ffeae080); Session: Apache::ASP::Session=HASH(0x5630ffe273b8); app_state: 1; basename: syntax_error.asp; cleanup: ARRAY(0x5630ff5204c0); compile_checksum: 3436ef45a26199e890479d9a7f0923bc; compile_error: 1; compile_eval: SCALAR(0x5630ffef8df0); compile_includes: 1; compile_perl_count: 4; cookie_domain: ; cookie_path: /; dbg: 3; debugs_output: ARRAY(0x5630ff7b1eb0); destroy: 1; dir_config: APR::Table=HASH(0x5630ff4de8c8); dirname: /usr/local/proj/asp/eg/; errors_output: ARRAY(0x5630ffef9390); errs: 1; filename: /usr/local/proj/asp/eg/syntax_error.asp; global: /usr/local/proj/asp/eg//.; global_package: Apache::ASP::Demo; group_refresh: 30; headers_in: APR::Table=HASH(0x5630ff4de910); http_only_session: ; includes_dir: ARRAY(0x5630ff7b1ef8); init_packages: ARRAY(0x5630ffec5728); inode_names: 0; internal_cached_keys: HASH(0x5630ffedd1f0); lang_comment: #; lang_language: PerlScript; lang_module: Apache::ASP::Lang::PerlScript; lang_object: Apache::ASP::Lang::PerlScript=HASH(0x5630ff785980); last_compile_include_data: HASH(0x5630ffee8110); last_time: 1537378600.3630; no_cache: 0; package: Apache::ASP::Demo; paranoid_session: ; parse_config: 1; parse_file_count: 4; pod_comments: 1; r: Apache2::RequestRec=SCALAR(0x5630ff4a9ea8); register_includes: HASH(0x5630ffee80f8); remote_ip: 54.80.83.123; request_binary_read: 1; response_tied: 1; run_perl_script: SCALAR(0x5630ffee8098); search_dirs_cache: HASH(0x5630ffed4be8); secure_session: ; session_count: 1; session_id: 00ac694199f772dd5ba52ada22e2abbf; session_serialize: ; session_state: 1; session_timeout: 300; session_url: 1; session_url_force: ; session_url_match: ; session_url_parse: 0; session_url_parse_match: ; start_time: 1537378600.33773; stat_inc: 0; stat_inc_match: 0; stat_scripts: 1; state_db: ; state_dir: /tmp/asp_demo; state_manager: 10; state_serialize: ; state_serializer: ; ua: CCBot/2.0 (https://commoncrawl.org/faq/); use_strict: 1; win32: 0; xml_subs_match: my:\w+; xml_subs_perl_args: 1; xml_subs_strict: ; xslt: 0;
  170. errors out
  171. error including compile_error.inc, not compiled: Bareword "code" not allowed while "strict subs" in use at /usr/local/proj/asp/eg/compile_error.inc line 5. , /usr/local/share/perl5/Apache/ASP.pm line 1522
Compiled Data with Error 

  -: package Apache::ASP::Demo; ;; sub Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC {  ;; package Apache::ASP::Demo; ;; use strict;;;use vars qw($Application $Session $Response $Server $Request);;
  -: #line 1 /usr/local/proj/asp/eg/compile_error.inc
  1: ;;&Apache::ASP::WriteRef($main::Response, \('
  2: This next code block contains invalid perl code that will
  3: generate a compile time error.
  4: ')); 
  5:  invalid perl code;
  6: ;  ;; }


An error has occured with the Apache::ASP script just run. If you are the developer working on this script, and cannot work through this problem, please try researching it at the Apache::ASP web site, specifically the FAQ section. Failing that, check out your support options, and if necessary include this debug output with any query.