Sitemap no longer works, shows 'Internal Server Error'

Permalink 1 user found helpful
I am having issues with sitemaps, either through the dashboard or when selecting pages to link to.

Whenever I click the '+' to expand part of the tree, it throws up an error 'Unable to load sitemap data' - 'Internal Server Error'. (see attached screenshot)

It was working after switching to PHP 5.3 and with simple URLs turned on. Also there is nothing added to the c5 error log!


I have tried switching off Mod rewrite, and checked the permissions in the /js folder to no avail.

Don't know where to start! Can anyone point me in the right direction?

1 Attachment

firepixel
 
tomreitz replied on at Permalink Reply
tomreitz
Have you run the "Index Search Engine" and "Generate Sitemap File" jobs? (Dashboard -> System and Maintenance -> Jobs tab -> check these two jobs and click the Run Checked button.)
firepixel replied on at Permalink Reply
firepixel
Yes thanks, tried this, but it made no difference.
andrew replied on at Permalink Best Answer Reply
andrew
No idea why, but a commit here helped address this bug when we found it recently:

https://github.com/concrete5/concrete5/commit/2cf69ac90a8c8d1c7a451c...

Scroll down and find the line where we change method_exists into is_callable.
firepixel replied on at Permalink Reply
firepixel
Amazing, that worked!

Thanks a million, that has gotten me out of a really tight spot!

Now just to hope all the other messing about I've done hasn't created any other problems!
wreford replied on at Permalink Reply
wreford
Thank you, I was also having this problem (site running on HostPapa), and it was a simple fix that I would never have been able to figure out on my own. Kudos!
starkjoe replied on at Permalink Reply
starkjoe
Had this same issue after moving site - thought it might be permissions related... Anyway, changed to "is_callable" and got the sitemap back but with theses errors:

Warning: call_user_func() expects parameter 1 to be a valid callback, class 'CollectionAttributeKey' not found in /home/neta65or/public_html/concrete/libraries/item_list.php on line 107
Warning: Invalid argument supplied for foreach() in /home/neta65or/public_html/concrete/libraries/item_list.php on line 108
Warning: call_user_func() expects parameter 1 to be a valid callback, class 'CollectionAttributeKey' not found in /home/neta65or/public_html/concrete/libraries/item_list.php on line 107
Warning: Invalid argument supplied for foreach() in /home/neta65or/public_html/concrete/libraries/item_list.php on line 108


Any thoughts?
firepixel replied on at Permalink Reply
firepixel
Yes, the change is more than that one thing. Look again at the line, you have likely left out the array( parameter modifier.
starkjoe replied on at Permalink Reply
starkjoe
That was exactly it. I'll be more careful next time. Thanks for the help.
jedininja replied on at Permalink Reply
jedininja
I'm having the same problem as above, plus the toolbar disappears randomly, but page refresh brings it back.
The provided link didn't work for me, any other suggestions??
Thanks.
garhol replied on at Permalink Reply
Thank you. That sorted the problem for me as well.
spencerhudson replied on at Permalink Reply
spencerhudson
perfect code correction worked.
Mnkras replied on at Permalink Reply
Mnkras
Can you check the php error log and the server error log?
firepixel replied on at Permalink Reply 1 Attachment
firepixel
Yep, nothing of relevance really, the operations produces the line below, which points to a script problem albeit provides no useful information for troubleshooting! I have attached all of the log entries.

[Sat Apr 09 08:28:49 2011] [error] [client 94.193.133.64] Premature end of script headers: index.php, referer: http://opfc.fpix.co.uk/index.php/dashboard/sitemap/full/
firepixel replied on at Permalink Reply
firepixel
Anybody have any more ideas on this? Really stuck with this problem!
firepixel replied on at Permalink Reply
firepixel
I have tried on a fresh install, once I import the database the same problem occurs.

Maybe there is an incorrectly handled error in the c5 code?

I have tried to find any missing relationships in the database but I don't really know where to look!

I don't know what to do! I can't rebuild the site from scratch it would take me days, but on the other hand I can't move and copy pages, or make links to pages!
tomreitz replied on at Permalink Reply
tomreitz
If you PM me login info for your site, I can have a look. It could be a problem with your .htaccess file - the Internal Server Error in your screenshot looks like something generated by the server (apache?), not C5.
dg1 replied on at Permalink Reply
Don't know if this will help, but here is another thread where someone was getting the "Premature end of script..." error and what they did to fix it. Probably not related, but worth a shot.

http://www.concrete5.org/community/forums/usage/pretty-urls2/...
tomreitz replied on at Permalink Reply
tomreitz
The issue is that the AJAX request that tries to load the sitemap info returns a server error 500. The relevant URL ishttp://yoursite.com/index.php/tools/required/dashboard/sitemap_data...
(you must be logged in as admin to see it)

A server 500 error could happen for a number of reasons:
- A problem with an .htaccess file (although I guess you said that's not the problem).
- A misconfigured or corrupted php.ini file.
- Incorrect file permissions that prevent PHP from accessing certain files.
- There's an outside possibility that it could be a problem with the character encoding. C5 is expecting everything to be UTF-8 encoded, so if your database encoding is different, that could cause a problem. Have you made any database tweaks to your site?
- On some (poorly-configured) servers, when there's a PHP error, rather than printing out the error, you just get a 500 error. But again, if C5 works out-of-the-box, it shouldn't be a PHP error.

You should check your file permissions, php.ini file, and database charset. If those look ok, I'd suggest you contact your web host, as it must be a problem on their end.

If you want me to look at the file permissions/php.ini, PM me FTP or control panel access to your site.

Hope this helps. Post back if you're still stuck.
firepixel replied on at Permalink Reply
firepixel
Thanks Tom for your help. Found the solution above.

That link was really useful for testing, couldn't find out what scripts it was accessing!
nteaviation replied on at Permalink Reply
nteaviation
If you are running Pretty URL's, Have you seen this?
http://www.concrete5.org/community/forums/usage/pretty-urls2/...
nteaviation replied on at Permalink Reply
nteaviation
LOL, 1 minute behind dg1... Good job speedy :)
firepixel replied on at Permalink Reply
firepixel
Thanks guys, but I can't seem to get this to work. Changing any of those things just breaks pretty urls for me.

I tried removing the .htaccess altogether and turning off pretty URLs but the problem is still the same!
nteaviation replied on at Permalink Reply
nteaviation
Have you edited or modified index.php?
JohntheFish replied on at Permalink Reply
JohntheFish
Is it a big site on shared hosting? Maybe you are running over CPU time limits and simply being cut off by the server.
grovesk replied on at Permalink Reply
grovesk
Thanks Andrew. That was definitely the fix. Worked perfectly.