Published Solutions
-
Can we change the application name to upgrade the old one?
Original Publishing Date: 2020-01-22 Symptoms Can we change the application name to upgrade the old one? Cause Resolution ... phpbb ... It is a free-formed short string which specifies the user-visible name of an application. The package name may be changed during upgrade and should reflect the packaged software name. To get more info please refer to the official documentation. Internal content
-
Introducing upgrades in APS2 package
Original Publishing Date: 2020-01-22 Problem How do I test application upgrade? What are the steps to introduce upgrades in an APS package? Resolution Building a new version of a package if you change schema for a resource it's needed to increment its id, here is a rule of thumb: Adding property/relation: increase minor version of this type Removing property/relation: increase major version of this type (you will face this problem if version won't be increased) If you are using APS PHP runtime id of the type should be changed in corresponding PHP scripts, schema files are automatically generated using schema declaration in the code. More on types versioning If type id was changed remeber to change them in navigation declaration in APP-META.xml and UI files version of the package itself should be increased in APP-META.xml (usually minor) add 'upgrade' node in APP-META.xml (http://doc.apsstandard.org/spec/package/updates/) like: build package Testing upgrade import a new package to POA verify that tasks 'importing APS package' and 'updating upgrade relations for APS packages of application' were scheduled and processed now new version should appear in tab Versions for your application navigate to provider's instance, press 'Upgrade' button a task will be scheduled to upgrade this instance if any new global settings were introduced in this version fill them in Note: endpoint should be updated manually (i.e files with older code versions should be removed and new ones placed instead) Application was upgraded, now latest version definitions will be used (meta information, UI, schemas). Since all subscriptions have a reference to provider's instance they will all get data from the latest package. Internal content
-
Prefix specified for tables is not used for creating tables in wordpress database
Original Publishing Date: 2020-01-22 Symptoms 'Prefix of tables' value/entry is not used for creating tables in Wordpress database. Random value is taken in wp-cofig.php as well as in tables of database: Cause This issue with 'Wordpress Toolkit' is already known and was registered with ID PPPM-2056. Resolution Plesk generates random prefix only if 'Wordpress Toolkit' is enabled (it depends on license key or setings in panel.ini): cat /usr/local/psa/admin/conf/panel.ini (Windows: %plesk_dir%\admin\conf\panel.ini) .. [wpToolkit] enabled=off ... The possible workaround is to disable Wordpress Toolkit. In this case table name will be 'myprefix' + 'wp_' + 'tablename'. For example: mysql> show tables myprefixwp_comments This is because configuration script in the Wordpress package has the following line: $db_modify_hash['@@DB_MAIN_PREFIX@@'].='wp_'; // Means that db prefix will be "myprefixwp_". There should not be any technical problems to remove adding 'wp_' from Wordpress configuration script. Internal content
-
Can a Odin Service Automation sandbox be deployed in my local datacenter?
Original Publishing Date: 2020-01-22 You can get a pre-configured instance of Odin Service Automation through your account on http://dev.apsstandard.org. These sandboxes are deployed in Odin datacenter and can be accessed via a VPN connection. The sanboxes come in various configurations, you can pick one that suits your development needs. More information on sandboxes is available in our knowledge base. APS support team does not support deploying of Odin Service Automation in local environments and will not provide assistance with installation or configuration of local installations. Additionally, if in your on-premise sandbox you encounter an issue with an APS package you develop and submit a support request for it, APS support team may ask you to reproduce this issue in your apsstandard.org sandbox. Internal content
-
how to configure Business Automation API to listen on all interfaces
Original Publishing Date: 2020-01-22 Problem I'm trying to connect to Business Automation API on my APS sandbox, which IP should be used? Resolution By default Business Automation API listens on 172.x.x.x IP address however it is possible to make it listen on all IPs: Copy the sample .xmlrpcd.conf to xmlrpcd.conf in Business Automation configs folder: [root@pba ~]# cp /usr/local/bm/etc/ssm.conf.d/.xmlrpcd.conf /usr/local/bm/etc/ssm.conf.d/xmlrpcd.conf In xmlrpcd.conf change arguments = $(HOST_IP):$(XMLRPCD_PORT) to arguments = 0.0.0.0:$(XMLRPCD_PORT). This will allow connection from any IP (and therefore it should never be configured that way in production, it is a huge security hole). Restart the xmlrpcd to apply the changes: [root@pba ~]# /etc/init.d/xmlrpcd restart Internal content
-
'Invalid \\u escape sequence' error when trying to create a resource
Original Publishing Date: 2020-01-22 Symptoms I'm seeing the following error when trying to edit or create a resource: { "error": "std::runtime_error", "message": "Invalid \\u escape sequence" } Cause There must be a more than two byte character in a string endpoint returns to you, examples: some Japanese/Chinese characters (mostly 3 and 4 bytes) some currency signs: € sign (0xE2, 0x82, 0xAC) For example you during creation of a customer you may send balance property: "balance": "40.399,64 €" Creation fails with "Invalid \\u escape sequence" error, the endpoint returned 200 OK response to the contoller along with payload mirroring the one that was sent however the balance property is different: "balance": "40.399,64 \u20ac" The cause is that in PHP prior to 5.4 json_encode() automatically escaped unicode, in PHP 5.4 JSON_UNESCAPED_UNICODE was introduced: http://php.net/manual/en/function.json-encode.php Resolution Upgrade PHP on endpoint to 5.4 and aps-php-runtime >= 2.0-340 Internal content Link on internal Article
-
unregisterResource() returns an error when trying to delete a resource.
Original Publishing Date: 2020-01-22 Symptoms I'm seeing an error when trying to delete a resource using unregisterResource() method in APS PHP runtime: Internal Server Error: Request to APS controller failed: "{ "error": "APS::Util::Exception", "message": "Application of specified resource does not match: given `2ed15c55-8bd0-42c3-86e7-6c042d5b8251` expected `1e95d486-d5eb-4129-a491-d998b97e3656`." } ". Cause unregisterResource() can delete only resources that belong to the application itself. Resolution Use unprovisionResource() to delete POA resources (domains, dns records etc). More on PHP runtime Internal content Link on internal Article
-
pem.deleteDNSRecord does not delete DNS records
Original Publishing Date: 2020-01-22 Symptoms I'm trying to delete a DNS record using POA API method pem.deleteDNSRecord passing the record id, method returns status0 But the record is not deleted. Cause You are trying to delete system DNS record, pem.deleteDNSRecord can remove only records created manually by the customer. Resolution Use pem.disableDNSRecord to disable system records. If you are using DNS records in APS packages you may use pem.createDNSRecord method instead of APS API to create a record, in this case it will be created as manual. Internal content
-
[HOW-TO] How can I pass an entire model to a POST method within a PHP @param definition?
Original Publishing Date: 2020-01-22 Symptoms I need to pass an entire model constructed in APS UI to a custom operation on endpoint, how can I do that? Resolution You can pass the model as data for aps/xhr and retrieve it from arguments passed into custom operation, here is an example on how a service user can create a VM from his control panel (MyCP) UI view: //call the createVM() method and send along the instance info var url1 = "/aps/2/resources/" + aps.context.vars.enduser.aps.id+ "/createVM"; xhr(url1, { method: "POST", data: JSON.stringify(window.model)}) .then(function(){ aps.apsc.gotoView("mycp-main"); }); endpoint code: /** * @verb(POST) * @path("/createVM") * @param(string, body) * @access(referrer, true) */ ########################### ## createVM ########################### public function createVM($vm){ $this->logger("createVM()::Start with:::> ". $vm); $apsc = \APS\Request::getController(); $x = $apsc->getIo()->sendRequest(\APS\Proto::POST, "/aps/2/resources", $vm); return $x; } Internal content
-
A form can be submitted even when some elements in it do not pass validation
Original Publishing Date: 2020-01-22 Symptoms A user can submit a form in Custom UI when some fields in this form are not valid. Cause Validation check is not added to onSubmit method Resolution You should call aps/PageContainer's validate() method to check if all fields are valid. For example, assuming my PageContainer has an id of 'top': aps.app.onSubmit = function() { var form = registry.byId("top"); if (!form.validate()){ console.log("Not all fields are valid"); aps.apsc.cancelProcessing(); return; } // normal processing logic below this line } Additional information and examples can be checked on the PageContainer documentation page. Internal content