• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 ErrorException: fopen?

jflory7

Active member
#1
Hello XenForo forums,

Today, I encountered an interesting error while going through the ACP. I hadn't ever seen something like this before, and I wasn't sure if it was a problem with the webserver trying to access something, a security issue, or something else.

Code:
Server Error Log


Error Info

ErrorException: fopen(/var/www/crystalcraftmc.com/public_html/internal_data/sitemaps/sitemap-1413524585-1.xml): failed to open stream: Permission denied - library/XenForo/Deferred/Sitemap.php:210
Generated By: Unknown Account, Friday at 1:43 AM


Stack Trace

#0 [internal function]: XenForo_Application::handlePhpError(2, 'fopen(/var/www/...', '/var/www/crysta...', 210, Array)
#1 /var/www/crystalcraftmc.com/public_html/library/XenForo/Deferred/Sitemap.php(210): fopen('/var/www/crysta...', 'a')
#2 /var/www/crystalcraftmc.com/public_html/library/XenForo/Deferred/Sitemap.php(230): XenForo_Deferred_Sitemap->_openFile()
#3 /var/www/crystalcraftmc.com/public_html/library/XenForo/Deferred/Sitemap.php(202): XenForo_Deferred_Sitemap->_writeSitemapString('?<url><loc>http...')
#4 /var/www/crystalcraftmc.com/public_html/library/XenForo/Deferred/Sitemap.php(165): XenForo_Deferred_Sitemap->_writeResult(Array)
#5 /var/www/crystalcraftmc.com/public_html/library/XenForo/Deferred/Sitemap.php(90): XenForo_Deferred_Sitemap->_buildSitemap(Object(XenForo_SitemapHandler_Core), 0, 7.9999988079071)
#6 /var/www/crystalcraftmc.com/public_html/library/XenForo/Model/Deferred.php(256): XenForo_Deferred_Sitemap->execute(Array, Array, 7.9999988079071, '')
#7 /var/www/crystalcraftmc.com/public_html/library/XenForo/Model/Deferred.php(390): XenForo_Model_Deferred->runDeferred(Array, 7.9999988079071, '', false)
#8 /var/www/crystalcraftmc.com/public_html/library/XenForo/Model/Deferred.php(335): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#9 /var/www/crystalcraftmc.com/public_html/deferred.php(23): XenForo_Model_Deferred->run(false)
#10 {main}


Request State

array(3) {
  ["url"] => string(38) "http://crystalcraftmc.com/deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(3) {
    ["_xfRequestUri"] => string(36) "/find-new/94619/profile-posts?page=6"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
Anyone know what all this means? Is it a search engine bot failing to find something? Or a malicious user trying to poke around in places they shouldn't be?
 

Mike

XenForo developer
Staff member
#5
You should chmod recursively to give everything group/world write in that directory (0777 if you prefer).
 

jflory7

Active member
#6
and sitemaps folder?
Code:
$ ls -lh /var/www/crystalcraftmc.com/public_html/internal_data/
total 32K
drwxrwxrwx 3 jflory jflory 4.0K Apr 15  2014 attachments
drwxrwxrwx 3 jflory jflory 4.0K Apr 15  2014 image_cache
-rwxrwxrwx 1 jflory jflory    1 Apr 15  2014 index.html
-rwxrwxrwx 1 jflory jflory   86 Apr 15  2014 install-lock.php
drwxrwxrwx 2 jflory jflory 4.0K Apr 15  2014 page_cache
drwxr-xr-x 2 jflory jflory 4.0K Oct 15 01:44 sitemaps
drwxrwxrwx 2 jflory jflory 4.0K Oct 21 21:23 temp
drwxrwxrwx 2 jflory jflory 4.0K Apr 16  2014 templates

$ ls -lh /var/www/crystalcraftmc.com/public_html/internal_data/sitemaps/
total 36K
-rw-r--r-- 1 jflory jflory   1 Sep 10 00:05 index.html
-rw-r--r-- 1 jflory jflory 32K Oct 15 01:44 sitemap-1413351835-1.xml.gz
You should chmod recursively to give everything group/world write in that directory (0777 if you prefer).
Is 777 safe for a web directory? Nonetheless I will run chmod -R g+w internal_data/ and chmod -R o+w internal_data/ and see what this does.
 

Mike

XenForo developer
Staff member
#7
Please confirm the issue by rebuilding the sitemap manually. A sitemap should have been built again by now, but equally, the file name is different than in the original error message which implies that something worked out.

As for 0777, the rest of your directories are 0777. Whether or not 0777 is needed depends on whether PHP runs as the same user you use to access FTP.
 

jflory7

Active member
#8
Please confirm the issue by rebuilding the sitemap manually. A sitemap should have been built again by now, but equally, the file name is different than in the original error message which implies that something worked out.

As for 0777, the rest of your directories are 0777. Whether or not 0777 is needed depends on whether PHP runs as the same user you use to access FTP.
I'm not noticing any more server errors in the ACP! Seems that did it. Thanks!