Advertisement:

Author Topic: Database/subs-post.php error on Post after installing MODs  (Read 15696 times)

Offline URPG

  • Jr. Member
  • **
  • Posts: 360
Database/subs-post.php error on Post after installing MODs
« on: April 06, 2006, 06:31:25 AM »
Hi there!

I get on posting and on sending PM:
Code: [Select]
Database Error: Duplicate entry '0' for key 1
File: /hp/aa/ae/eq/www/urpg/smf/Sources/Subs-Post.php
Line: 744

System:
SMF1.1RC2 (+Googlebot & Spiders Mod +Enhanced Move Tag +Fly Tag +More HTML tags +Custom Profile Mod +EmailFlash +CAPTCHA (code verification) +MessagePreviewOnHover +Ignore user +Karma On Memberlist +Merge Double Posts +Quick Upload +SMF 1.0.7 / 1.1 RC2 Update)

MKP1.1RC1 (+who download +MKP Statistics + Radio)

Tried to install but failed:
No Changing Moderator's Edit 0.3 error:
Code: [Select]
1024: Undefined XML element: search from /hp/aa/ae/eq/www/urpg/smf/Sources/Subs-Package.php on line 1409
File: /hp/aa/ae/eq/www/urpg/smf/Sources/Subs-Package.php
Line: 2791

Award Mod 1.1 error:
Code: [Select]
1024: Undefined XML element: search from /hp/aa/ae/eq/www/urpg/smf/Sources/Subs-Package.php on line 1409
File: /hp/aa/ae/eq/www/urpg/smf/Sources/Subs-Package.php
Line: 2791

Topic Ratings 1.03 error:
Code: [Select]
512: parseBoardMod(): The filename '$sourcdeir/Subs-Boards.php' is not a full path!
File: /hp/aa/ae/eq/www/urpg/smf/Sources/Subs-Package.php
Line: 1670

One of those Mod's must have messed up subs-Post.php
The Tag things are unlikely, but i got no idea. Any sugestions on how to install the 3 failed packages by hand and how to repair subs-Post.php? It does sound like a duplicate line or something, but i got no idea about this stuff...

All of those packages were downloaded yesterday from this server and i only clicked install if the test for installation was positive. (Still got those 3 errors and the posting Problem now).

You may want to check the site: urpg.info

Help! I already posted a re-direction in my old Forum...
« Last Edit: April 06, 2006, 08:33:11 AM by URPG »

Offline URPG

  • Jr. Member
  • **
  • Posts: 360
Re: Database/subs-post.php error on Post after installing MODs
« Reply #1 on: April 06, 2006, 08:32:09 AM »
Uploaded the subs-post.php to yousendit.com in case anyone want's to take a look :)

Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Database/subs-post.php error on Post after installing MODs
« Reply #2 on: April 06, 2006, 08:43:25 AM »
Have you recently moved your database to a new server?
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Offline URPG

  • Jr. Member
  • **
  • Posts: 360
Re: Database/subs-post.php error on Post after installing MODs
« Reply #3 on: April 07, 2006, 03:29:03 AM »
YEs I have. I Exported the Database, uploaded it again on a new server (new domain, new database name). But i did fix the settings (Templates location, Database Excess, etc.)?

Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Database/subs-post.php error on Post after installing MODs
« Reply #4 on: April 07, 2006, 08:30:50 AM »
When you moved the database, the auto increment value was reset to zero in the personal_messages table.  You can fix this by executing the following SQL query in phpMyAdmin:

ALTER TABLE smf_personal_messages AUTO_INCREMENT = 1;

Replace smf_ with your table prefix.
« Last Edit: April 08, 2006, 09:39:37 AM by kegobeer »
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Offline URPG

  • Jr. Member
  • **
  • Posts: 360
Re: Database/subs-post.php error on Post after installing MODs
« Reply #5 on: April 08, 2006, 08:03:15 AM »
The Forum is displayed all right, tables were smf_ and are smf_

This is what i get from the uery:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AUTO INCREMENT = 1' at line 1

The only place i could find "auto increment" in phpMyAdmin was as checkbox option when i copy a table. Shall i copy this table, check the "add auto increment value" box, and use it to replace the old table?

Sorry for the slow answer, it is actualy quite urgent, but i was away from any internet for 2 days...

Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Database/subs-post.php error on Post after installing MODs
« Reply #6 on: April 08, 2006, 09:39:23 AM »
Sorry, typo on my part.  It should be AUTO_INCREMENT = 1, not AUTO INCREMENT = 1.  Forgot the underscore.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Offline URPG

  • Jr. Member
  • **
  • Posts: 360
Re: Database/subs-post.php error on Post after installing MODs
« Reply #7 on: April 09, 2006, 05:48:11 AM »
The query was exectued Successful (sorry, could have noticed the underscore myself if i would know some more about SQL) but i get

Code: [Select]
Database Error: Duplicate entry '0' for key 1
File: /hp/aa/ae/eq/www/urpg/smf/Sources/Subs-Post.php
Line: 744

on posting PM or Messages to the Forum :(

Offline URPG

  • Jr. Member
  • **
  • Posts: 360
Re: Database/subs-post.php error on Post after installing MODs
« Reply #8 on: April 09, 2006, 08:04:25 AM »
I get the same error in subs.php if i try to edit the Forum News. News are changed, but i get this error message, PM and Posts are not working it seems.  :'(

Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Database/subs-post.php error on Post after installing MODs
« Reply #9 on: April 09, 2006, 09:00:19 AM »
Use phpMyAdmin to examine the structure of the messages table - ID_MSG should not have a default value, and auto_increment should be in the extra field.  You'll probably have to examine all of your SMF tables and look for the same thing.  Exclude the following tables (they have no auto increment key):

board_permissions
collapsed_categories
all of the log_ tables except for log_actions, log_banned, and log_errors
moderators
permissions
pm_recipients
poll_choices
sessions
settings
themes

"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Offline URPG

  • Jr. Member
  • **
  • Posts: 360
Re: Database/subs-post.php error on Post after installing MODs
« Reply #10 on: April 09, 2006, 01:11:56 PM »
Example: smf_attatchments has: ID_MSG int(10) ... default 0 ... no field "auto_increment"

so i execute

ALTER TABLE smf_attatchments AUTO_INCREMENT = 1;

and go to check the next table?

Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Database/subs-post.php error on Post after installing MODs
« Reply #11 on: April 09, 2006, 01:17:25 PM »
You can use phpMyAdmin to edit the table structure instead of executing the query.  For example, in the attachments table, view the structure and then click the pencil icon in the ID_ATTACH row.  You can then select auto_increment in the extra field, and delete the 0 from the default value field.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Database/subs-post.php error on Post after installing MODs
« Reply #12 on: April 09, 2006, 01:41:53 PM »
To prevent this in future backups/restores/moves, when using phpMyAdmin make sure "Add AUTO_INCREMENT Value" is checked during the export process.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Offline URPG

  • Jr. Member
  • **
  • Posts: 360
Re: Database/subs-post.php error on Post after installing MODs
« Reply #13 on: April 09, 2006, 01:49:56 PM »
The database is still on the old server! I cannot use phpmyadmin to DL it because gZIP compression is disabled and it's >2 MB but i can get it with SMF uncompressed export... I am rather sure i let SMF export the databse to sql file in the first place...

Offline URPG

  • Jr. Member
  • **
  • Posts: 360
Re: Database/subs-post.php error on Post after installing MODs
« Reply #14 on: April 09, 2006, 01:58:24 PM »
Did fix smf_attatchments (ID_attatch: deleted the 0). and smf_messages (ID_msg: delted 0, set auto increment)...

Still get that error?!

Do i have to kill all the 0's in the default boxes?

I did create the SQL file with SMF and uploaded it by opening the remote DB on the new server with mySQL-Front and importing the smf_tables. Could this have caused the trouble? Then i can change some settings and just import again?
« Last Edit: April 09, 2006, 02:04:11 PM by URPG »

Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Database/subs-post.php error on Post after installing MODs
« Reply #15 on: April 09, 2006, 02:08:11 PM »
You'll have to go thru all the tables.  You'll then have to reset the auto_increment value with ALTER TABLE xxx AUTO_INCREMENT = 1;

If you PM me your sql file I'll take a look at it.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Offline URPG

  • Jr. Member
  • **
  • Posts: 360
Re: Database/subs-post.php error on Post after installing MODs
« Reply #16 on: April 09, 2006, 08:06:53 PM »
solved :)

Offline sharkk

  • Newbie
  • *
  • Posts: 4
Re: Database/subs-post.php error on Post after installing MODs
« Reply #17 on: July 13, 2007, 10:13:43 AM »
You can use phpMyAdmin to edit the table structure instead of executing the query.  For example, in the attachments table, view the structure and then click the pencil icon in the ID_ATTACH row.  You can then select auto_increment in the extra field, and delete the 0 from the default value field.
I've a similar problem, but when I do this,

 ALTER TABLE `smf_permissions` CHANGE `ID_GROUP` `ID_GROUP` SMALLINT( 6 ) NOT NULL AUTO_INCREMENT

MySQL meldet:
#1582 - ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '2-search_posts' for key 'PRIMARY'


Quote
Updating Settings.php... Successful.
Creating new tables and inserting default data...
    Creating "themes"... done.
    Creating "collapsed_categories"... done.
    Creating and verifying "permissions"... done.
    Inserting data into "permissions"... Unsuccessful!
This query:

    INSERT INTO smf_permissions
    (ID_GROUP, permission)
    VALUES (-1, 'search_posts'), (-1, 'calendar_view'), (-1, 'view_stats'), (-1, 'profile_view_any'),
    (2, 'calendar_post'), (2, 'calendar_edit_any'), (2, 'calendar_edit_own');

Caused the error:

    Duplicate entry '-1-search_posts' for key 'PRIMARY'

can you help me out of this?

thanks
rakso

Offline redone

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,939
  • Gender: Male
Re: Database/subs-post.php error on Post after installing MODs
« Reply #18 on: July 13, 2007, 10:26:31 AM »
I would attempt to insert the query via phpmyadmin and run the upgrade again. There are many potential issues, your version of MySQL, whether all the required fields have auto_increment set and potential duplicate enteries.

I generally insert the information by hand if the automatic process fails.