This post is at: ForumGeneral Questions
8 posts / 0 new
Last post
mattdarnell
mattdarnell's picture
Joined: 2007/10/25
Points: 10

I wanted to increase the amount of voice menus a tenant has but receive this error:

Server returned error code = -1
Error in 'execute' when updating table 'tenants': Cannot add or update a child row: a foreign key constraint fails (`pbxconf`.`tenants`, CONSTRAINT `tenants_ibfk_1` FOREIGN KEY (`primary_locationid`) REFERENCES `locations` (`id`))

There is an error if I change any of the limits for the one tenant. They are tenant 21.

-Matt

mattdarnell
mattdarnell's picture
Joined: 2007/10/25
Points: 10

Here is a screenshot

Attached file: 

mattdarnell
mattdarnell's picture
Joined: 2007/10/25
Points: 10

Not what changed, but the error has disappeared.

cleartalk
cleartalk's picture
Joined: 2010/05/25
Points: 0

We got the same problem with new created tenants.
It can take from several minites up to 2 days for the error to disappear.

for extra info we run a drbd cluster.

netriplex
netriplex's picture
Joined: 2012/01/24
Points: 80

Same error for newly created tenants...

I ran MySQL traces on things to determine exactly what is causing the problem so Thirdlane can resolve the issue. It does not make sense exactly why it fixes itself based on cleartalk's feedback, but...

For whatever reason the "primary_locationid" and "secondary_locationid" fields that are probably hidden fields in the edit tenant GUI screen are not properly getting pulled from the database on newly created tenants. The correct values exist in the MySQL database tenants table, but when "save" is clicked on the edit tenant screen for new tenants, the MySQL statement that is executed attempts to change these values from "1" to "NULL".

As only an option for "1" is in the location table by default, this breaks a constraint configure on the table and the error is thrown.

Why this suddenly starts working after a few hours or days I have absolutely no idea. The only thing I can think of is that the select query to retrieve these values somehow relies on the date created time in some manner.

jakeness
jakeness's picture
Joined: 2017/02/15
Points: 0

TL knows about this issue and will address it in the next release which i'm told is very soon.
I only run yum updates when TL releases come out. When this issue popped up for me I went ahead an ran it and there were a couple of TL updates along with the centos updates and it fixed it so far.

netriplex
netriplex's picture
Joined: 2012/01/24
Points: 80

Did a yum update overnight. I did not see any new Thirdlane updates pushed to the server.

Same problem exists on new tenants created yesterday.

Still waiting to see if "cleartalk"'s comment of the problem disappearing on its own after a couple days comes to fruition or whether he performs some other unknown action on his new tenants that makes the problem disappear..

thirdlane
thirdlane's picture
Joined: 2007/02/07
Points: 250

We did not make a new release yet - ETA is the coming week.

Alex Epshteyn
Third Lane Technologies
Multi Tenant Asterisk PBX