Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with Stress.php #4

Open
mahughj opened this issue Mar 9, 2016 · 2 comments
Open

Error with Stress.php #4

mahughj opened this issue Mar 9, 2016 · 2 comments

Comments

@mahughj
Copy link
Collaborator

mahughj commented Mar 9, 2016

Hey all - I'm getting a weird error for stress.php that I haven't gotten before - is anyone else getting it? it's saying that user0@example.com is being duplicated as an email. nothing appears to be wrong with the code itself. Error reads:


Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'user0@example.com' for key 'email'' in /nfs/stak/students/m/mahughj/public_html/cs290-project/stress.php:119 Stack trace: #0 /nfs/stak/students/m/mahughj/public_html/cs290-project/stress.php(119): PDOStatement->execute() #1 {main}

thrown in /nfs/stak/students/m/mahughj/public_html/cs290-project/stress.php on line 119

@mahughj
Copy link
Collaborator Author

mahughj commented Mar 9, 2016

and in the database it has all the users but 2-87

@magical
Copy link
Owner

magical commented Mar 9, 2016

Yeah, known problem. Stress.php tries to avoid duplicate keys by deleting all the users and groups above a certain id (on lines 90-93), figuring that they were probably added by a previous run of stress.php. I used user_id > 8 to select the rows to delete, even though create only adds 6 users, because when i wrote it i had created two extra users that i didn't want to delete. That's probably the cause of your problem. Adjust the limit down to 6 or whatever you need (or 0, to delete everything). Or just run create.php to reset everything.

magical added a commit that referenced this issue Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants