Closed (fixed)
Project:
Real Name
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
15 Jun 2009 at 11:12 UTC
Updated:
6 Jun 2013 at 04:57 UTC
Jump to comment: Most recent file
At admin/reports/dblog I have several logs of an php error like this:
Duplicate entry '489' for key 'PRIMARY' query: INSERT INTO realname (uid, realname) VALUES (489, 'Jane Doe') in /var/www/drupal-6.12/includes/common.inc on line 3476.
Don't know what these errors are caused by. I am using RealName 6.x-1.x-dev (2009-May-13) with Drupal 6.12.
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | realname_492066.patch | 1.14 KB | coderintherye |
| #21 | realname.patch | 1.14 KB | coderintherye |
| #16 | realname-492066.patch | 1.03 KB | coreyp_1 |
| #6 | realname_492066.patch | 1.14 KB | tim.plunkett |
| #2 | Duplicate entry PHP errors.png | 21.71 KB | roball |
Comments
Comment #1
black silence commentedi think that error may occur when a user account is created, but the fields which realname is set to use for realname creation have no content.
example:
realname uses a "last name" field to create the realname, but when the user account is created that field has no content
I have that issue myself, attached patch should fix it - check if the realname is an empty string, then use UPDATE instead of INSERT
Comment #2
roball commentedI'm not sure because my log is full of these PHP errors, but the users do have their realname fields set to proper values. See the attached screenshot of admin/reports/dblog.
Now with the (patched) "common.inc" of Drupal 6.13, the line number is 3492, which is the first line of
Comment #3
roball commentedComment #4
hefox commentedwhen saving a user I have a similar problem but it's when the realname field in the database is set to '' for whatever reason, not the actual result of _realname_make_name
that was my solution
Comment #5
roball commentedNancy, do you think about committing the solution posted above?
Comment #6
tim.plunkettThe changes in #4 worked for me.
Here's a patch.
Comment #7
nancydruThanks
Comment #8
roball commentedI am still getting the same errors with the latest dev version (2009-Oct-09) of RealName and D6.14.
Comment #9
coderintherye commentedAre you getting errors from a fresh 6.x install on a fresh database, i.e. are you able to reproduce this error or is it just on your database? If you get this on a fresh install I will attempt to reproduce, otherwise I would look at try uninstall/reinstall to see if rebuilding the tables does any good.
Comment #10
roball commentedI have completely uninstalled RealName, freshly installed v6.x-1.3 and rebuilt the realname table. Let's see if that finally solved the problem.
Comment #11
coderintherye commentedCool, thanks. Let me know if you receive the error again. Thanks.
Comment #12
coderintherye commentedComment #13
roball commentedHm, I am still observing these error messages, but not every time a user logs in. In addition to the messages referring to
common.inc, there are also messages referring torealname.module, like this:Line 707 of
realname.moduleis withinComment #14
coderintherye commentedCan you try making a backup of your realname table, then empty it and then have some users login/logout/login again and see if the problem persists.
Comment #15
roball commentedJust did it. Now I have to watch the dblog for some time to find out if that helped.
Comment #16
coreyp_1 commentedThanks to the previous posters for getting us this far on the bug! The patch in #6 should work, but is incomplete because of a few issues. Specifically:
"s"should be"%s".Since the patch in #6 has already been committed, I am attaching a patch against the latest dev. On my site, implementing the attached patch saves me about 30 database calls per page view, and sometimes more.
-Corey
Comment #17
roball commented@ #14-15: That suggestion did not help, unfortunately.
@ #16: Thanks for the revised patch, coreyp_1. I'll apply it and report back if it solved the problem.
Comment #18
roball commentedThe patch in #16 seems to work fine, however - after monitoring my dblog for a while - I still see some of those "Duplicate entry..." errors.
Comment #19
coderintherye commentedI wanted to test out this patch but darn PHP 5.3 on my fresh xampplite install is running into Drupal bugs. I will hopefully test this weekend when I can run it on another install.
Comment #20
YK85 commentedsubscribing
Comment #21
coderintherye commentedPatch had just one very minor issue of missing a space after a comma, otherwise applied cleanly on Drupal 6.x-1.x-dev. So just re-rolling with the space and going to run it through coder again. If that checks out ok I'm going to set to RTBC and hopefully get a comment from NancyDru before committing.
Sorry that this took so long.
Comment #22
coderintherye commentedOops missed the naming standard, so uploading again with full name. Checked patch through coder and no problems were found.
Comment #23
coderintherye commentedSo current status is just want buy-in from NancyDru and then she can commit it or if she wants I can commit it.
Comment #24
nancydruWith the fixes I have just committed the code is what you show. After the -dev release rolls out, please see if this issue is fixed. If it is not, reopen it.
Comment #26
roball commentedJust updated RealName from 6.x-1.3 to the latest 6.x-1.x-dev (2010-May-27). Will have to watch the dblog for a while to see if the warnings are gone.
Comment #27
cjback commentedUsing RealName 6.x-1.4 Drupal version 6.20
Received same error. Did the fix not get applied to version 6.x-1.4?
Comment #28
roball commentedUse the latest official releases: Drupal core 6.28 and Real Name 6.x-1.5. The bug should have been fixed.