Better Blogs [Deleted]

In Usergroup Permissions blogs are viewable to the Unregistered/Not Logged In usergroup.
In my privacy settings my blog is set to "All Visitors Can View"

and yet still I get this error when viewing my blog:
A server error occurred. Please try again later.

So I turned on debug mode and this is the error that shows for guests:


Server Error
Mysqli statement execute error : Out of range value for column 'ipOrUser' at row 1

  1. Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 317
  2. Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
  3. Zend_Db_Adapter_Abstract->query() in XfAddOns/Blogs/Model/BlogView.php at line 32
  4. XfAddOns_Blogs_Model_BlogView->registerView() in XfAddOns/Blogs/ControllerPublic/Blog.php at line 77
  5. XfAddOns_Blogs_ControllerPublic_Blog->actionIndex() in XenForo/FrontController.php at line 337
  6. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  7. XenForo_FrontController->run() in /home/blah/public_html/index.php at line 13
 
In Usergroup Permissions blogs are viewable to the Unregistered/Not Logged In usergroup.
In my privacy settings my blog is set to "All Visitors Can View"

and yet still I get this error when viewing my blog:
A server error occurred. Please try again later.

So I turned on debug mode and this is the error that shows for guests:


Server Error
Mysqli statement execute error : Out of range value for column 'ipOrUser' at row 1

  1. Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 317
  2. Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
  3. Zend_Db_Adapter_Abstract->query() in XfAddOns/Blogs/Model/BlogView.php at line 32
  4. XfAddOns_Blogs_Model_BlogView->registerView() in XfAddOns/Blogs/ControllerPublic/Blog.php at line 77
  5. XfAddOns_Blogs_ControllerPublic_Blog->actionIndex() in XenForo/FrontController.php at line 337
  6. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  7. XenForo_FrontController->run() in /home/blah/public_html/index.php at line 13
That is the "Register View" logic, and definitely sounds like a bug. I'll take a look.
 
In Usergroup Permissions blogs are viewable to the Unregistered/Not Logged In usergroup.
In my privacy settings my blog is set to "All Visitors Can View"

and yet still I get this error when viewing my blog:
A server error occurred. Please try again later.

So I turned on debug mode and this is the error that shows for guests:


Server Error
Mysqli statement execute error : Out of range value for column 'ipOrUser' at row 1

  1. Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 317
  2. Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
  3. Zend_Db_Adapter_Abstract->query() in XfAddOns/Blogs/Model/BlogView.php at line 32
  4. XfAddOns_Blogs_Model_BlogView->registerView() in XfAddOns/Blogs/ControllerPublic/Blog.php at line 77
  5. XfAddOns_Blogs_ControllerPublic_Blog->actionIndex() in XenForo/FrontController.php at line 337
  6. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  7. XenForo_FrontController->run() in /home/blah/public_html/index.php at line 13

You are running in a 32-bit architecture (or PHP was compiled for 32-bit) which in turn makes the ip2long version return an unsigned integer, and that is why you are getting that error.

I'll provide a fix on the next version, in the meantime, just open library/XfAddOns/Blogs/Model/BlogView.php

Find
Code:
  protected function getIpAddress()
   {
     $ipAddress = (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : false);
     $ipAddress = (is_string($ipAddress) && strpos($ipAddress, '.')) ? ip2long($ipAddress) : false;  
     return $ipAddress ? $ipAddress : 0;
   }

Replace with:
Code:
  protected function getIpAddress()
   {
     $ipAddress = (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : false);
     $ipAddress = (is_string($ipAddress) && strpos($ipAddress, '.')) ? ip2long($ipAddress) : false;
     $ipAddress = sprintf('%u', $ipAddress);   // in 32-bit architecture this would be negative
     return $ipAddress > 0 ? $ipAddress : 0;
   }
 
  • Like
Reactions: DRE
Alright, so I did come across some issues importing the blogs from vBulletin. I upgraded my site from vBulletin yesterday (had some import problems I thought were related to installing addons while rebuilding the cache, but I think it involved using Better Blogs). I tried importing the vBulletin blogs to Better Blogs today and I came across a serious issue: it was running "admin-deferred" and was deleting all my posts! It deleted over 500,000 posts in about a minute. Fortunately I took multiple backups immediately preceding the attempt and have since restored the site - all in all it wasn't that big of a deal, but it could have been disastrous.

This is specifically what I encountered: http://i.imgur.com/a0cJSo2.png

Any thoughts on this?

I'd previous done two test imports from vBulletin to XF with version 1.0.16 without problems. I'm going to test some more on my demo board but I'm at a loss. I still want to use these blogs but obviously this is concerning.

If it's a version issue, I might try importing to 1.0.16 then upgrade to 1.0.17.
 
Alright, so I did come across some issues importing the blogs from vBulletin. I upgraded my site from vBulletin yesterday (had some import problems I thought were related to installing addons while rebuilding the cache, but I think it involved using Better Blogs). I tried importing the vBulletin blogs to Better Blogs today and I came across a serious issue: it was running "admin-deferred" and was deleting all my posts! It deleted over 500,000 posts in about a minute. Fortunately I took multiple backups immediately preceding the attempt and have since restored the site - all in all it wasn't that big of a deal, but it could have been disastrous.

This is specifically what I encountered: http://i.imgur.com/a0cJSo2.png

Any thoughts on this?

I'd previous done two test imports from vBulletin to XF with version 1.0.16 without problems. I'm going to test some more on my demo board but I'm at a loss. I still want to use these blogs but obviously this is concerning.

If it's a version issue, I might try importing to 1.0.16 then upgrade to 1.0.17.
The admin-deferred task is not started by Better Blogs, the import process for blogs does not touch anything that has to do with Threads or Posts, so it definitely needs to be started by some other add-on, or the main XenForo import itself

I read your thread in here - http://xenforo.com/community/threads/processing-deleting-threads-28-s.57808/#post-615698 - My response is pretty much the same as Mike, that is only triggered by deleting a forum.

I would suggest the following flow
  • Import the main XenForo. Wait until it finishes everything (Rebuilding caches, etc)
  • Install the Blogs Add-On
  • Do the Blogs import, wait until it finishes, do not install any add-on in the middle
After that, there should be nothing deleted.
Take a look in Tools -> Moderator Log and do check if you have anything funny going on, like a manual deletion of a forum.
 
The admin-deferred task is not started by Better Blogs, the import process for blogs does not touch anything that has to do with Threads or Posts, so it definitely needs to be started by some other add-on, or the main XenForo import itself

I read your thread in here - http://xenforo.com/community/threads/processing-deleting-threads-28-s.57808/#post-615698 - My response is pretty much the same as Mike, that is only triggered by deleting a forum.

I would suggest the following flow
  • Import the main XenForo. Wait until it finishes everything (Rebuilding caches, etc)
  • Install the Blogs Add-On
  • Do the Blogs import, wait until it finishes, do not install any add-on in the middle
After that, there should be nothing deleted.
Take a look in Tools -> Moderator Log and do check if you have anything funny going on, like a manual deletion of a forum.

Alright, I believe you, it just strikes me as very odd. In this instance it was imported to XF with only a few base addons: Resources, Widget Frameworks, Tags, and the forum import script. Maybe the issue arises from the forum importer.

I absolutely wasn't deleting any forums in this instance or in the post you linked above (yesterday). Some addon (or consequence of the import?) is deleting things on it's own when I try to import with your addon (not saying Better Blogs is causing it directly).

I basically followed your above instructions except I installed the addons I mentioned above before BB. I'll try disabling or uninstalling all addons and try the blog import again. Wish me luck!
 
Alright, I believe you, it just strikes me as very odd. In this instance it was imported to XF with only a few base addons: Resources, Widget Frameworks, Tags, and the forum import script. Maybe the issue arises from the forum importer.

I absolutely wasn't deleting any forums in this instance or in the post you linked above (yesterday). Some addon (or consequence of the import?) is deleting things on it's own when I try to import with your addon (not saying Better Blogs is causing it directly).

I basically followed your above instructions except I installed the addons I mentioned above before BB. I'll try disabling or uninstalling all addons and try the blog import again. Wish me luck!

Best of luck, I hope it completes fine and without any weird side-effects like the Forum Deletion you are experiencing. I wonder if @Mike setup a log of which deferred tasks ran and who started them (might be useful to have the PHP backtrace), but I might be asking for too much there.

Are you using the included vBulletin importer, or are you using one of the unofficial ones?
 
Best of luck, I hope it completes fine and without any weird side-effects like the Forum Deletion you are experiencing. I wonder if @Mike setup a log of which deferred tasks ran and who started them (might be useful to have the PHP backtrace), but I might be asking for too much there.

Are you using the included vBulletin importer, or are you using one of the unofficial ones?

Thanks! I'm sure I'll figure it out eventually. Even completing this successfully I'll still want to get to the bottom of it, so hopefully it's possible to find out what's the cause. As for the importer, I tried both: the problem I had yesterday (in the post you linked) was using after using the official importer. After I had that issue initially I tried an unofficial importer instead and avoided the deferred-tasks/deleting forums problem until trying to import blogs.

Alright, gonna go give it another shot.
 
Okay, so I disabled all addons and tried again and I still had the same issue of posts/forums getting deleted. I have some more info though, maybe someone could shine some light on it?

The problem happens when I'm trying to configure the Better Blogs addon, not when I'm actually running an import (unless configuring after entering the database details does that, but I'm almost sure it doesn't).

I received a server error during this time:

Code:
Error Info

Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Lock wait timeout exceeded; try restarting transaction - library/Zend/Db/Statement/Mysqli.php:214

Generated By: Unknown Account, 3 minutes ago

Stack Trace

#0 /home/admin/public_html/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)

#1 /home/admin/public_html/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)

#2 /home/admin/public_html/library/Zend/Db/Adapter/Abstract.php(632): Zend_Db_Adapter_Abstract->query('UPDATE `xf_user...', Array)

#3 /home/admin/public_html/library/XenForo/Model/Session.php(427): Zend_Db_Adapter_Abstract->update('xf_user', Array, 'user_id = 3885')

#4 /home/admin/public_html/library/XenForo/CronEntry/CleanUp.php(32): XenForo_Model_Session->updateUserLastActivityFromSessions()

#5 [internal function]: XenForo_CronEntry_CleanUp::runHourlyCleanUp(Array)

#6 /home/admin/public_html/library/XenForo/Model/Cron.php(356): call_user_func(Array, Array)

#7 /home/admin/public_html/library/XenForo/Deferred/Cron.php(20): XenForo_Model_Cron->runEntry(Array)

#8 /home/admin/public_html/library/XenForo/Model/Deferred.php(197): XenForo_Deferred_Cron->execute(Array, Array, 9.99999713898, '')

#9 /home/admin/public_html/library/XenForo/Model/Deferred.php(320): XenForo_Model_Deferred->runDeferred(Array, 9.99999713898, '', false)

#10 /home/admin/public_html/library/XenForo/Model/Deferred.php(273): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)

#11 /home/admin/public_html/deferred.php(15): XenForo_Model_Deferred->run(false)

#12 {main}

Request State

array(3) {

  ["url"] => string(41) "http://www.site.com/deferred.php"

  ["_GET"] => array(0) {

  }

  ["_POST"] => array(3) {

  ["_xfRequestUri"] => string(31) "/archive/index.php/t-22600.html"

  ["_xfNoRedirect"] => string(1) "1"

  ["_xfResponseType"] => string(4) "json"

  }

}

What do you think of this error? Would this be better suited for a different thread? Thanks.
 
Okay, so I disabled all addons and tried again and I still had the same issue of posts/forums getting deleted. I have some more info though, maybe someone could shine some light on it?

The problem happens when I'm trying to configure the Better Blogs addon, not when I'm actually running an import (unless configuring after entering the database details does that, but I'm almost sure it doesn't).

I received a server error during this time:

Code:
Error Info

Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Lock wait timeout exceeded; try restarting transaction - library/Zend/Db/Statement/Mysqli.php:214

Generated By: Unknown Account, 3 minutes ago

Stack Trace

#0 /home/admin/public_html/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)

#1 /home/admin/public_html/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)

#2 /home/admin/public_html/library/Zend/Db/Adapter/Abstract.php(632): Zend_Db_Adapter_Abstract->query('UPDATE `xf_user...', Array)

#3 /home/admin/public_html/library/XenForo/Model/Session.php(427): Zend_Db_Adapter_Abstract->update('xf_user', Array, 'user_id = 3885')

#4 /home/admin/public_html/library/XenForo/CronEntry/CleanUp.php(32): XenForo_Model_Session->updateUserLastActivityFromSessions()

#5 [internal function]: XenForo_CronEntry_CleanUp::runHourlyCleanUp(Array)

#6 /home/admin/public_html/library/XenForo/Model/Cron.php(356): call_user_func(Array, Array)

#7 /home/admin/public_html/library/XenForo/Deferred/Cron.php(20): XenForo_Model_Cron->runEntry(Array)

#8 /home/admin/public_html/library/XenForo/Model/Deferred.php(197): XenForo_Deferred_Cron->execute(Array, Array, 9.99999713898, '')

#9 /home/admin/public_html/library/XenForo/Model/Deferred.php(320): XenForo_Model_Deferred->runDeferred(Array, 9.99999713898, '', false)

#10 /home/admin/public_html/library/XenForo/Model/Deferred.php(273): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)

#11 /home/admin/public_html/deferred.php(15): XenForo_Model_Deferred->run(false)

#12 {main}

Request State

array(3) {

  ["url"] => string(41) "http://www.site.com/deferred.php"

  ["_GET"] => array(0) {

  }

  ["_POST"] => array(3) {

  ["_xfRequestUri"] => string(31) "/archive/index.php/t-22600.html"

  ["_xfNoRedirect"] => string(1) "1"

  ["_xfResponseType"] => string(4) "json"

  }

}

What do you think of this error? Would this be better suited for a different thread? Thanks.

That error is from the Cron Job that runs periodically. That cron job clears attachments, old sessions, old alerts, news feed, bb code cache, spam check .
..
And it is just complaining about a locked table, which only really means there was another process using it without releasing the lock and the cron job gave up. That particular error is not a problem.

Could you try first doing a File Health Check?
In your AdminCP go to Tools -> File Health Check and run a check just to validate that all files are fine

The "configure" step in blogs does not actually start doing anything, other than saving the session data. Definitely does not trigger any deferred job
 
That error is from the Cron Job that runs periodically. That cron job clears attachments, old sessions, old alerts, news feed, bb code cache, spam check .
..
And it is just complaining about a locked table, which only really means there was another process using it without releasing the lock and the cron job gave up. That particular error is not a problem.

Could you try first doing a File Health Check?
In your AdminCP go to Tools -> File Health Check and run a check just to validate that all files are fine

The "configure" step in blogs does not actually start doing anything, other than saving the session data. Definitely does not trigger any deferred job

Thanks, I appreciate the response.

I ran a file health check and this was all I got:

library/XenForo/Importer/vBulletin.phpFile does not contain expected contents.
 
Thanks, I appreciate the response.

I ran a file health check and this was all I got:
library/XenForo/Importer/vBulletin.phpFile does not contain expected contents.
That is not good, since the vBulletin Blog importer does extend that class
Could you try re-uploading that file from your original XenForo zip file? After that, run the Health Check again, that error would be gone
 
In the downloads area at XfAddOns.com (Send me a conversation message if you don't have access yet) I have the latest version with support for importing Global Category from vb 3.8

There are no Global Categories in Better Blogs, so it will import them as regular user-created categories instead.
I have just installed version 1.0.19b and did another import. As far as I can see no categories where imported. I have checked with entries that have a category attributed to it in the vb blogs, but I see nothing in BB. Do I need to do anything elke?
Also, do you know why the importer has an entry to import tags, but is not functional?
 
I uninstall old ver., drop all table. New install 1.0.19 . Error
Use these queries to do a manual uninstall of the addon
Code:
DELETE FROM xf_content_type_field where content_type = 'xfa_blog_comment';
DELETE FROM xf_content_type_field where content_type = 'xfa_blog_entry';
DELETE FROM xf_content_type where content_type = 'xfa_blog_comment';
DELETE FROM xf_content_type where content_type = 'xfa_blog_entry';

DROP TABLE IF EXISTS xfa_blog_deferred_view;
DROP TABLE IF EXISTS xfa_blog_view;
DROP TABLE IF EXISTS xfa_blog_entry_view;
DROP TABLE IF EXISTS xfa_blog_entry_category;
DROP TABLE IF EXISTS xfa_blog_category;
DROP TABLE IF EXISTS xfa_blog_category_global;
DROP TABLE IF EXISTS xfa_blog_entry_read;
DROP TABLE IF EXISTS xfa_blog_read;
DROP TABLE IF EXISTS xfa_blog_css;
DROP TABLE IF EXISTS xfa_blog_comment;
DROP TABLE IF EXISTS xfa_blog_entry_watch;
DROP TABLE IF EXISTS xfa_blog_entry;
DROP TABLE IF EXISTS xfa_blog_entry_scheduled;
DROP TABLE IF EXISTS xfa_blog_watch;
DROP TABLE IF EXISTS xfa_blog;

ALTER TABLE xf_user_privacy DROP allow_view_blog;
ALTER TABLE xf_user_profile DROP entry_count;  // these most likely do not exist on this version of the installer, but try to drop them regardless
ALTER TABLE xf_user_profile DROP blog_key;

DELETE FROM xf_attachment where content_type = 'xfa_blog_entry';
DELETE FROM xf_news_feed where content_type = 'xfa_blog_entry';
DELETE FROM xf_user_alert where content_type = 'xfa_blog_entry';

DELETE FROM xf_admin_navigation WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_admin_permission WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_code_event WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_code_event_listener WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_cron_entry WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_option WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_option_group WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_permission WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_permission_group WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_permission_interface_group WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_phrase WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_route_prefix WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_template WHERE addon_id = 'xfa_blogs';
DELETE FROM xf_option_group_relation where option_id like 'xfa_blog%';
DELETE FROM xf_addon WHERE addon_id = 'xfa_blogs';

Then you should be able to install the add-on again
Please note that this will erase ALL data
 
I have just installed version 1.0.19b and did another import. As far as I can see no categories where imported. I have checked with entries that have a category attributed to it in the vb blogs, but I see nothing in BB. Do I need to do anything elke?
Also, do you know why the importer has an entry to import tags, but is not functional?
Where did you see tags? Could you add a screenshot of that?
 
Back
Top Bottom