Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008879opensim[REGION] Specific OpenSim Modulepublic2021-03-13 01:292021-03-13 13:38
Reportervladimir Djannovic 
Assigned ToJeffKelley 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Platformphp remote adminOperating SystemOperating System Version
Product Version 
Target VersionFixed in Version 
Summary0008879: RemoteAdmin:admin save oar
Descriptionhttp://opensimulator.org/wiki/RemoteAdmin:admin_save_oar [^]

By adding the parameter no assets, impossible to make the backup without assets with admin save oar.
After days of testing, I had to change the code to use admin_console_command .

It seems that the additional remote admin save oar parameter, noassets, does not work at all
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (1 Region per Sim)
Physics EngineBulletSim
Script EngineYEngine
Environment.NET / Windows64
Mono VersionNone
Viewer
Attached Files

- Relationships

-  Notes
(0037650)
tampa (reporter)
2021-03-13 07:46

Can you provide an example of the full command or code you sent?
(0037651)
vladimir Djannovic (reporter)
2021-03-13 09:03

my original code:
        if ($_POST['backup_sim'] == '1' && $_POST['format_backup'] == 'OAR')
        {
            $parameters = array(
                'region_name' => $_POST['name_sim'],
                'filename' => 'BackupOAR_'.$_POST['name_sim'].'_'.date('d_m_Y_h').'.oar',
                'noassets' => true
            );
            $myRemoteAdmin->SendCommand('admin_save_oar', $parameters);
        }

and now I replace this code with this:

        if ($_POST['backup_sim'] == '1' && $_POST['format_backup'] == 'OAR')
        {
            $parameters = array(
                  'command' => 'save oar --noassets '.$_POST['name_sim'].'_'.date('d_m_Y_h').'.oar',
            );
            $myRemoteAdmin->SendCommand('admin_console_command', $parameters);
        }


now it works with this but I tested several configuration of admin save oar, nothing to do it was always done with assets
(0037652)
JeffKelley (reporter)
2021-03-13 09:13

Confirmed with standalone PHP code

$request = xmlrpc_encode_request(
    'admin_save_oar', array (
        'password' => 'pwetpwet',
        'region_name' => 'Welcome',
         'noassets' => 'True',
         'filename' => 'aaaaaaaa.oar'
         )
     );

var_dump ($request);

$context = stream_context_create(array('http' => array(
    'method' => "POST",
    'header' => "Content-Type: text/xml"
        . "\r\nConnection: close",
    'content' => $request
    )));

$file = file_get_contents("http://192.168.0.101:9999", [^] false, $context);
$answer = xmlrpc_decode($file);

var_dump ($answer);



'true' is rejected (["error"]=> string(28) "Specified cast is not valid.")
'True', 'TRUE', '1' all produce an oar with assets.

17:10:27 - [ARCHIVER]: Saving 105 assets
17:10:27 - [ARCHIVER]: Added 100 assets to archive
17:10:27 - [ARCHIVER]: Successfully added all 105 assets


Also tried with a boolean argument

    'noassets' => True,


     <name>noassets</name>
     <value>
      <boolean>1</boolean>
     </value>

["error"]=> string(28) "Specified cast is not valid."
(0037653)
tampa (reporter)
2021-03-13 10:21

Actual code from source:

                if ((string)requestData["noassets"] == "true")
                {
                    options["noassets"] = (string)requestData["noassets"] ;
                }

Suggests it is looking for string true, maybe trying with double quotes rather than single?
(0037654)
JeffKelley (reporter)
2021-03-13 11:02
edited on: 2021-03-13 11:03

Single/double quote is a PHP thing.
Both produce the same XML :

     <name>noassets</name>
     <value>
      <string>True</string>
     </value>

We can pass the "True" string (different from True) this way :

  'noassets' => "\"True\""

XML:
     <name>noassets</name>
     <value>
      <string>"True"</string>
     </value>

Returns:
  ["saved"]=> bool(true)

Again, oar with assets.

In fact, we can pass almost anything

  'noassets' => "foobar"
  'noassets' => "opensim is cool"

and get an oar (with assets)

but not

  'noassets' => "true"

["error"]=>string(28) "Specified cast is not valid."
["success"]=>bool(false)
["saved"]=>bool(false)


19:01:01 - [RADMIN]: Method admin_save_oar failed. Exception Specified cast is not valid. at OpenSim.ApplicationPlugins.RemoteController.RemoteAdminPlugin.XmlRpcSaveOARMethod (Nwc.XmlRpc.XmlRpcRequest request, Nwc.XmlRpc.XmlRpcResponse response, System.Net.IPEndPoint remoteClient) [0x00237] in <5e6f850a99bd42d9ad4f95a719c19779>:0
  at OpenSim.ApplicationPlugins.RemoteController.RemoteAdminPlugin.InvokeXmlRpcMethod (Nwc.XmlRpc.XmlRpcRequest request, System.Net.IPEndPoint remoteClient, System.Action`3[T1,T2,T3] method) [0x00061] in <5e6f850a99bd42d9ad4f95a719c19779>:0

(0037655)
UbitUmarov (administrator)
2021-03-13 12:22

should work now, with
'noassets' => 'True', "true" or 1.

none of this should mean false, same as not present in this case.
(0037656)
JeffKelley (reporter)
2021-03-13 12:53
edited on: 2021-03-13 12:54

I can confirm that it works.

string(648) "<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>admin_save_oar</methodName>
<params>
 <param>
  <value>
   <struct>
    <member>
     <name>password</name>
     <value>
      <string>pwetpwet</string>
     </value>
    </member>
    <member>
     <name>region_name</name>
     <value>
      <string>Welcome</string>
     </value>
    </member>
    <member>
     <name>noassets</name>
     <value>
      <string>true</string>
     </value>
    </member>
    <member>
     <name>filename</name>
     <value>
      <string>aaaaaaaa.oar</string>
     </value>
    </member>
   </struct>
  </value>
 </param>
</params>
</methodCall>
"
array(1) {
  ["saved"]=>
  bool(true)
}


20:50:47 - [RADMIN]: Received Save OAR Request
20:50:47 - [RADMIN]: Submitting save OAR request for Welcome to file aaaaaaaa.oar, request ID 580c770d-265e-49c5-8171-8ae4241aa8ef
20:50:47 - [ARCHIVER]: Writing archive for region Welcome to aaaaaaaa.oar
20:50:48 - [ARCHIVER]: Creating version 0.8 OAR
20:50:48 - [ARCHIVER]: Added control file to archive.
20:50:48 - [ARCHIVER]: Writing region Welcome
20:50:48 - [ARCHIVER]: Adding region settings to archive.
20:50:48 - [ARCHIVER]: Adding parcel settings to archive.
20:50:48 - [ARCHIVER]: Adding terrain information to archive.
20:50:48 - [ARCHIVER]: Adding scene objects to archive.
20:50:50 - [ARCHIVER]: Not saving assets since --noassets was specified
20:50:50 - [ARCHIVER]: Finished writing out OAR for Welcome
20:50:50 - [RADMIN]: Saved OAR file for request 580c770d-265e-49c5-8171-8ae4241aa8ef


Thanks Ubit.

(0037657)
vladimir Djannovic (reporter)
2021-03-13 13:08

Thanks Ubit
(0037658)
JeffKelley (reporter)
2021-03-13 13:38

Fixed per OpenSim 0.9.2.0 Yeti Dev 2021-03-13-b56f1c2

- Issue History
Date Modified Username Field Change
2021-03-13 01:29 vladimir Djannovic New Issue
2021-03-13 07:46 tampa Note Added: 0037650
2021-03-13 09:03 vladimir Djannovic Note Added: 0037651
2021-03-13 09:13 JeffKelley Note Added: 0037652
2021-03-13 10:21 tampa Note Added: 0037653
2021-03-13 11:02 JeffKelley Note Added: 0037654
2021-03-13 11:03 JeffKelley Note Edited: 0037654 View Revisions
2021-03-13 12:22 UbitUmarov Note Added: 0037655
2021-03-13 12:53 JeffKelley Note Added: 0037656
2021-03-13 12:54 JeffKelley Note Edited: 0037656 View Revisions
2021-03-13 13:08 vladimir Djannovic Note Added: 0037657
2021-03-13 13:18 vladimir Djannovic Resolution open => fixed
2021-03-13 13:38 JeffKelley Note Added: 0037658
2021-03-13 13:38 JeffKelley Status new => resolved
2021-03-13 13:38 JeffKelley Assigned To => JeffKelley


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker