Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#59 closed bug (worksforme)

Unable to register on test server

Reported by: matrixpoint Owned by: steinwinde
Priority: blocker Milestone: 0.1-outreach-release
Component: BW General Keywords:
Cc: philipp

Description

This error appeared when I tried to submit my registration on the test server:

#0 debug( query problem with INSERT INTO user ( id , auth_id , handle , email , pw , active , lastlogin , location ) VALUES (118, NULL , , , , '1', NULL , 3306980) mysql_error: Duplicate entry '118' for key 1 ) called at var/www/test_html/htdocs/bw/lib/bwdb.php:116 #1 sql_query(INSERT INTO user ( id , auth_id , handle , email , pw , active , lastlogin , location ) VALUES (118, NULL , , , , '1', NULL , 3306980)) called at var/www/test_html/htdocs/bw/signup.php:168 query problem with INSERT INTO user ( id , auth_id , handle , email , pw , active , lastlogin , location ) VALUES (118, NULL , , , , '1', NULL , 3306980) mysql_error: Duplicate entry '118' for key 1

I checked afterward, and it appears that my login name is not recognized, so it should not be already in the DB and therefore not a duplicate.

Change History (10)

comment:1 Changed 10 years ago by steinwinde

  • Owner set to steinwinde
  • Status changed from new to assigned

comment:2 Changed 10 years ago by micha

I can confirm this error but I think that it is produced by the cookies-setting. I will try to run another browser and try signup without beeing logged in/out before..

comment:3 follow-up: Changed 10 years ago by steinwinde

This error is almost for sure caused by unequal numbers of recordsets in members table and user table. They must be in sync, but the new signup form (which could be tested a while on test.bewelcome.org) doesn't care for keeping them in sync.

comment:4 in reply to: ↑ 3 Changed 10 years ago by micha

Replying to steinwinde:

This error is almost for sure caused by unequal numbers of recordsets in members table and user table. They must be in sync, but the new signup form (which could be tested a while on test.bewelcome.org) doesn't care for keeping them in sync.

Recently, matthias told me that the signup on alpha and the one on test are the same. So while the signup is not working on test, it works pretty well on alpha. I guess it's not a problem in the code itself but of the test-database.

Felix, can you agree on that? We could close this ticket then..

comment:5 Changed 10 years ago by philipp

do we have the same problem on localhost? if not I would suggest to replace the database on test by a fresh copy from the archive. if everything works fine with a new database we can check if we create new inconsistencies on test and alpha over time or if this is due to older messup of the database (for example by the new signup, that is currently disabled).

comment:6 Changed 10 years ago by philipp

  • Cc philipp added

comment:7 follow-up: Changed 10 years ago by micha

Well I just tried it on localhost and get a similar error message to the current on test > which is the following:

#0 debug( query problem with INSERT INTO `user` ( `id` , `auth_id` , `handle` , `email` , `pw` , `active` , `lastlogin` , `location` ) VALUES (139, NULL , '', 'lupochen@gmx.de', '', '1', NULL , 2988507) mysql_error: Cannot add or update a child row: a foreign key constraint fails (`hcvoltest/user`, CONSTRAINT `user_ibfk_2` FOREIGN KEY (`location`) REFERENCES `geonames_cache` (`geonameid`)) ) called at [/var/www/test_html/htdocs/bw/lib/bwdb.php:123] #1 sql_query(INSERT INTO `user` ( `id` , `auth_id` , `handle` , `email` , `pw` , `active` , `lastlogin` , `location` ) VALUES (139, NULL , '', 'lupochen@gmx.de', '', '1', NULL , 2988507)) called at [/var/www/test_html/htdocs/bw/signup.php:168] query problem with INSERT INTO `user` ( `id` , `auth_id` , `handle` , `email` , `pw` , `active` , `lastlogin` , `location` ) VALUES (139, NULL , '', 'lupochen@gmx.de', '', '1', NULL , 2988507) mysql_error: Cannot add or update a child row: a foreign key constraint fails (`hcvoltest/user`, CONSTRAINT `user_ibfk_2` FOREIGN KEY (`location`) REFERENCES `geonames_cache` (`geonameid`))
query problem 85.179.140.129 November 21, 2007, 10:13 am

comment:8 in reply to: ↑ 7 Changed 10 years ago by steinwinde

Replying to micha:

Well I just tried it on localhost and get a similar error message to the current on test > which is the following:

#0 debug( query problem with INSERT INTO `user` ( `id` , `auth_id` , `handle` , `email` , `pw` , `active` , `lastlogin` , `location` ) VALUES (139, NULL , '', 'lupochen@gmx.de', '', '1', NULL , 2988507) mysql_error: Cannot add or update a child row: a foreign key constraint fails (`hcvoltest/user`, CONSTRAINT `user_ibfk_2` FOREIGN KEY (`location`) REFERENCES `geonames_cache` (`geonameid`)) ) called at [/var/www/test_html/htdocs/bw/lib/bwdb.php:123] #1 sql_query(INSERT INTO `user` ( `id` , `auth_id` , `handle` , `email` , `pw` , `active` , `lastlogin` , `location` ) VALUES (139, NULL , '', 'lupochen@gmx.de', '', '1', NULL , 2988507)) called at [/var/www/test_html/htdocs/bw/signup.php:168] query problem with INSERT INTO `user` ( `id` , `auth_id` , `handle` , `email` , `pw` , `active` , `lastlogin` , `location` ) VALUES (139, NULL , '', 'lupochen@gmx.de', '', '1', NULL , 2988507) mysql_error: Cannot add or update a child row: a foreign key constraint fails (`hcvoltest/user`, CONSTRAINT `user_ibfk_2` FOREIGN KEY (`location`) REFERENCES `geonames_cache` (`geonameid`))
query problem 85.179.140.129 November 21, 2007, 10:13 am

Any error messages in regard to failing references to the geonames_cache simply mean: You forgot to import geonames_admincodes.sql and geonames_cache.sql. These are mandatory for a working signup in combination with the test database.

comment:9 Changed 10 years ago by steinwinde

For now I can't reproduce this error anymore, although I have much more records in the members table than in the user table. But this needs further analyses.

  • Can we be sure, that with the current signup PHP we *never* insert new data into members table, which is not also inserted into the user table? (Or the other way around?)
  • Can we be sure, that in case of an inconsistency in these tables we later can clean them from duplicates and other stuff?
  • Can we be sure, that in case of inconsistencies this not just breaks any new signup efforts?

comment:10 Changed 10 years ago by steinwinde

  • Resolution set to worksforme
  • Status changed from assigned to closed

I'm sure enough, the signup won't hurt for now. Reasoning: The recordset in the user table is always created *after* the recordset in the members table. There is almost nothing else in between these INSERTs. Recordsets on live database seem to be okay for the process: There are no IDs in the user table right now, which are bigger than the biggest IDs in the members table. I did some tests with realistic data on alpha.bewelcome.org. The tests were successfull. The signup procedure is going to be adapted completely in preparation for the next release - for now, what we have is enough.

Note: See TracTickets for help on using tickets.