Git Product home page Git Product logo

zendserversdk's People

Contributors

boedah avatar brobie avatar burkl avatar chukshirley avatar clarkphp avatar gonzalez avatar kher avatar maxbeutel avatar minkbear avatar perforce-sp avatar pleckey avatar ryanheath86 avatar slaff avatar slaff-at-zend avatar slav-at-attachix avatar swilczynski avatar zvikazend avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zendserversdk's Issues

wrong api credentials after joining a cluster with --wait option

when joining a new server to an existing cluster with method serverAddToCluster and option --wait, an exception ("Incorrect signature or unknown identity") is thrown. This is because the check whether the new server joined successful is done with the new server's credentials, but not with the cluster credentials.

Local Config Handling

Since command addTarget reads and modifies .zs_api.ini, it raises a security concerns with leftovers target details after use and maintenance of config and targets.

On every zs-client.phar execution, the first line should be something like:
Config file: none
or
Config file: /path/to/.zs_api.ini

This way there is no mistake whether something is recorded on the system with sensitive data.

Next, these extra commands can come in handy:

  1. zs-client.phar config (path)
    display .zs_api.ini calculated path (matching the logic in addTarget - Windows or Home) and "Exists!" if exists
  2. zs-client.phar config print
    display config file content, or error if not available or empty
  3. zs-client.phar config delete
    or: zs-client.phar cleanup [--force](removes the config and any temp files after prompt or -f / --force).
  4. zs-client.phar listTargets
  5. zs-client.phar removeTarget --target=XYZ
  6. zs-client,phar removeAllTargets
    This is not the same as deleting config, since in the future we might like to see more configuration besides the ZS targets (user prefs, behaviour prefs, logging, command history, macros etc.)

Now who will beat me to implementing the above?!?
:)

Zend Server 6.3 unsupported

Using a target with ZS Version 6.3: I get an "Uncaught exception 'RuntimeException' with message 'Invalid or unsupported Zend Server version'" error message when calling e.g. 'getSystemInfo' command

Fix bug in case using real path in windows

If pass parameter in windows like this:
--folder="C:\tests"
--destination="C:\tests"

It shows error

The application has thrown an exception!

Zend\ServiceManager\Exception\RuntimeException
The specified directory does not have deployment.xml.

But it is existing deployment.xml at that path.
After that I took a look on the code and met:
PathInvokable.getAbsolute send the result is wrong for example

running cmd at c:\wamp\www\ZendServerSDK\tests
parameter --folder="C:\wamp\www\ZendServerSDK" 

result from PathInvokable.getAbsolute is

C:\\wamp\\www\\ZendServerSDK\\tests/C:\\wamp\\www\\ZendServerSDK\\tests

I just finished fix it but unable to pull request only my 1 commit.
Please take a look at minkbear/ZendServerSDK@d27b5ac

Deployment scripts not properly created into zpk archive

Hi there,

If you put your deployment scripts like post_stage.php into a /deploy directory at the root of the app the resulting package with packZpk will show something like this : /deploy/deploy/post_stage.php.
When deploying on zend server deployment scripts will be not played at all.
It is ok with the same code packaged with Zend Studio.

Use of monitorCountIssuesListPredefinedFilter

I've tried to use this method but everytime I get a response stating that the method is not available on the server.

object(stdClass)#460 (3) { ["zendServerAPIResponse"]=> string(34) "http://www.zend.com/server/api/1.2" ["requestData"]=> object(stdClass)#475 (2) { ["apiKeyName"]=> string(7) "Unknown" ["method"]=> string(7) "default" } ["errorData"]=> object(stdClass)#482 (2) { ["errorCode"]=> string(13) "unknownMethod" ["errorMessage"]=> string(91) "The requested action 'monitorCountIssuesListPredefinedFilter' does not exist on this server" } } {"result":null}

It seams it reverts to use of the version 1.2 of the API in which it doesn't exists. But I've tried to force the use of version 1.7 adding the ';version=1.7; to the headers (Content-type and Accept) but it still reverts to 1.2.

I might be doing something wrong on the versioning negotiation, or there is a bug the reverts to 1.2 on this method. I've tried it on versions 6.3 and 8 of Zend Server.

Retries in bootstrap command

"apparently after installation it takes a while for ZS to be ready for bootstrap. If I try to bootstrap right after installation the installation fails."

A simple mechanism to retry.

configurationExport / configurationDirectivesList / Zend Global Directives

configurationExport

  • --output-format is broken. kv => no output. json/xml => zip file
  • only provides a zip file, hard to exploit atomicly
  • zend.user_name can be found in .sql content
  • zend.serial_number can NOT be found anywhere.

configurationDirectivesList

  • no zend.* directives are displayed at all.
  • explictly asking --extension='Zend Global Directives' does not help

Automated tests

Are there any plans to add automated tests to this project?
I think this is crucial, as:

  • the documentation is sparse (especially for the scriptsdir stuff)
  • users will download the latest phar (according to the README), breaking existing functionality can be hard to spot (especially as there are no released versions or a CHANGELOG)

First candidates I see would be the scriptsdir stuff (as I also had the most problems with it), to address #34, #56, #57.

In the first step, only package creation can be tested, not deploying itself (which could be added later on). So errors like #35 could be catched.

E.g. I could not find documentation on how the "persistent resources" feature is working (which did not in my case): http://files.zend.com/help/Zend-Server/content/understanding_the_package_structure.htm

Windows phar file issues

Under Windows XP, and probably other Windows OS versions, the phar file does not run as expected.

This action requires the baseUrl parameter

We have been trying to implement continuous integration with jenkins but there is a problem with deployment. We have located it down to that zs-client wont let us add the new application apparantly it does not the the baseUrl in the XML for the server request.

How:
php /usr/local/bin/zs-client.phar installApp --zpk=application.zpk --zsurl='http://ZendServerIP:10081' --zskey='admin' --zssecret='XXXXX' --baseUri='http://OurVhost/' --userAppName='AppNameX' --userParams='APPLICATION_ENV=staging'

Result:
2015-01-07T16:26:55+00:00 ERR (3): This action requires the baseUrl parameter


applicationDeploy


missingParameter

The application has thrown an exception!

ZendServerWebApi\Model\Exception\ApiException
This action requires the baseUrl parameter

As far as i can see you take the var $baseUri and put it into baseUrl we have tried the stable and the development release.

ZendServer version 7.0.0 and 8.0 beta

Structure of ZPK is strange when setting scriptsdir.includes

My test case:

Case 1
scriptsdir in XML = zp_script
scriptsdir.includes in file properties = scripts/post_activate.php

Output
zp_script\scripts\post_activate.php

Expected
zp_script\post_activate.php


Case 2
scriptsdir in XML = zp_script
scriptsdir.includes in file properties = zp_script/includes/globals.php

Output
zp_script\includes\globals.php

Expected
zp_script\globals.php


Case 3 => Pass
scriptsdir in XML = zp_script
scriptsdir.includes in file properties = zp_script/post_activate.php

Output
zp_script\post_activate.php

Expected
zp_script\post_activate.php


I think that case 1 and 2 should be pass.
Because scriptsdir.includes are the list of files or folders you want to push them into scriptsdir.

Anyways, I tested all my case with Eclipse PDT with GUI based and export ZPK file with the same XML and properties. The output is the same as my expected.

Support stamp version when using packZpk command

For example, If you want to change version number when creating package zpk.
So the command will be like this below:
php /usr/local/bin/zs-client.phar packZpk --folder='${project.basedir}' --destination='${project.basedir}' --name='application.zpk' --version='1.0.0.999'

This command will change version number in deployment.xml before creating zpk file.

Custom Version when packing

For continuous deployment it would be helpful to have have an additional parameter - e.g. --version - for the packZpk command which allows to specify the version of the package without touching the xml manually

ERROR When run php zs-client.phar --help

Update
After update composer, the problem is gone. Please close this issues.
Thanks.

run command:
php zs-client.phar --help

error:

SCREAM: Error suppression ignored for
Fatal error: Class 'Zend\Stdlib\ArrayObject' not found in C:\wamp\www\ZendServerSDK\vendor\zenddevops\webapi\Module.php on line 89

Call Stack:
0.0179 691640 1. {main}() C:\wamp\www\ZendServerSDK\bin\zs-client.phar:0
0.0184 695864 2. require('phar://C:/wamp/www/ZendServerSDK/bin/zs-client.phar/index.php') C:\wamp\www\ZendServerSDK\bin\zs-client.phar:14
0.0255 916608 3. Zend\Mvc\Application::init() phar://C:/wamp/www/ZendServerSDK/bin/zs-client.phar/index.php:2
0.1154 3646656 4. Zend\Mvc\Application->bootstrap() C:\wamp\www\ZendServerSDK\vendor\zendframework\zendframework\library\Zend\Mvc\Application.php:242
0.2226 5256984 5. Zend\EventManager\EventManager->trigger() C:\wamp\www\ZendServerSDK\vendor\zendframework\zendframework\library\Zend\Mvc\Application.php:145
0.2227 5257160 6. Zend\EventManager\EventManager->triggerListeners() C:\wamp\www\ZendServerSDK\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php:208
0.2332 5522744 7. call_user_func() C:\wamp\www\ZendServerSDK\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php:464
0.2332 5522760 8. ZendServerWebApi\Module->onBootstrap() C:\wamp\www\ZendServerSDK\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php:464

cygwin, phar missing Zend\Http\Client\Adapter\ctype_xdigit()

PHP version:

PHP 5.6.8 (cli) (built: Apr 16 2015 17:31:50)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

zs-client's reported versions:

ZendServerWebApi Client version 1.2
Zend Server Client v1.0

error exists both when using the .phar as an executable and after extracting with the phar utility followed by calling index.php.

Arguments which precipitated the error are:

zs-client addTarget --target="ZendLive" --zskey="zs-client"  --zssecret="removed" --zsurl="http://zendserver.local:10081/"

Error output:

PHP Fatal error:  Call to undefined function Zend\Http\Client\Adapter\ctype_xdigit() in /home/dllewellyn/bin/zs-client.unpacked/vendor/zendframework/zend-http/Zend/Http/Client/Adapter/Socket.php on line 2

Fatal error: Call to undefined function Zend\Http\Client\Adapter\ctype_xdigit() in /home/dllewellyn/bin/zs-client.unpacked/vendor/zendframework/zend-http/Zend/Http/Client/Adapter/Socket.php on line 2

Deployment scripts directory is mandatory

Hi there,

If you don't provide any deployment scripts directory within deploiement.properties, first packaging will succeed but will throw a exception and then deployment will fail.

pagecache commands are not working.

I've tried using the pagecache commands, and am getting errors:

2014-09-08T11:33:12-05:00 ERR (3): The requested action 'pagecacheListRules' does not exist on this server<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.2">
    <requestData>
        <apiKeyName><![CDATA[Unknown]]></apiKeyName>
        <method>default</method>
    </requestData>
<errorData>
 <errorCode>unknownMethod</errorCode>
 <errorMessage><![CDATA[The requested action 'pagecacheListRules' does not exist on this server]]></errorMessage>
</errorData></zendServerAPIResponse>
======================================================================
   The application has thrown an exception!
======================================================================
 ZendServerWebApi\Model\Exception\ApiException
 The requested action 'pagecacheListRules' does not exist on this server

The server in question is running version 7.0, and I have a target setup correctly (as in, other commands such as deployment work fine).

When using the filterSave method, the zs-client.phar sends an HTTP method error

I've tried to use a method to import a filter rule from one server to other, but when using the filterSave method, it requires a POST method:

php zs-client.phar filterSave --type=issue --target=zst --name=CLIQueryAllEvents --data={"applicationIds":[29]}
2015-04-30T16:24:43-03:00 ERR (3): This action requires a HTTP POST method


filterSave


unexpectedHttpMethod

The application has thrown an exception!

ZendServerWebApi\Model\Exception\ApiException
This action requires a HTTP POST method

packZpk is adding deployment scripts into scripts/scripts directory

It is creating scripts directory inside another scripts directory which makes Zend Server unable to unpack and execute deployment scripts like post_stage.php

This issue is probably caused by pack method of ZpkInvokable where it calls

$zpk->addFile($fullPath, $this->fixZipPath($baseDir.$path));

For scripts directory it tries to do

$zpk->addFile($fullPath, $this->fixZipPath('scripts/'.'scripts/post_stage.php'));

Notices in installApp command

when calling
zs-client.phar installApp --target="cloudbees" --zpk=helloworld.zpk --baseUri="/hw" --defaultServer=TRUE --wait

I get some Notices:
Notice: Undefined variable: server in phar:///tmp/helloworld/zs-client.phar/module/Client/src/Client/Controller/AppController.php on line 2
PHP Notice: Trying to get property of non-object in phar:///tmp/helloworld/zs-client.phar/module/Client/src/Client/Controller/AppController.php on line 2

Notice: Trying to get property of non-object in phar:///tmp/helloworld/zs-client.phar/module/Client/src/Client/Controller/AppController.php on line 2

Add better documentation for the deployment.properties properties

  • Explain what is appdir directory and what is scriptsdir.
  • Give examples how the appdir is working and how to include and exclude files.
  • Give examples how the scriptsdir is working and how to include and exclude files.
  • Add the final information to a wiki and append it to the existing Zend Server documentation.

AddTarget optional http parameters are expected in controller

Hi !

Seen this warning :PHP Warning: Invalid argument supplied for foreach() in /var/www/ZendServerSDK/module/Client/src/Client/Controller/TargetController.php on line 39.

The thing is http parameters is optinal but clearly expected at line 39 !

Empty subfolder is not in ZPK as expect

Example:
Foo/test_empty is empty subfolder.

when order command packZpk. The ouput in ZPK is:
< empty folder name >/Foo/Test_empty

It should not have "empty folder" in ZPK

implement delayed join

in some cloud setups, the cluster node servers might come up before the database server. For these scenarios, it would be useful to have a delayed join cluster method that pings the database server and only joins the node when the server's ready.

Rename createZpk to initZpk

Instead of:
$ php bin/zs-client.php createZpk --folder=""
Use:
$ php bin/zs-client.php initZpk --folder=""

Make the createZpk an alias to initZpk and add deprecated message.
(Suggested by Zvika)

RuntimeException on launch

I have a host (note for self: host328) on which we get a RuntimeException when trying to launch the script. It just fails to load and do anything useful.

# php /usr/local/lib/xxx/zendserver/zs-client.phar command:help

Fatal error: Uncaught exception 'Zend\Stdlib\Exception\RuntimeException' with message 'glob('config/autoload/{,*.}{global,local}.php', 1024) failed' in phar:///usr/local/lib/xxx/zendserver/zs-client.phar/vendor/zendframework/zend-stdlib/Zend/Stdlib/Glob.php:2
Stack trace:
#0 phar:///usr/local/lib/xxx/zendserver/zs-client.phar/vendor/zendframework/zend-stdlib/Zend/Stdlib/Glob.php(2): Zend\Stdlib\Glob::systemGlob('config/autoload...', 16)
#1 phar:///usr/local/lib/xxx/zendserver/zs-client.phar/vendor/zendframework/zend-modulemanager/Zend/ModuleManager/Listener/ConfigListener.php(2): Zend\Stdlib\Glob::glob('config/autoload...', 16)
#2 phar:///usr/local/lib/xxx/zendserver/zs-client.phar/vendor/zendframework/zend-modulemanager/Zend/ModuleManager/Listener/ConfigListener.php(2): Zend\ModuleManager\Listener\ConfigListener->addConfigByPath('config/autoload...', 'glob_path')
#3 [internal function]: Zend\ModuleManager\Listener\ConfigListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent))
#4 phar:///usr/local/lib/xxx/zends in phar:///usr/local/lib/xxx/zendserver/zs-client.phar/vendor/zendframework/zend-stdlib/Zend/Stdlib/Glob.php on line 2

Any idea what could cause such error, or how to investigate further?

Add validateZpk

Add validateZpk command that validates the deployment.xml file and the files described in the deployment.properties.
(Suggested by Zvika)
The validate command, in the case of zdpack, also validates the deployment.xml against an xsd that is supplied in zend server - /usr/local/zend/share/deployment.xsd
Of course, we'd have to make sure that versions don't change between releases, but it has been fairly static.
(Comments by Maurice :)

Extra characters in XML output during installApp

There are extra characters in the beginning of the response from the installApp command that break the XML parsing.

Command

/usr/local/bin/zs-client installApp --zpk /home/jan/dev/git/zend-server-bamboo/deployment/target/bamboo/home/xml-data/build-dir/MCD-CDP-JOB1/zpk/52-822629b9f38045c7fd2f2caf4eccae15b9c574cf.zpk --baseUri=/myApp --userAppName=myApp --zsurl=http://10.11.12.68:10081 --zskey=<key> --zssecret=<secret> --zsversion=6.1

Start of response

string(2218) "<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.5">

Creating ZPK broken in Nov 24th phar

When I try to create a zpk file using the latest Nov 24th phar file I get the following error:

PHP Fatal error: Uncaught exception 'Exception' with message 'Incorrect signature or unknown identity' in phar:///var/lib/jenkins/workspace/Staging/ZsClient/bin/zs-client.phar/vendor/zenddevops/webapi/src/ZendServerWebApi/Model/ApiManager.php:2

To test this I used the Oct 31st phar and it works as expected.

zs-client.phar addTarget yields exception with message saying user should add a target.

$ /vagrant/zs-client.phar addTarget --target=testServer --zsurl="http://localhost:10081" --zskey=admin --zssecret=obfuscated --zsversion="7.0"

PHP Fatal error:  Uncaught exception 'Zend\Console\Exception\RuntimeException' with message 'Make sure that you have set your target first. \n
                                                                This can be done with phar:///vagrant/zs-client.phar/module/Client/Module.php addTarget --target=<UniqueName> --zsurl=http://localhost:10081/ZendServer --zskey= --zssecret=' in phar:///vagrant/zs-client.phar/module/Client/Module.php:10
Stack trace:
#0 [internal function]: Client\Module->postRoute(Object(Zend\Mvc\MvcEvent))
#1 phar:///vagrant/zs-client.phar/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(2): call_user_func(Array, Object(
Zend\Mvc\MvcEvent))
#2 phar:///vagrant/zs-client.phar/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(2): Zend\EventManager\EventManage
r->triggerListeners('route', Object(Zend\Mvc\MvcEvent), Object(Closure))
#3 phar:///vagrant/zs-client.phar/vendor/zendframework/zend-mvc/Zend/Mvc/Application.php(2): Zend\EventManager\EventManager->trigger('r in ph
ar:///vagrant/zs-client.phar/module/Client/Module.php on line 10

Fatal error: Uncaught exception 'Zend\Console\Exception\RuntimeException' with message 'Make sure that you have set your target first. \n
                                                                This can be done with phar:///vagrant/zs-client.phar/module/Client/Module.php addTarget --target=<UniqueName> --zsurl=http://localhost:10081/ZendServer --zskey= --zssecret=' in phar:///vagrant/zs-client.phar/module/Client/Module.php:10
Stack trace:
#0 [internal function]: Client\Module->postRoute(Object(Zend\Mvc\MvcEvent))
#1 phar:///vagrant/zs-client.phar/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(2): call_user_func(Array, Object(
Zend\Mvc\MvcEvent))
#2 phar:///vagrant/zs-client.phar/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(2): Zend\EventManager\EventManage
r->triggerListeners('route', Object(Zend\Mvc\MvcEvent), Object(Closure))
#3 phar:///vagrant/zs-client.phar/vendor/zendframework/zend-mvc/Zend/Mvc/Application.php(2): Zend\EventManager\EventManager->trigger('r in ph
ar:///vagrant/zs-client.phar/module/Client/Module.php on line 10

Steps to reproduce.

  1. Fresh install of Zend Server 7.0 on a new vagrant box chef/ubuntu-14.04
  2. Bootstrapped Zend Server with Developer launch profile
  3. Download zs-client.phar from zend-patterns/ZendServerSDK
  4. Ran zs-client.phar addTarget command noted above.

configurationStoreDirectives does not set the session handler

I am trying to set up a ZS cluster using vagrant and docker.

As part of the procedure, I run "zs-client.phar configurationStoreDirectives --directives='session.save_handler=cluster’ …”, but it seems not work.

The command return value is 0, the output is the following:



configurationStoreDirectives




^M

The ZS UI and also SSHing in the box and look at php.ini show the directives has not been changed.

Autodetect Zend Server version

Currently, when creating an SDK target, you have the option of specifying the Zend Server version via the --version option. If you fail to do so, it defaults to "6.3".

This is not useful, particularly for the upcoming version 8, where using that version results in the SDK being unusable when that target is specified.

The better path would be to try and connect to the Zend Server API and determine the version from the API -- and to potentially prompt the user for the version if the API cannot provide that information (even better: provide information in that prompt to guide the user to discover the version from the UI!).

Using Targets: Add setTarget for Rapid Management

When you run commands on specific target, you execute commands like:
zs-client.sh --target= <--params 1,2,3>
or
zs-client.sh <--params 1,2,3> --target=

To quickly work with direct command + params patterns on a single target at a time,
a command like 'setTarget ' can be used, which will set the default target for all consequent commands.

Notes:

  1. Using --target in a command will override default / pre-set target.
  2. If default target should be unset, just run 'zs-client setTarget' or 'zs-client setTarget=' to unset.
  3. When a default target is set, zs-client will show the used target on every execution, with full target details, so there is no question where the command is going to be executed, i.e.:
    Using Target: 'My Cluster' => http://my-cluster.com:10081

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.