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

Cannot add or update a child row: a foreign key constraint fails #1

Open
ext opened this issue Oct 29, 2013 · 2 comments
Open

Cannot add or update a child row: a foreign key constraint fails #1

ext opened this issue Oct 29, 2013 · 2 comments

Comments

@ext
Copy link
Member

ext commented Oct 29, 2013

Fatal error: Uncaught exception 'Exception' with message 'Internal error, failed to execute query:

INSERT INTO `deliveries` SET
`description` = ?,
`user_id` = ?
Cannot add or update a child row: a foreign key constraint fails (`nx17_retail`.`deliveries`, CONSTRAINT `deliveries_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`))

' in /var/www-kiosk/classes/BasicObject.php:314 Stack trace:
#0 /var/www-kiosk/controllers/Delivery.php(38): BasicObject->commit() #1 /var/www-kiosk/classes/Controller.php(104): DeliveryC->make(Array)
#2 /var/www-kiosk/classes/Controller.php(128): Controller::_stack('Delivery/make', Array, 'add')
#3 /var/www-kiosk/public/index.php(17): Controller::_declare('Delivery/make', Array)
#4 {main} thrown in /var/www-kiosk/classes/BasicObject.php on line 314 
@edruid
Copy link
Member

edruid commented Oct 29, 2013

My guess would be that the user "logged in" doesn't actually exist. Have you reseted your database after logging in?

@ext
Copy link
Member Author

ext commented Oct 30, 2013

Database was reset, user logged out and relogged in. Is the session cleared properly? Issue went away after a couple of attempts.

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