error in 20.04 sql upgrade script - userrights.sql

Use this forum for questions regarding installation, upgrading and configuration of OpenEMM

Moderator: moderator

JuergenB
Posts: 140
Joined: Thu Dec 05, 2019 9:03 pm

error in 20.04 sql upgrade script - userrights.sql

Post by JuergenB »

Hi, i need some help in upgrading from 19.10 to 20.04

I have a clean installation with a fresh database. I dropped the old database and create a new one for testing.
I have these modules installed.

runtime 19.10.009.016
frontend 19.10.000.170
backend 19.10.000.128

and if i upgrade these modules i get an error, after the fruntend updates the database and before the backend will be updated.

runtime 20.04.000.043
frontend 20.04.000.143

This is the error message, this happens during the userrights.sql

...
Executing /home/openemm/webapps/emm/WEB-INF/sql/mysql/emm-mysql-update-20.01.315-basic.sql
Executing /home/openemm/webapps/emm/WEB-INF/sql/mysql/emm-mysql-update-20.01.460-basic.sql
Executing /home/openemm/webapps/emm/WEB-INF/sql/mysql/../userrights.sql
ERROR 1452 (23000) at line 18: Cannot add or update a child row: a foreign key constraint fails (`openemm`.`admin_group_permission_tbl`, CONSTRAINT `admgrp$perm$fk` FOREIGN KEY (`security_token`) REFERENCES `permission_tbl` (`permission_name`))
DB update finished

I use this mysqld settings in /etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
lower_case_table_names=1
wait_timeout=604800
sql-mode="STRICT_ALL_TABLES,NO_ENGINE_SUBSTITUTION"

Is there anything i missed for the upgrade?

Thanks

Jürgen
aso
Posts: 33
Joined: Fri Jun 19, 2015 12:43 pm

Re: error in 20.04 sql upgrade script - userrights.sql

Post by aso »

Line 18 means the permission "campaign.autoopt".
Maybe this permission entry vanished somehow in your database.

Please try this statement and re-execute the userrights.sql.
INSERT INTO permission_tbl (permission_name, category, sub_category, sort_order, feature_package) VALUES ('campaign.autoopt', 'Campaigns', NULL, 1, NULL);
JuergenB
Posts: 140
Joined: Thu Dec 05, 2019 9:03 pm

Re: error in 20.04 sql upgrade script - userrights.sql

Post by JuergenB »

Thanks,

this is a clean fresh installed OpenEMM database from installer 19.10.

I verified the 19.10 sql script, there is no 'campaign.autoopt' in this script.

Do i need to insert this into openemm or emm database?
Can we get a fixed installer?

Thanks

Jürgen
aso
Posts: 33
Joined: Fri Jun 19, 2015 12:43 pm

Re: error in 20.04 sql upgrade script - userrights.sql

Post by aso »

Didn't you write you tried to install "frontend 20.04.000.143" in your first post?
Does the error happen in version 20.04 or 19.10?
In 19.10 this permission did not exist.
It is new in 20.04.
JuergenB
Posts: 140
Joined: Thu Dec 05, 2019 9:03 pm

Re: error in 20.04 sql upgrade script - userrights.sql

Post by JuergenB »

I have a clean, fresh install with 19.10 (and although a production 19.10 i wish to upgrade).

So, i have a clean fresh 19.10 running.
I do a Install or update package from AGNITAS Website

Here i get all the latest modules and frontend, backend, gui, ... upgrade.
The installer downloads these modules and after the frontend is downloaded.

The script is upgrading the 19.10 to 20.04 (database structure and content)...

And here the script fails.
aso
Posts: 33
Joined: Fri Jun 19, 2015 12:43 pm

Re: error in 20.04 sql upgrade script - userrights.sql

Post by aso »

Please try our new released Version 20.04.000.155.
It is available via the standard update process and should fix this problem.
JuergenB
Posts: 140
Joined: Thu Dec 05, 2019 9:03 pm

Re: error in 20.04 sql upgrade script - userrights.sql

Post by JuergenB »

Thanks aso,

the new release works fine, i had no problems during an upgrade from 19.10 to 20.04 with the new runtime.

Thanks!
:D :D

Now, i`ll try to upgrade CentOS 7 to 8 or move mariadb and all config to a new VM ... 8)
Didn´t worked well, got some problems after upgrade.

Much easier to install 20.04 with the same setting under CentOS 8.
Dump and Restore mariadb ...
Done :)
Post Reply