Apache::ASP Powered by ModPerl & Apache Powered by Apache::ASP
Demo ASP: syntax_error.asp 2021-09-23

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. GlobalASA package Apache::ASP::Demo
  3. creating dbm for file /tmp/asp_demo/server/internal, db SDBM_File, serializer: Data::Dumper
  4. creating dbm for file /tmp/asp_demo/server/application, db SDBM_File, serializer: Data::Dumper
  5. refreshing 083591d3a5e3cbf06c15e101380eeb55 with timeout 1632375656
  6. new session id 083591d3a5e3cbf06c15e101380eeb55
  7. creating dbm for file /tmp/asp_demo/08/083591d3a5e3cbf06c15e101380eeb55, db SDBM_File, serializer: Data::Dumper
  8. tieing session 083591d3a5e3cbf06c15e101380eeb55
  9. clearing starting session
  10. forcing groups cleanup
  11. testing internal time for cleanup groups
  12. current_master - Checked: 1632374713; PID: 16953; ServerID: b6f74f6c78b97528; - is_master - 0
  13. 1632374743 time is stale, is_master 0 - Checked: 1632374713; PID: 16953; ServerID: b6f74f6c78b97528;
  14. is_master 1 after update bbf0c9532bae3cbe - 16954
  15. groups - 0e; 01; 0d; 0a; 00; 0c; 02; 08; 03; 09; 07; 0b; 0f; 04; 06; 05
  16. group check 0e, next in 13 sec
  17. checking group ids -
  18. group check 01, next in 18 sec
  19. checking group ids -
  20. group check 0d, next in 9 sec
  21. checking group ids -
  22. group check 0a, next in 27 sec
  23. checking group ids -
  24. group check 00, next in 17 sec
  25. checking group ids -
  26. group check 0c, next in 20 sec
  27. checking group ids -
  28. group check 02, next in 19 sec
  29. checking group ids - 029fce08446de993485669c15bd1acb4
  30. resetting timeout for 029fce08446de993485669c15bd1acb4 to 1632375656
  31. group check 08, next in 26 sec
  32. checking group ids - 083591d3a5e3cbf06c15e101380eeb55
  33. 083591d3a5e3cbf06c15e101380eeb55 not timed out with 1632375656
  34. group check 03, next in 16 sec
  35. checking group ids - 03b939dd1b6ba8cac6c3fd7d96817eb5
  36. resetting timeout for deletion lock on 03b939dd1b6ba8cac6c3fd7d96817eb5
  37. creating dbm for file /tmp/asp_demo/03/03b939dd1b6ba8cac6c3fd7d96817eb5, db SDBM_File, serializer: Data::Dumper
  38. Session_OnEnd - session: 03b939dd1b6ba8cac6c3fd7d96817eb5;
  39. executing Session_OnEnd
  40. creating dbm for file /tmp/asp_demo/03/03b939dd1b6ba8cac6c3fd7d96817eb5, db SDBM_File, serializer: Data::Dumper
  41. deleting session - files_deleted: 1; session_id: 03b939dd1b6ba8cac6c3fd7d96817eb5;
  42. group check 09, next in 14 sec
  43. checking group ids -
  44. group check 07, next in 5 sec
  45. checking group ids -
  46. group check 0b, next in 20 sec
  47. checking group ids - 0bb1756db218fc2839ac01406a317f3a
  48. resetting timeout for deletion lock on 0bb1756db218fc2839ac01406a317f3a
  49. creating dbm for file /tmp/asp_demo/0b/0bb1756db218fc2839ac01406a317f3a, db SDBM_File, serializer: Data::Dumper
  50. Session_OnEnd - session: 0bb1756db218fc2839ac01406a317f3a;
  51. executing Session_OnEnd
  52. creating dbm for file /tmp/asp_demo/0b/0bb1756db218fc2839ac01406a317f3a, db SDBM_File, serializer: Data::Dumper
  53. deleting session - files_deleted: 1; session_id: 0bb1756db218fc2839ac01406a317f3a;
  54. group check 0f, next in 26 sec
  55. checking group ids -
  56. group check 04, next in 28 sec
  57. checking group ids -
  58. group check 06, next in 10 sec
  59. checking group ids -
  60. group check 05, next in 23 sec
  61. checking group ids - 05e18e57a51c96a4aa36e9bc2aa34843
  62. resetting timeout for 05e18e57a51c96a4aa36e9bc2aa34843 to 1632375656
  63. cleanup groups - deleted: 0;
  64. Application_OnEnd
  65. executing Application_OnEnd
  66. Application_OnStart
  67. executing Application_OnStart
  68. Session_OnStart - session: 083591d3a5e3cbf06c15e101380eeb55;
  69. executing Session_OnStart
  70. updating LastSessionTimeout from 1632375043
  71. parse file /usr/local/proj/asp/eg/syntax_error.asp
  72. parsing /usr/local/proj/asp/eg/syntax_error.asp
  73. found header.inc at /usr/local/proj/asp/eg/header.inc
  74. runtime exec of dynamic include header.inc args ()
  75. start parse of data - 1484
  76. undefing sub Apache::ASP::Demo::__ASP__local_proj_asp_eg_synta__error_aspx912a61bdf9084209b6314417f66088c7xINC code CODE(0x55d487ab0a88)
  77. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP__local_proj_asp_eg_synta__error_aspx912a61bdf9084209b6314417f66088c7xINC]
  78. register include /usr/local/proj/asp/eg/header.inc with success
  79. parse file /usr/local/proj/asp/eg/compile_error.inc
  80. parsing /usr/local/proj/asp/eg/compile_error.inc
  81. start parse of data - 116
  82. undefing sub Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC code CODE(0x55d4881f4d58)
  83. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC]
  84. undefing sub Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC code CODE(0x55d4881f4d58)
  85. register include compile_error.inc with error:
  86. Script_OnStart
  87. executing Script_OnStart
  88. [syntax_error.asp] - Script_OnStart /usr/local/proj/asp/eg/syntax_error.asp in global.asa
  89. executing Apache::ASP::Demo::__ASP__local_proj_asp_eg_synta__error_aspx912a61bdf9084209b6314417f66088c7xINC
  90. Script_OnFlush
  91. executing Script_OnFlush
  92. [syntax_error.asp] - Script_OnFlush: about to flush 1 bytes to client
  93. building headers
  94. sending cgi headers
  95. executing Apache::ASP::Demo::__ASP__usr_local_proj_asp_eg_header_incx3436ef45a26199e890479d9a7f0923bcxINC
  96. Script_OnFlush
  97. executing Script_OnFlush
  98. [syntax_error.asp] - Script_OnFlush: about to flush 871 bytes to client
  99. Script_OnFlush
  100. executing Script_OnFlush
  101. [syntax_error.asp] - Script_OnFlush: about to flush 82 bytes to client
  102. done executing include code Apache::ASP::Demo::__ASP__usr_local_proj_asp_eg_header_incx3436ef45a26199e890479d9a7f0923bcxINC
  103. Script_OnFlush
  104. executing Script_OnFlush
  105. [syntax_error.asp] - Script_OnFlush: about to flush 537 bytes to client
  106. [syntax_error.asp] - Debugging - can; take - just: about; - any; kind - of reference - or scalar
  107. Script_OnFlush
  108. executing Script_OnFlush
  109. [syntax_error.asp] - Script_OnFlush: about to flush 77 bytes to client
  110. Script_OnFlush
  111. executing Script_OnFlush
  112. [syntax_error.asp] - Script_OnFlush: about to flush 269 bytes to client
  113. parse file /usr/local/proj/asp/eg/compile_error.inc
  114. parsing /usr/local/proj/asp/eg/compile_error.inc
  115. start parse of data - 116
  116. undefing sub Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC code CODE(0x55d4881f4d58)
  117. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC]
  118. undefing sub Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC code CODE(0x55d4881f4d58)
  119. 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
  120. ASP Done Processing Apache::ASP=HASH(0x55d4881db550) - Application: Apache::ASP::Application=HASH(0x55d4881acc78); GlobalASA: Apache::ASP::GlobalASA=HASH(0x55d4876fad10); Internal: Apache::ASP::State=HASH(0x55d4881a3bf8); Request: Apache::ASP::Request=HASH(0x55d4881a39d0); Response: Apache::ASP::Response=HASH(0x55d4881a3298); Server: Apache::ASP::Server=HASH(0x55d4876fad88); Session: Apache::ASP::Session=HASH(0x55d4881c42e8); app_state: 1; basename: syntax_error.asp; cleanup: ARRAY(0x55d487aac358); compile_checksum: 3436ef45a26199e890479d9a7f0923bc; compile_error: 1; compile_eval: SCALAR(0x55d48820e438); compile_includes: 1; compile_perl_count: 3; cookie_domain: ; cookie_path: /; dbg: 3; debugs_output: ARRAY(0x55d487ab0b78); destroy: 1; dir_config: APR::Table=HASH(0x55d4881d8360); dirname: /usr/local/proj/asp/eg/; errors_output: ARRAY(0x55d4881c40a8); 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(0x55d4881d8138); http_only_session: ; includes_dir: ARRAY(0x55d4881f4cf8); init_packages: ARRAY(0x55d4881cce08); inode_names: 0; internal_cached_keys: HASH(0x55d48820e5a0); lang_comment: #; lang_language: PerlScript; lang_module: Apache::ASP::Lang::PerlScript; lang_object: Apache::ASP::Lang::PerlScript=HASH(0x55d4877a7e30); last_compile_include_data: HASH(0x55d4881e1710); last_time: 1632375356.9013; no_cache: 0; package: Apache::ASP::Demo; paranoid_session: ; parse_config: 1; parse_file_count: 3; pod_comments: 1; r: Apache2::RequestRec=SCALAR(0x55d4881d7e68); register_includes: HASH(0x55d4881a3940); remote_ip: 35.172.203.87; request_binary_read: 1; response_tied: 1; run_perl_script: SCALAR(0x55d4881d7ee0); search_dirs_cache: HASH(0x55d487a84658); secure_session: ; session_count: 1; session_id: 083591d3a5e3cbf06c15e101380eeb55; 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: 1632375356.88704; 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;
  121. errors out
  122. 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.