Jump to content

Error in MySQL when add category (in all apps)


Go to solution Solved by PersonalMode,

Recommended Posts

Posted

Hi the community,

Can you help me, because I try to find the solution since few weeks.

With no reasons, when I try to add a new category in gallery, or forum, or in database from Page, I always have an error about the permissions.

Here an example of the last error :

INSERT INTO `ibf_core_permission_index` ( `app`, `perm_type`, `perm_type_id`, `perm_view`, `perm_2`, `perm_3`, `perm_4`, `perm_5` ) VALUES ( 'forums', 'forum', 163, '*', '', '', '', '' )
IPS\Db\Exception: Duplicate entry '1945' for key 'PRIMARY' (1062)

I use Community 4.2.6 and I cannot upgrade now (too much custom), and the news are too hot now to begin a big work of custom.

Thanks a lot

Posted

Sounds like you need to just remove the extra duplicate entry noted in the ipb_core_permission_index table.  Before you do anything, take a full backup of the database just to be safe.  

Also... the version of IPB that you are running is over 5 years old.  In that time, there have been over a dozen critical security fixes.  I know it sucks to hear you should upgrade, but you REALLY need to work on upgrading.  

  • 2 weeks later...
Posted

No chance. The problem was not fixed with the 4.7.3 update. At least with the forum, because in the gallery it seems that it works again.

INSERT INTO `ibf_core_permission_index` ( `app`, `perm_type`, `perm_type_id`, `perm_view`, `perm_2`, `perm_3`, `perm_4`, `perm_5` ) VALUES ( 'forums', 'forum', 165, '*', '*', '', '11,4,7,12,10,3,13,6,9,8', '11,4,7,12,10,3,13,6,9,8' )
IPS\Db\Exception: Duplicate entry '1957' for key 'PRIMARY' (1062)

 

  • 2 weeks later...
Posted
On 10/11/2022 at 9:59 PM, Randy Calvert said:

Sounds like you need to just remove the extra duplicate entry noted in the ipb_core_permission_index table. 

I'm not an expert in MySQL. I don't see in this table, where there is extra duplicate entry.

 

Posted

At this point, you are really at a crossroad where you need to get your site upgraded. It may well be you are hitting a bug that is causing the duplicated items there. 

For context, you are 44 releases behind, which is 5 years behind. In addition to this, 10 of those were security related, so you are running software with known security flaws

Posted
On 10/20/2022 at 1:40 AM, PersonalMode said:

No chance. The problem was not fixed with the 4.7.3 update. 

 

49 minutes ago, Marc Stridgen said:

At this point, you are really at a crossroad where you need to get your site upgraded. It may well be you are hitting a bug that is causing the duplicated items there. 

For context, you are 44 releases behind, which is 5 years behind. In addition to this, 10 of those were security related, so you are running software with known security flaws

Hi @Marc Stridgen
Like I said, I finally decided to update. I have the latest version (4.7.3).

But the update did not fix the problem (except for the Gallery app apparently)

Just try to add a new forums

INSERT INTO `ibf_core_permission_index` ( `app`, `perm_type`, `perm_type_id`, `perm_view`, `perm_2`, `perm_3`, `perm_4`, `perm_5` ) VALUES ( 'forums', 'forum', 167, '*', '*', '11,4,7,12,10,3,13,6,9,8', '11,4,7,12,10,3,13,6,9,8', '11,4,7,12,10,3,13,6,9,8' )
IPS\Db\Exception: Duplicate entry '1971' for key 'PRIMARY' (1062)
#0 /home3/depechem/public_html/system/Db/Db.php(941): IPS\_Db->preparedQuery()
#1 /home3/depechem/public_html/system/Node/Model.php(1898): IPS\_Db->insert()
#2 /home3/depechem/public_html/system/Node/Controller.php(1246): IPS\Node\_Model->setPermissions()
#3 /home3/depechem/public_html/applications/forums/modules/admin/forums/forums.php(122): IPS\Node\_Controller->permissions()
#4 /home3/depechem/public_html/system/Dispatcher/Controller.php(107): IPS\forums\modules\admin\forums\_forums->permissions()
#5 /home3/depechem/public_html/system/Node/Controller.php(69): IPS\Dispatcher\_Controller->execute()
#6 /home3/depechem/public_html/applications/forums/modules/admin/forums/forums.php(44): IPS\Node\_Controller->execute()
#7 /home3/depechem/public_html/system/Dispatcher/Dispatcher.php(153): IPS\forums\modules\admin\forums\_forums->execute()
#8 /home3/depechem/public_html/admin/index.php(13): IPS\_Dispatcher->run()
#9 {main}

 

Just now, PersonalMode said:

Just try to add a new forums

The new forums appears in the AdminPC

Could contain: Page, Text, Monitor, Screen, Hardware, Electronics, Computer Hardware

But not in the public area

Could contain: File, Text

Posted
56 minutes ago, Adriano Faria said:

Do you have this every time you try to create a  forum? Does it happen with other apps too (Gallery, Downloads, Blogs, Pages, 3rd-party, etc.)?

Yes, every time, and all app (I try on Forums, Pages, Gallery)

Just try on Dowload App, same error

Posted (edited)
3 hours ago, PersonalMode said:

ust try to add a new forums

INSERT INTO `ibf_core_permission_index` ( `app`, `perm_type`, `perm_type_id`, `perm_view`, `perm_2`, `perm_3`, `perm_4`, `perm_5` ) VALUES ( 'forums', 'forum', 167, '*', '*', '11,4,7,12,10,3,13,6,9,8', '11,4,7,12,10,3,13,6,9,8', '11,4,7,12,10,3,13,6,9,8' )
IPS\Db\Exception: Duplicate entry '1971' for key 'PRIMARY' (1062)
#0 /home3/depechem/public_html/system/Db/Db.php(941): IPS\_Db->preparedQuery()
#1 /home3/depechem/public_html/system/Node/Model.php(1898): IPS\_Db->insert()
#2 /home3/depechem/public_html/system/Node/Controller.php(1246): IPS\Node\_Model->setPermissions()
#3 /home3/depechem/public_html/applications/forums/modules/admin/forums/forums.php(122): IPS\Node\_Controller->permissions()
#4 /home3/depechem/public_html/system/Dispatcher/Controller.php(107): IPS\forums\modules\admin\forums\_forums->permissions()
#5 /home3/depechem/public_html/system/Node/Controller.php(69): IPS\Dispatcher\_Controller->execute()
#6 /home3/depechem/public_html/applications/forums/modules/admin/forums/forums.php(44): IPS\Node\_Controller->execute()
#7 /home3/depechem/public_html/system/Dispatcher/Dispatcher.php(153): IPS\forums\modules\admin\forums\_forums->execute()
#8 /home3/depechem/public_html/admin/index.php(13): IPS\_Dispatcher->run()

There must already be an entry for that key in the table.

Can you run this sql query?

SELECT * FROM ibf_core_permission_index WHERE perm_id = 1971;

Another thing to check is if the perm_id field is set as AUTO_INCREMENT.

 

Edited by Miss_B
Posted
On 11/2/2022 at 12:58 PM, Miss_B said:

Can you run this sql query?

SELECT * FROM ibf_core_permission_index WHERE perm_id = 1971;

Hi, here is what I get

Could contain: City, Text, Hardware, Electronics

 

On 11/2/2022 at 12:58 PM, Miss_B said:

Another thing to check is if the perm_id field is set as AUTO_INCREMENT.

 

Yes.

 

On 11/2/2022 at 11:54 AM, Marc Stridgen said:

Before we continue, please visit support within your admin CP and address the mysql items shown

I assume you are talking about that?

Could contain: Mobile Phone, Phone, Electronics, Text

I guess it's better to pass the tables to InnoDB first and then proceed to the "Compact" step

 

  • Solution
Posted
On 11/2/2022 at 11:54 AM, Marc Stridgen said:

Before we continue, please visit support within your admin CP and address the mysql items shown

I make a copy of my database. After the copy, the problem with 'Compact' table type was resolved.
 

Then I use this process to convert MyISAM tables to InnoDB

From now, this seems to have solved my original problem. But I haven't finished testing in all the apps

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...