1

When I manually Generate sitmap.xml from admin's Catalog>Google Sitemap, it throws the following error in the browser:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@TheDomain.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Apache error_log

[Fri Dec 25 10:15:12 2015] [error] [client HostIP] client denied by server configuration: /home/DIRECTORY/public_html/MAGENTO/app/etc/local.xml  
[Fri Dec 25 10:26:07 2015] [error] [client MyIP] Script timed out before returning headers: index.php, referer: https://TheDomain/sitemap/index/key/e6...22/  
[Fri Dec 25 10:31:35 2015] [error] [client MyIP] Script timed out before returning headers: index.php, referer: https://TheDomain/cms_page/index/key/56...9c/  
[Fri Dec 25 10:41:07 2015] [error] [client MyIP] Script timed out before returning headers: index.php, referer: https://TheDomain/sitemap/index/key/e6...22/  
[Fri Dec 25 10:46:35 2015] [error] [client MyIP] Script timed out before returning headers: index.php, referer: https://TheDomain/cms_page/index/key/56...9c/  
[Fri Dec 25 10:47:40 2015] [error] [client HostIP] client denied by server configuration: /home/DIRECTORY/public_html/MAGENTO/app/etc/local.xml  
[Fri Dec 25 10:47:52 2015] [error] [client HostIP] client denied by server configuration: /home/DIRECTORY/public_html/MAGENTO/app/etc/local.xml  
[Fri Dec 25 11:13:04 2015] [notice] SIGUSR1 received.  Doing graceful restart    
[Fri Dec 25 11:13:05 2015] [notice] Digest: generating secret for digest authentication ...  
[Fri Dec 25 11:13:05 2015] [notice] Digest: done  
[Fri Dec 25 11:13:06 2015] [warn] RSA server certificate CommonName (CN) `www.DOMAIN.com' does NOT match server name!?  
[Fri Dec 25 11:13:06 2015] [notice] Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/1.0.1e-fips DAV/2 mod_bwlimited/1.4 configured -- resuming normal operations

This could be a browser time out issue!

Can this command be executed from shell ssh?

  • Can you attach the error log? – MauroNigrele Dec 25 '15 at 19:43
  • Which error log? error_log located at the root? – user2774042 Dec 25 '15 at 20:09
  • The web server error log.. in apache: /var/log/apache/error.log, in nginx: /var/log/nginx/error.log however both logs can be overridden for each vhost definition, so you must first find the log error file, have you access to your server filesystem? – MauroNigrele Dec 25 '15 at 20:24
  • I found it under /usr/local/apache/logs/error_log. Posted it up above. – user2774042 Dec 25 '15 at 21:05
1

Ok, seems to be a timeout problem, but could be a write permissions problem too, so just to be sure:

  1. Try to switch to webserver user ie: $ su www-data
  2. Then try to write a file in magento root folder (as same level as index.php) ie: $ touch [magento_root]/test-file

If these validation steps are ok, try to change the php timeouts (you can change these values just for admin request) here you will find a guide about changing php timeouts and other limitations.

However you would be able to perform sitemap.xml generation automatically if you have a system cronjob configured and pointed to magento cron.php/sh file, and properly configured in backend:

enter image description here

  • sitemap.xml gets generated via a cronjob without any problems! But once in while i need to generate the sitemap.xml at will. Is there any way to generate the sitemap.xml through shell? – user2774042 Dec 25 '15 at 21:38
  • sitemap shell generation isn't a feature in magento "out of the box". I don't know if you can do it with [link]github.com/netz98/n98-magerun, however, you would be able to change the timeouts or reconfigure the cronjob time to a few minutes from now (just as workaround), as i say before – MauroNigrele Dec 25 '15 at 21:50
  • 1
    wooow 3.5hs it's a lot of time!!! Well if your generation process take such amount of time the backend(browser) on-demand generation isn't possible to adjust. I've been working with some big sites with more than 100K skus and around 10 websites so... many URLs, but i never saw a 3.5 hours sitemap process... how many skus/websites are in your store? – MauroNigrele Dec 25 '15 at 22:20
  • 1
    Ok this is just an ugly workaround, but if you don't have any manual-made rewrites you could try to truncate the core_url_rewrite table and then run the url-rewrites indexer to regenerate them. Before that execute in mysql: select count(*) from core_url_rewrite in order to measure the amount of urls you will to write to sitmaps.xml a logic number (about count) could be: )amount of skus * 3 + amount of categories * amount of nested levels + amoutn of cms pages) if the resulft (of count()) is far higher than that qty truncate and regenerate the table would be a nice solution. – MauroNigrele Dec 25 '15 at 22:38
  • 1
    Good luck!!! and don't forget to backup data before truncate :) – MauroNigrele Dec 25 '15 at 22:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.