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

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 052aba5fc317808e2eebc21b6ce7ca10 with timeout 1544587493
  6. new session id 052aba5fc317808e2eebc21b6ce7ca10
  7. creating dbm for file /tmp/asp_demo/05/052aba5fc317808e2eebc21b6ce7ca10, db SDBM_File, serializer: Data::Dumper
  8. tieing session 052aba5fc317808e2eebc21b6ce7ca10
  9. clearing starting session
  10. forcing groups cleanup
  11. testing internal time for cleanup groups
  12. current_master - Checked: 1544586015; PID: 2639; ServerID: 236feaf6ab8c40cd; - is_master - 0
  13. 1544586044 time is stale, is_master 0 - Checked: 1544586015; PID: 2639; ServerID: 236feaf6ab8c40cd;
  14. is_master 1 after update 4bd6b525ebd3eafe - 2506
  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 23 sec
  19. checking group ids -
  20. group check 0d, next in 17 sec
  21. checking group ids - 0df328ad6c9d2d3f65e7e5303068ba58
  22. resetting timeout for 0df328ad6c9d2d3f65e7e5303068ba58 to 1544587493
  23. group check 0a, next in 3 sec
  24. checking group ids -
  25. group check 00, next in 29 sec
  26. checking group ids -
  27. group check 0c, next in 14 sec
  28. checking group ids -
  29. group check 02, next in 8 sec
  30. checking group ids - 02c79f17a90977bede8c532d70daad1a; 027f00acb971dd9d0ca92ba0685477ba
  31. resetting timeout for 02c79f17a90977bede8c532d70daad1a to 1544587493
  32. resetting timeout for 027f00acb971dd9d0ca92ba0685477ba to 1544587493
  33. group check 08, next in 11 sec
  34. checking group ids -
  35. group check 03, next in 8 sec
  36. checking group ids -
  37. group check 09, next in 9 sec
  38. checking group ids - 097ced9396c36b28cb42205755d09401
  39. resetting timeout for deletion lock on 097ced9396c36b28cb42205755d09401
  40. creating dbm for file /tmp/asp_demo/09/097ced9396c36b28cb42205755d09401, db SDBM_File, serializer: Data::Dumper
  41. Session_OnEnd - session: 097ced9396c36b28cb42205755d09401;
  42. executing Session_OnEnd
  43. creating dbm for file /tmp/asp_demo/09/097ced9396c36b28cb42205755d09401, db SDBM_File, serializer: Data::Dumper
  44. deleting session - files_deleted: 1; session_id: 097ced9396c36b28cb42205755d09401;
  45. group check 07, next in 21 sec
  46. checking group ids -
  47. group check 0b, next in 12 sec
  48. checking group ids -
  49. group check 0f, next in 9 sec
  50. checking group ids - 0fa90933e44ec6176322a0956c05d4c5
  51. resetting timeout for 0fa90933e44ec6176322a0956c05d4c5 to 1544587493
  52. group check 04, next in 6 sec
  53. checking group ids -
  54. group check 06, next in 20 sec
  55. checking group ids - 06014a03293b1a42041b7813b0ac9c6a
  56. resetting timeout for 06014a03293b1a42041b7813b0ac9c6a to 1544587493
  57. group check 05, next in 7 sec
  58. checking group ids - 05710d41046c00fe43b883a2fcbcb3d4; 05e18e57a51c96a4aa36e9bc2aa34843; 052aba5fc317808e2eebc21b6ce7ca10
  59. resetting timeout for 05710d41046c00fe43b883a2fcbcb3d4 to 1544587493
  60. resetting timeout for 05e18e57a51c96a4aa36e9bc2aa34843 to 1544587493
  61. 052aba5fc317808e2eebc21b6ce7ca10 not timed out with 1544587493
  62. cleanup groups - deleted: 0;
  63. Application_OnEnd
  64. executing Application_OnEnd
  65. Application_OnStart
  66. executing Application_OnStart
  67. Session_OnStart - session: 052aba5fc317808e2eebc21b6ce7ca10;
  68. executing Session_OnStart
  69. updating LastSessionTimeout from 1544586345
  70. Script_OnStart
  71. executing Script_OnStart
  72. [syntax_error.asp] - Script_OnStart /usr/local/proj/asp/eg/syntax_error.asp in global.asa
  73. executing Apache::ASP::Demo::__ASP__local_proj_asp_eg_synta__error_aspx912a61bdf9084209b6314417f66088c7xINC
  74. Script_OnFlush
  75. executing Script_OnFlush
  76. [syntax_error.asp] - Script_OnFlush: about to flush 1 bytes to client
  77. building headers
  78. sending cgi headers
  79. executing Apache::ASP::Demo::__ASP__usr_local_proj_asp_eg_header_incx3436ef45a26199e890479d9a7f0923bcxINC
  80. Script_OnFlush
  81. executing Script_OnFlush
  82. [syntax_error.asp] - Script_OnFlush: about to flush 871 bytes to client
  83. Script_OnFlush
  84. executing Script_OnFlush
  85. [syntax_error.asp] - Script_OnFlush: about to flush 82 bytes to client
  86. done executing include code Apache::ASP::Demo::__ASP__usr_local_proj_asp_eg_header_incx3436ef45a26199e890479d9a7f0923bcxINC
  87. Script_OnFlush
  88. executing Script_OnFlush
  89. [syntax_error.asp] - Script_OnFlush: about to flush 537 bytes to client
  90. [syntax_error.asp] - Debugging - can; take - just: about; - any; kind - of reference - or scalar
  91. Script_OnFlush
  92. executing Script_OnFlush
  93. [syntax_error.asp] - Script_OnFlush: about to flush 77 bytes to client
  94. Script_OnFlush
  95. executing Script_OnFlush
  96. [syntax_error.asp] - Script_OnFlush: about to flush 269 bytes to client
  97. parse file /usr/local/proj/asp/eg/compile_error.inc
  98. parsing /usr/local/proj/asp/eg/compile_error.inc
  99. start parse of data - 116
  100. undefing sub Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC code CODE(0x5630ffea58a0)
  101. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC]
  102. undefing sub Apache::ASP::Demo::__ASP_local_proj_asp_eg_compile_error_incx921cacac8ca764a2f25214b2023f9318xINC code CODE(0x5630ffea58a0)
  103. 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
  104. ASP Done Processing Apache::ASP=HASH(0x5630ffea51c8) - Application: Apache::ASP::Application=HASH(0x5630fff01240); GlobalASA: Apache::ASP::GlobalASA=HASH(0x5630ffea4ee0); Internal: Apache::ASP::State=HASH(0x5630ff4e5510); Request: Apache::ASP::Request=HASH(0x5630ffedd568); Response: Apache::ASP::Response=HASH(0x5630ffed5210); Server: Apache::ASP::Server=HASH(0x5630ffe9c7e0); Session: Apache::ASP::Session=HASH(0x5630ff7b2438); app_state: 1; basename: syntax_error.asp; cleanup: ARRAY(0x5630ffed5420); compile_checksum: 3436ef45a26199e890479d9a7f0923bc; compile_error: 1; compile_eval: SCALAR(0x5630ffea5720); compile_includes: 1; compile_perl_count: 1; cookie_domain: ; cookie_path: /; dbg: 3; debugs_output: ARRAY(0x5630ff7ade70); destroy: 1; dir_config: APR::Table=HASH(0x5630ffeda730); dirname: /usr/local/proj/asp/eg/; errors_output: ARRAY(0x5630ff645d60); 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(0x5630ffed5618); http_only_session: ; includes_dir: ARRAY(0x5630ff7b2588); init_packages: ARRAY(0x5630ffea5420); inode_names: 0; internal_cached_keys: HASH(0x5630fff25590); lang_comment: #; lang_language: PerlScript; lang_module: Apache::ASP::Lang::PerlScript; lang_object: Apache::ASP::Lang::PerlScript=HASH(0x5630ff46ed30); last_compile_include_data: HASH(0x5630ffee7a50); last_time: 1544587193.3668; no_cache: 0; package: Apache::ASP::Demo; paranoid_session: ; parse_config: 1; parse_file_count: 1; pod_comments: 1; r: Apache2::RequestRec=SCALAR(0x5630ffef9668); remote_ip: 3.80.85.76; request_binary_read: 1; response_tied: 1; run_perl_script: SCALAR(0x5630ffedb2e8); search_dirs_cache: HASH(0x5630ffea4a78); secure_session: ; session_count: 1; session_id: 052aba5fc317808e2eebc21b6ce7ca10; 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: 1544587193.35514; 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;
  105. errors out
  106. 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.