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: 51
Joined: Thu Dec 05, 2019 9:03 pm

error in 20.04 sql upgrade script - userrights.sql

Post by JuergenB » Tue Jun 23, 2020 9:10 pm

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: 10
Joined: Fri Jun 19, 2015 12:43 pm

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

Post by aso » Wed Jun 24, 2020 12:00 pm

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: 51
Joined: Thu Dec 05, 2019 9:03 pm

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

Post by JuergenB » Wed Jun 24, 2020 3:04 pm

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: 10
Joined: Fri Jun 19, 2015 12:43 pm

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

Post by aso » Wed Jun 24, 2020 3:22 pm

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: 51
Joined: Thu Dec 05, 2019 9:03 pm

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

Post by JuergenB » Wed Jun 24, 2020 4:25 pm

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: 10
Joined: Fri Jun 19, 2015 12:43 pm

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

Post by aso » Thu Jun 25, 2020 8:35 am

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: 51
Joined: Thu Dec 05, 2019 9:03 pm

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

Post by JuergenB » Thu Jun 25, 2020 7:15 pm

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