Having error when "Save & Publish"

6 replies [Last post]
Joined: 06/29/2009
Points: 93

I got a "remix failed" error, I went to check out the connection info and found this:

GET==>http://192.168.1.88/frameworks/kalturaCE/kae/ui_conf_id/47401

POST==>http://192.168.1.88/frameworks/kalturaCE/index.php/partnerservices2/setmetadata

Response:
<?xml version="1.0" encoding="ISO-8859-1"?><xml><result><serverTime>1250525695</serverTime></result><error><num_0><code>INTERNAL_SERVERL_ERROR</code><desc>Internal server error Did not match required privlieges [edit:ajzdw7n945]</desc></num_0></error><debug><sigtype>1</sigtype><validateSignature>1</validateSignature><signature>a5985a78f4b3385d4c496312a5b7d17c</signature><execute_impl_time>-1250525695.02</execute_impl_time><execute_time>0.093220949173</execute_time><total_time>0.0938720703125</total_time></debug></xml>

There is also a flash error when the kae tries to save?

Error: Error #1023: Stack overflow occurred.
        at mx.utils::URLUtil$/internalObjectToString()
...
...
...

Any idea's?

---Jeff

Joined: 01/05/2009
Points: 1697

Hi Jeff,

So this is not an issue with the KAE (the error is thrown as a consequence to the other errors).
It seems that you created a KS without the edit:* privileges (in order to update a mix you must have the edit:* permissions).

Read introduction to API guide to better understand the KS (Kaltura Session).

Joined: 06/29/2009
Points: 93

The privileges assigned to the session. For an ADMIN type KS this is irrelevant, but for a USER type KS - if the user should have edit privileges on mixes, pass the following value - edit:* (this is api_v2 only)

In api_v2 there was the privileges field, where in api_v3 it was deprecated.

I am using api_v3, is the edit:* still required?

I changed my ks to admin type therefor It shouldn't* matter?

---Jeff
P.s
here is some of my code:

public function __construct(KalturaConfiguration $conf,$user_id,$secret,$type) {
                parent::__construct($conf);
                $this->setKs($this->session->start($secret,$user_id,$type ? KalturaSessionType::ADMIN : KalturaSessionType::USER));
}

which is called by:
 |   $admin = 2;
 |   $user_id = 1;
 |   $sub_partner_id = 100; // not sure exactly what this is yet
 |   $secret = "xxxxxx";
 |   $admin_secret = "xxxxxx";
 |   $service_url = "http://192.168.1.88/frameworks/kalturaCE";
 |   // Include kaltura API
 |   require_once("KalturaClient.php");
 |   require_once("MyKaltura.class.php");
\|/   $conf = new KalturaConfiguration($user_id, $service_url);
$myKaltura = new kaltura($conf,$user_id,$admin ? $admin_secret : $secret,$admin);

Joined: 01/05/2009
Points: 1697

Hi Jeff...
anything new on this after yesterday skype?

Joined: 06/29/2009
Points: 93

Yup, I went through the sample app. that's in the api_v3 folder for the advanced editor... This code works (as expected) :P

$config = new KalturaConfiguration($user_id);
$config->serviceUrl = $service_url;
$client = new KalturaClient($config);
$ks = $client->session->start($secret, "USERID", KalturaSessionType::USER, $user_id, 86400, "edit:*");

$flashVars = array();
$flashVars["partnerId"] = $user_id;
$flashVars["subpId"] = $sub_partner_id;
$flashVars["uid"] = "USERID";
$flashVars["ks"]                = $ks;
$flashVars["kshowId"]   = -1;
$flashVars["entryId"]   = $entryId;
$flashVars["jsDelegate"]        = "callbacksObj";

        //$editWidget = create_video_editWidget($_GET['mixID']);
        $editWidget = '<script>
                                        var params = {
                                                allowscriptaccess: "always",
                                                allownetworking: "all",
                                                wmode: "opaque"
                                        };
                                       
                                        var flashVars = '
.json_encode($flashVars).';
                                        swfobject.embedSWF("'
.$service_url.'/kae/ui_conf_id/47401", "kae", "821px", "680", "9.0.0", false, flashVars, params);
        </script>'
;

However... this doesn't (not sure why...it just doesn't let you save...)

note: the KS is or has already been created...

$this->setKs($this->session->start($secret,$user_id,$type ? KalturaSessionType::ADMIN : KalturaSessionType::USER));
        $widget.='
    <script type="text/javascript">
            if (swfobject.hasFlashPlayerVersion("9.0.0")) {
              var fn = function() {
                  //100%
                  //100%
                var att = { data:"'.$service_url.'/kae/ui_conf_id/47401", width:"825", height:"672" };
                var par = { flashvars:"&ks='.$ks.'" +
                                                        "&partnerId=1" +
                                                        "&subpId=100" +
                                                        "&uid=0" +
                                                        "&entryId='.$id.'" +
                                                        "&entryVersion=-1" +
                                                        "&kshowId=-1" +
                                                        "&debugMode=0" +
                                                        "&bgColor=cccccc" +
                                                        "&jsDelegate=callbacksObj",
                                                        allowScriptAccess:"always",
                                                        allowfullscreen:"true",
                                                        allowNetworking: "all",
                                                        wmode: "opaque",
                                                        bgcolor:"cccccc"};
                var id = "kae";
                var myObject = swfobject.createSWF(att, par, id);
              };
              swfobject.addDomLoadEvent(fn);
            }
    </script>';

It looks like to me... (not 100% sure) the sample app. is using api_v2 ? If so, How do you use api_v3 for this?

---Jeff

Joined: 06/29/2009
Points: 93

All fixed... (thanks to Kalturian for the help!)

public function __construct(KalturaConfiguration $conf,$user_id,$secret,$type) {
        parent::__construct($conf);
        $partner_id = 1;
        $this->setKs($this->session->start($secret,$user_id,$type ? KalturaSessionType::ADMIN : KalturaSessionType::USER,$partner_id, 86400, "edit:*"));
}

without the $partner_id, 86400, "edit:*" params the session wasn't being init. to the correct priv. lvl. even if "$type" was set to admin...

However, with the correct params. this is now able to save mix's/roughcuts :P

      $widget.='
    <script type="text/javascript">
            if (swfobject.hasFlashPlayerVersion("9.0.0")) {
              var fn = function() {
                  //100%
                  //100%
                var att = { data:"'.$service_url.'/kae/ui_conf_id/47401", width:"825", height:"672" };
                var par = { flashvars:"&ks='.$ks.'" +
                                                        "&partnerId=1" +
                                                        "&subpId=100" +
                                                        "&uid=0" +
                                                        "&entryId='.$id.'" +
                                                        "&entryVersion=-1" +
                                                        "&kshowId=-1" +
                                                        "&debugMode=0" +
                                                        "&bgColor=cccccc" +
                                                        "&jsDelegate=callbacksObj",
                                                        allowScriptAccess:"always",
                                                        allowfullscreen:"true",
                                                        allowNetworking: "all",
                                                        wmode: "opaque",
                                                        bgcolor:"cccccc"};
                var id = "kae";
                var myObject = swfobject.createSWF(att, par, id);
              };
              swfobject.addDomLoadEvent(fn);
            }
    </script>';
Joined: 01/05/2009
Points: 1697

Thank you for updating Jeff.