Cannot add a new publisher with the same admin email

Hi

I I try to add a new publisher I would like to have the same admin like another publisher. So I entered for the admin email the same address like an existing publisher.
After I pushed the “create” button no error message apears in the admin console an no publisher have been created.

In the kaltlog I got the following message:

2017-03-28 17:11:40 [0.000235] [10.0.251.87] [1091385801] [28] [API] [KalturaStatement->execute] DEBUG: Sql took - 8.9883804321289E-5 seconds
2017-03-28 17:11:40 [0.000256] [10.0.251.87] [1091385801] [29] [API] [PartnerService->registerAction] CRIT: exception 'SignupException' with message 'User with email [roger.admin@htwchur.ch] already exists in system.' in /opt/kaltura/app/alpha/apps/kaltura/lib/myPartnerRegistration.class.php:334
Stack trace:
#0 /opt/kaltura/app/api_v3/services/PartnerService.php(88): myPartnerRegistration->initNewPartner('roger1', 'roger1', 'roger.admin@ht...', 0, 'yes', 'Admin Console', NULL, NULL, Object(Partner), false, 107)
--
#7 {main}
2017-03-28 17:11:40 [0.000346] [10.0.251.87] [1091385801] [30] [API] [KalturaFrontController->getExceptionObject] ERR: exception 'KalturaAPIException' with message 'Error while registering partner' in /opt/kaltura/app/api_v3/services/PartnerService.php:100
Stack trace:
#0 [internal function]: PartnerService->registerAction(Object(KalturaPartner), '', 107, false)

I know this worked in version 11.21 because I created 2 publisher for me.
We are using version 12.10 on debian.

Kind Regards
Roger

Hi @roger78,

Yes, that was changed recently. If you wish to create a new partner with an email address that already belongs to another, you still can but you’ll have to do so using the API while passing along the cmsPassword param with the passwd you set when you created the original partner.
You can use this script for that:

<?php
if (count($argv)<4){
    echo __FILE__ . '  <partner email> <partner name> <partner passwd> <service_url> '."\n";
    exit (1); 
}
require_once('/opt/kaltura/web/content/clientlibs/php5/KalturaClient.php');
$config = new KalturaConfiguration();
$config->serviceUrl = $argv[4];
$client = new KalturaClient($config);
$expiry = null;
$privileges = null;
$email=$argv[1];
$name=$argv[2];
$cmsPassword=$argv[3];
$userId = null;
$partner = new KalturaPartner();
$partner->name=$name;
$partner->adminName=$name;
$partner->description=" "; //cannot be empty or null
$partner->adminEmail=$email;
try {
    $results = $client->partner->register($partner, $cmsPassword);
}catch (KalturaException $ex){
    $message=$ex->getMessage();
    $error_code=$ex->getCode();
    echo "Failed on partner->register() with $email. Message was: $message, Code was $error_code, partner object is below:\n";
    exit(2);
}
var_dump($results);
?>

Simply save this somewhere where you have PHP CLI and access to the server [or just on the server itself] and then run:
/path/to/create_partner_script.php <service_url>

Alternatively, you can use the testMe console, go to $YOUR_KALTURA_SERVER/admin_console/index.php/index/testme

Select ‘partner’ as service, ‘register’ as action, click on “Edit” next to partner (KalturaPartner) and input the needed info and then set cmsPassword to the current passwd for that email. Note that all partners using the same email share the same login passwd.

Thank you @jess for the answer. :slight_smile:

It is not a nice solution because I need the user password for this and actually in a normal use case I dont have it. I think me as an admin should be able to create this without entering this password.

Kind Regards
Roger Barras

Hi Roger,

This was already fixed in 12.12.0, see: https://github.com/kaltura/server/pull/5333
I recommend you upgrade to the current stable version which is 12.13.0.
However, for this particular issue, it is enough to override /opt/kaltura/app/api_v3/services/PartnerService.php with https://github.com/kaltura/server/raw/b5152d6e0670b9f59858503a1156f4a33c1ad2be/api_v3/services/PartnerService.php

Thanks,

Thank you this works for me.:slight_smile: