Zend Server:应用程序名称已存在

时间:2015-03-13 15:19:52

标签: jenkins zend-server

我们在部署应用程序时在Zend Server上遇到了问题。

我们在Zend服务器上设置了一个名为“dev.application-7.de”的虚拟主机。 我们正在尝试将Jennd上的Zend Framework 2项目部署到这个虚拟主机上。通常这很有效。

但我们在170个构建中的3个中遇到以下错误:

deploy:
    [exec] ======================================================================
    [exec]    The application has thrown an exception!
    [exec] ======================================================================
    [exec]  ZendServerWebApi\Model\Exception\ApiException
    [exec]  Invalid userAppName parameter: Application name 'application-7' already exists
    [exec] 2015-03-13T11:35:12+01:00 ERR (3): Invalid userAppName parameter: Application name 'application-7' already exists<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.9">
    [exec]     <requestData>
    [exec]         <apiKeyName><![CDATA[ZendStudio]]></apiKeyName>
    [exec]         <method>applicationDeploy</method>
    [exec]     </requestData>
    [exec] <errorData>
    [exec]  <errorCode>applicationConflict</errorCode>
    [exec]  <errorMessage><![CDATA[Invalid userAppName parameter: Application name 'application-7' already exists]]></errorMessage>
    [exec] </errorData></zendServerAPIResponse>

要解决此问题,我们删除了虚拟主机并使用下面提到的相同配置重新创建它。

还有其他方法可以解决问题吗?


更多信息

Zend服务器版本:

Version 8.0.2,Developer Standard Edition,Development profile

操作系统版本:

Ubuntu 14.04.1 LTS

詹金斯版本:

1.599

有关虚拟主机的信息:

  • 类型:Zend Server定义
  • 创建时间:2015年2月27日8:18:23
  • 文件根目录:/usr/local/zend/var/apps/https/dev.application-7.de/443/1.0.0_177/public /
  • 安全性:启用SSL
  • 证书文件路径/etc/apache2/ssl/dev.application-7.de.crt
  • 密钥文件路径/etc/apache2/ssl/dev.application-7.de.key
  • 链文件路径/etc/apache2/ssl/dev.application-7.de.csr

虚拟主机配置:

<VirtualHost *:443>
    SetEnv "APP_ENV" "dev"

    DocumentRoot "/usr/local/zend/var/apps/https/dev.application-7.de/443/1.0.0_177/public/"
    <Directory "/usr/local/zend/var/apps/https/dev.application-7.de/443/1.0.0_177/public/">
        Options +Indexes +FollowSymLinks
        DirectoryIndex index.php
        AllowOverride All
        Require all granted
    </Directory>

    SSLEngine on
    SSLCertificateFile "/etc/apache2/ssl/dev.application-7.de.crt"
    SSLCertificateKeyFile "/etc/apache2/ssl/dev.application-7.de.key"
    SSLCertificateChainFile "/etc/apache2/ssl/dev.application-7.de.csr"

    ServerName dev.application-7.de:443
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

    # include the folder containing the vhost aliases for zend server deployment
    IncludeOptional "/usr/local/zend/etc/sites.d/https/dev.application-7.de/443/*.conf"
</VirtualHost>

Ant构建文件:

<?xml version="1.0" encoding="UTF-8"?>
<project name="application-7-de-2" default="build">
    <!-- By default, we assume all tools to be on the $PATH -->
    <!-- <property name="toolsdir" value=""/> -->

    <!-- Uncomment the following when the tools are in ${basedir}/vendor/bin -->
    <!-- <property name="toolsdir" value="${basedir}/vendor/bin/"/> -->

    <!-- Uncomment the following when the tools are in a custom path -->
    <property name="baseuri" value="https://dev.application-7.de:443"/>
    <property name="appname" value="application-7-de"/>
    <property name="defaultserver" value="false"/>
    <property name="toolsdir" value="/usr/local/zend/bin/"/>
    <property name="params" value="APP_ENV=dev"/>

    <property name="host" value="http://our-zend-server.de:10081"/>
    <property name="key" value="ZendStudio"/>
    <property name="secret" value="OUR_SECRET"/>

    <target name="build" depends="prepare,composer,lint,phploc-ci,pdepend,phpmd-ci,phpcs-ci,phpcpd-ci,phpunit,phpdox,zpk,deploy" description=""/>
    <target name="build-parallel" depends="prepare,lint,tools-parallel,phpunit,phpdox" description=""/>
    <target name="tools-parallel" description="Run tools in parallel">
        <parallel threadCount="2">
            <sequential>
                <antcall target="pdepend"/>
                <antcall target="phpmd-ci"/>
            </sequential>
            <antcall target="phpcpd-ci"/>
            <antcall target="phpcs-ci"/>
            <antcall target="phploc-ci"/>
        </parallel>
    </target>
    <target name="clean" unless="clean.done" description="Cleanup build artifacts">
        <delete dir="${basedir}/build/api"/>
        <delete dir="${basedir}/build/coverage"/>
        <delete dir="${basedir}/build/logs"/>
        <delete dir="${basedir}/build/pdepend"/>
        <delete dir="${basedir}/build/phpdox"/>
        <property name="clean.done" value="true"/>
    </target>
    <target name="prepare" unless="prepare.done" depends="clean" description="Prepare for build">
        <mkdir dir="${basedir}/build/api"/>
        <mkdir dir="${basedir}/build/coverage"/>
        <mkdir dir="${basedir}/build/logs"/>
        <mkdir dir="${basedir}/build/pdepend"/>
        <mkdir dir="${basedir}/build/phpdox"/>
        <property name="prepare.done" value="true"/>
    </target>
    <target name="composer" depends="prepare" description="Update dependencies">
        <exec executable="${toolsdir}composer" failonerror="true">
            <arg value="update"/>
            <arg value="--working-dir"/>
            <arg path="${basedir}"/>
        </exec>
    </target>
    <target name="lint" description="Perform syntax check of sourcecode files">
        <apply executable="php" failonerror="true">
            <arg value="-l" />
            <fileset dir="${basedir}/module">
                <include name="**/*.php" />
                <modified />
            </fileset>
            <fileset dir="${basedir}/tests">
                <include name="**/*.php" />
                <modified />
            </fileset>
        </apply>
    </target>
    <target name="phploc" description="Measure project size using PHPLOC and print human readable output. Intended for usage on the command line.">
        <exec executable="${toolsdir}phploc">
            <arg value="--count-tests" />
            <arg path="${basedir}/module" />
            <arg path="${basedir}/tests" />
        </exec>
    </target>
    <target name="phploc-ci" depends="prepare" description="Measure project size using PHPLOC and log result in CSV and XML format. Intended for usage within a continuous integration environment.">
        <exec executable="${toolsdir}phploc">
            <arg value="--count-tests" />
            <arg value="--log-csv" />
            <arg path="${basedir}/build/logs/phploc.csv" />
            <arg value="--log-xml" />
            <arg path="${basedir}/build/logs/phploc.xml" />
            <arg path="${basedir}/module" />
            <arg path="${basedir}/tests" />
        </exec>
    </target>
    <target name="pdepend" depends="prepare" description="Calculate software metrics using PHP_Depend and log result in XML format. Intended for usage within a continuous integration environment.">
        <exec executable="${toolsdir}pdepend">
            <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
            <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
            <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
            <arg path="${basedir}/module" />
        </exec>
    </target>
    <target name="phpmd" description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
        <exec executable="${toolsdir}phpmd">
            <arg path="${basedir}/module" />
            <arg value="text" />
            <arg path="${basedir}/build/phpmd.xml" />
        </exec>
    </target>
    <target name="phpmd-ci" depends="prepare" description="Perform project mess detection using PHPMD and log result in XML format. Intended for usage within a continuous integration environment.">
        <exec executable="${toolsdir}phpmd">
            <arg path="${basedir}/module" />
            <arg value="xml" />
            <arg path="${basedir}/build/phpmd.xml" />
            <arg value="--reportfile" />
            <arg path="${basedir}/build/logs/pmd.xml" />
        </exec>
    </target>
    <target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
        <exec executable="${toolsdir}phpcs">
            <arg value="--standard=PSR2" />
            <arg value="--extensions=php" />
            <arg value="--ignore=autoload.php" />
            <arg path="${basedir}/module" />
            <arg path="${basedir}/tests" />
        </exec>
    </target>
    <target name="phpcs-ci" depends="prepare" description="Find coding standard violations using PHP_CodeSniffer and log result in XML format. Intended for usage within a continuous integration environment.">
        <exec executable="${toolsdir}phpcs" output="/dev/null">
            <arg value="--report=checkstyle" />
            <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
            <arg value="--standard=PSR2" />
            <arg value="--extensions=php" />
            <arg value="--ignore=autoload.php" />
            <arg path="${basedir}/module" />
        </exec>
    </target>
    <target name="phpcpd" description="Find duplicate code using PHPCPD and print human readable output. Intended for usage on the command line before committing.">
        <exec executable="${toolsdir}phpcpd">
            <arg path="${basedir}/module" />
        </exec>
    </target>
    <target name="phpcpd-ci" depends="prepare" description="Find duplicate code using PHPCPD and log result in XML format. Intended for usage within a continuous integration environment.">
        <exec executable="${toolsdir}phpcpd">
            <arg value="--log-pmd" />
            <arg path="${basedir}/build/logs/pmd-cpd.xml" />
            <arg path="${basedir}/module" />
        </exec>
    </target>
    <target name="phpunit" depends="prepare" description="Run unit tests with PHPUnit">
        <exec executable="${toolsdir}phpunit" failonerror="true">
            <arg value="--log-junit"/>
            <arg value="build/logs/junit.xml"/>
            <arg value="--configuration"/>
            <arg path="${basedir}/tests/phpunit.xml"/>
        </exec>
    </target>
    <target name="phpdox" depends="phploc-ci,phpcs-ci,phpmd-ci" description="Generate project documentation using phpDox">
        <exec executable="${toolsdir}phpdox" dir="${basedir}/build"/>
    </target>
    <target name="zpk" depends="phpdox">
        <exec executable="${toolsdir}zs-client" failonerror="true">
            <arg value="packZpk"/>
            <arg value="--folder=${basedir}"/>
            <arg value="--destination=${basedir}"/>
            <arg value="--name=application.zpk"/>
        </exec>
    </target>
    <target name="deploy" depends="zpk">
        <exec executable="${toolsdir}zs-client" failonerror="true">
            <arg value="installApp"/>
            <arg value="--baseUri=${baseuri}"/>
            <arg value="--userAppName=${appname}"/>
            <arg value="--defaultServer=${defaultserver}"/>
            <arg value="--userParams=${params}"/>
            <arg value="--zpk=${basedir}/application.zpk"/>
            <arg value="--zsurl=${host}"/>
            <arg value="--zskey=${key}"/>
            <arg value="--zssecret=${secret}"/>
        </exec>
    </target>
</project>

0 个答案:

没有答案