Changing the INSERT INTO to REPLACE INTO fixes that.
Database Error upgrading to 4.1.0 Beta 1
Collapse
X
-
vBulletin - Sometimes, I'm just like, Wow, and then I'm like, Whoa, and then I'm like, Damn.
vBulletin.org's ol' Moderator
I have a lifetime terrorist hunting permit - #091101
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden -
Yes ... sort of.
The problem I would guess is that its been changed to REPLACE in PL2, but only if you download the full PL2 package, its not in the patch files.
Just one.
The code should be as posted by Zachery, you may find your version currently says INSERT INTO, depending on how you obtained the PL2 files.Baby, I was born this wayComment
-
Ah, that is good to know, Paul. I just took it for granted that they would change both the patch AND the full version download. What was I thinking?vBulletin - Sometimes, I'm just like, Wow, and then I'm like, Whoa, and then I'm like, Damn.
vBulletin.org's ol' Moderator
I have a lifetime terrorist hunting permit - #091101
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/ladenComment
-
Find
Code:if (!$row or !$row['value']) { $sql = "REPLACE INTO " . TABLE_PREFIX . "setting (varname, grouptitle, value, datatype" . ($default_value ? ',default_value' : '') . ")VALUES('" . $this->db->escape_string($varname) . "', '" . $this->db->escape_string($grouptitle) . "', '" . $this->db->escape_string($value) . "', '$datatype' ". ($default_value ? ",'" . $this->db->escape_string($default_value) . "'" : '') . ")"; $this->db->query_write($sql); }
Code:if (!$row or !$row['value']) { $sql = "REPLACE INTO " . TABLE_PREFIX . "setting (varname, grouptitle, value, datatype" . ($default_value ? ',defaultvalue' : '') . ")VALUES('" . $this->db->escape_string($varname) . "', '" . $this->db->escape_string($grouptitle) . "', '" . $this->db->escape_string($value) . "', '$datatype' ". ($default_value ? ",'" . $this->db->escape_string($default_value) . "'" : '') . ")"; $this->db->query_write($sql); }
I have modified class_upgrade.php as you told us
Result:
MySQL Error : Duplicate entry 'socnet' for key 'PRIMARY'
Error Number : 1062
I hope you care about us PLZComment
-
http://tracker.vbulletin.com/browse/VBIV-10448
http://tracker.vbulletin.com/browse/VBIV-10471
I downloaded today the complete suite 4.1 PL2.
No error has been fixed.
You have to manually change the two errorsComment
-
You cannot have made the changes properly - its impossible to get a duplicate key error if you changed the SQL to say REPLACE INTO.Baby, I was born this wayComment
-
Working solution
The nature of the Duplicate entry 'socnet' for key 'PRIMARY' bug is that at some point 'socnet' setting record loses its 'volatile' field value set to 1 and therefore does not get deleted before the failing insert.
I've manage to finish the upgrade by setting the 'volatile' field for 'socnet' record to 1 and restarting upgrade process.
Hope this may help someone.
p.s. I was upgrading 4.0.7 to 4.1.0 PL2, downloaded today, 8 Dec 2010Comment
-
www.youtube.com/user/vBulletin4
to Explain the Solution For this problem.
Thank you for your interestComment
-
PHP Code:if (!$row or !$row['value'])
{
$sql = "REPLACE INTO " . TABLE_PREFIX . "setting
(varname, grouptitle, value, datatype" . ($default_value ? ',defaultvalue' : '') .
")VALUES('" . $this->db->escape_string($varname) . "', '" . $this->db->escape_string($grouptitle) .
"', '" . $this->db->escape_string($value) . "',
'$datatype' ". ($default_value ? ",'" . $this->db->escape_string($default_value) . "'" : '') .
")";
$this->db->query_write($sql);
}
Rather than telling us that we are wrong and don't know what we are doing, perhaps time could be better spent doing some release QA. This type of error shouldn't take three releases to fix.Comment
-
Same thing happened to us. We then made the suggested default_value --> defaultvalue edit, then got the "MySQL Error : Duplicate entry 'socnet' for key 1".
This isn't one or two isolated incidents of retards messing up the process, we know what we are doing. This needs investigating as there is clearly something wrong, either with our tables or your upgrade script.
For the sake of argument, YES this was DEFINATELY the PL2 update. YES we definately had the files uploaded correctly. We were trying to go from 4.0.7 to 4.1.0 PL2.Last edited by NickyDee; Sat 18 Dec '10, 6:26am.Comment
-
Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
Change CKEditor Colors to Match Style (for 4.1.4 and above)
Steve Machol Photography
Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.
Comment
-
Same problem with me .. going from 4.08 to 4.1PL2 only my restored forum now shows the version as 4.1 Beta 1 ? Forum is running fine , but what do I do next, try and complete an upgrade ,.. leave it or what ?Comment
-
You use the fix in the bug report I linked to.Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
Change CKEditor Colors to Match Style (for 4.1.4 and above)
Steve Machol Photography
Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.
Comment
-
It's up to you but we did a server restore to yesterday nights backup. We weren't sure what, if anything, the partial upgrade had done to our database tables. So we figured that it was safer to rollback. Until this is resolved, I don't want to go hacking apart the upgrade scripts. A.) Because its irritating and time consuming. And B.) Because we dont want to install future upgrades ontop of a hashed up version.Comment
Related Topics
Collapse
-
by bugtogo.comHi all,
I was trying to upgrade my VB 4.2 to 5 Beta 28 but get stuck at the following point:
-----------------------------------------------------------
Database error...-
Channel: vBulletin 5 Installs & Upgrades
Tue 19 Feb '13, 5:45am -
Comment