License manager - error addnig license

Antworten
stept_
Beiträge: 9
Registriert: 28 Mär 2015, 23:18

License manager - error addnig license

Beitrag von stept_ »

I try to add new license, but I get following error:
Opsi service error: [DataError] (1406, "Data too long for column 'licenseKey' at row 1")
License is 102 characters long.

I've checked definition of LICENSE_ON_CLIENT table:
+----------------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------------+------+-----+---------+----------------+
| license_on_client_id | int(11) | NO | PRI | NULL | auto_increment |
| softwareLicenseId | varchar(100) | NO | MUL | NULL | |
| licensePoolId | varchar(100) | NO | | NULL | |
| clientId | varchar(255) | YES | MUL | NULL | |
| licenseKey | varchar(100) | YES | | NULL | |
| notes | varchar(1024) | YES | | NULL | |
+----------------------+---------------+------+-----+---------+----------------+

Is it possible to safely alter LICENSE_ON_CLIENT table and change "licenseKey" to e.g. "varchar(105)"?
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: License manager - error addnig license

Beitrag von n.wenselowski »

Hi stept,

I found that a quite interesting error as the length for that column was changed to 1024 some years ago. Digging a little more I found that the update-routine for MySQL did create the table only with a length of 100. Is this an older server that got updated some time ago?

Anyway you should be safe to alter the length to 1024.

I created an internal ticket so that this gets fixed with a future release.
Thanks for reporting! :)


Kind regards

Niko

Code: Alles auswählen

import OPSI
panisch
Beiträge: 47
Registriert: 02 Okt 2014, 15:22

Re: License manager - error addnig license

Beitrag von panisch »

Hey,

would he not need to update the following tables as well?
SOFTWARE_LICENSE_TO_LICENSE_POOL
SOFTWARE_LICENSE

Each of them has column:
softwareLicenseId varchar(100)

I didn't check any other tables right now, just the most obvious ones
stept_
Beiträge: 9
Registriert: 28 Mär 2015, 23:18

Re: License manager - error addnig license

Beitrag von stept_ »

After alter LICENSE_ON_CLIENT and change 'licenseKey' to 'varchar(1024)' error presists. So maybe panisch is right and I need alter more tables with column 'licenseKey' (not 'softwareLicenseId')? Which are they?

And answering previous question. Server was clean installed to version 4.0.5, but database was migrated from the old one (mysqldump)
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: License manager - error addnig license

Beitrag von n.wenselowski »

Hi,

with python-opsi 4.0.7.2 there should be a working fix.
This version is currently available in experimental - instructions how to get it.
Warning: please do not use this on your live system and do not forget to disable the repo after installation of the package to not get all packages from experimental!

After installing that version opsi-setup --update-mysql should be everything you need to get this working.

I'd like to hear if this fixes it for you!


Kind regards

Niko

Code: Alles auswählen

import OPSI
stept_
Beiträge: 9
Registriert: 28 Mär 2015, 23:18

Re: License manager - error addnig license

Beitrag von stept_ »

Hello,
thank you for replay. What do you mean by "live system"? I would like to fix it on our production environment.
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: License manager - error addnig license

Beitrag von n.wenselowski »

Hi,
stept_ hat geschrieben:Hello,
thank you for replay. What do you mean by "live system"? I would like to fix it on our production environment.
I was referring to your production environment. :D
We do warn people not to do so they do not get stuck somewhere if things do not work as expected. But you are free to just ignore our warning and do it anyway. In either case I suggest creating a backup before changing the system ;)


-Niko

Code: Alles auswählen

import OPSI
stept_
Beiträge: 9
Registriert: 28 Mär 2015, 23:18

Re: License manager - error addnig license

Beitrag von stept_ »

Hi,
I've manually altered SOFTWARE_LICENSE_TO_LICENSE_POOL and SOFTWARE_CONFIG and it works. Problem solved.
Antworten