By radiodee1 on
I've got drupal setup on my computer locally in my 'public_html' folder for some small development that I'm doing. I get this message when I log out and log in. It didn't do this when I first installed drupal. Can someone tell me what it means?
user warning: Duplicate entry '' for key 2 query: INSERT INTO users (uid, created) VALUES (163, 1230134180) in /home/my-user/public_html/my-drupal/includes/database.mysql.inc on line 174.
Comments
that does not look good
Are you sure there are no broken modules installed? It could be the reason, maybe some module that is adding accounts if they are not there?
Drupal should not insert new users if you just login or logout so im not sure.
I recommend start logging all sql queries so you could see what exactly is going on.
I dont know how drupal 5 works as i only work on 6 so im sorry if im all wrong and drupal is adding users with each login :-)
Art
--------
http://artur.ejsmont.org
thanks
I hear what you're saying, and I'm working on a small module, so that could be the problem. I'm about to rewrite some of the module and hook_user() as well. Here's a question. Can you use 'user_save()' in the hook_user() function? If you use user_save() wrong, does it create an entirely new user?
Also, how do you log all sql queries? Can you give me instructions or point me to a good page?
Thanks for the reply.
logging
well safest place would be to turn on logging in mysql so you cant miss anything then. I believe there is long query variable or something of that sort. Then setting it to zero makes all queries logged in mysql log.
I myself was doing it in a very nasty way as i hacked the /includes/database.mysqli.inc and added my own logging there ... as i did not want to log garbage like cache tables inserts etc which bloat the log like hell.
but i know its not pretty approach so i never commit this change to my svn ;-) hehe
devel module is supposed to do it for you as well but did not work for me .... or i did not know where to go.
As to save user ... i really dont know this seems like a good place to go:
http://api.drupal.org/api/function/hook_user
Id say make sure that you are not saving it on any operation (dont know when you want it to save) and make sure uid is there.
Art
--------
http://artur.ejsmont.org