-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
MySQL foreign key constraints #343
Comments
I have the same problem.
And while importing a backup I got this:
I have used |
it arrive because user system does not exist in table users with id "0". I create user with id 0 and no worries after. |
Same problem with latest github version when using MySQL.
After inserting a new row with ID = 0 new hosts can be added, but when trying to delete one:
|
Question: Which MySQL versions are compatible for use as back-end? I experience problems with MariaDB 10.3 and 10.7:
Actual Result / Problem
Long story short: rebuilding my kubernetes cluster due to changes in underlying host. Got all pods running but import of backup fails with a MySQL error:
error: Error 1451: Cannot delete or update a parent row: a foreign key constraint fails (
sshportal
,host_group_acls
, CONSTRAINTfk_host_group_acls_acl
FOREIGN KEY (acl_id
) REFERENCESacls
(id
))I get similar errors when adding hosts or assigining hosts to groups via sshportal's admin commands.
already tried dumping the DB, modifying the dump and then importing it.. but i get similar errors.
Another one:
config> host create --name --group 2 ssh://@
error: Error 1452: Cannot add or update a child row: a foreign key constraint fails (
sshportal
.hosts
, CONSTRAINTfk_hosts_hop
FOREIGN KEY (hop_id
) REFERENCEShosts
(id
))Expected Result / Suggestion
It has worked before, but I accidentally used the "latest"-tag and my old environment is unavailable to check what version I was running.
I of course do not expected to see SQL-errors when adding hosts.
Some context
Using image docker.io/moul/sshportal:latest, but also tried versions 1.19.3, 1.19.0.
version: n/a
debug mode (server): false
Hostname: sshportal-7cf9d56bd4-dq7j5 (Kubernetes Pod)
CPUs: 4
Demo mode: false
DB Driver: mysql
DB Conn: root:@tcp(sshsql:3306)/sshportal?charset=utf8&parseTime=true&loc=Local
Bind Address: :2222
System Time: 2022-04-06T09:06:26.302297884Z
OS Type: linux
OS Architecture: amd64
Go routines: 10
Go version (build): go1.18
Uptime: 15h32m50.066400161s
User ID: 1
User email: admin@localhost
Version: n/a
GIT SHA: n/a
GIT Tag: n/a
The text was updated successfully, but these errors were encountered: