2013-12-23 67 views
0

清除緩存時,Capifony cap部署失敗。執行「'緩存時出錯:clear --no-warmup'」

這些是日誌。

我已經嘗試了許多事情,如做app/console緩存:清除服務器和本地。

你能幫我嗎?

$ cap staging deploy 
--> Updating code base with remote_cache strategy 
--> Creating cache directory................................✔ 
--> Creating symlinks for shared directories................✔ 
--> Creating symlinks for shared files......................✔ 
--> Normalizing asset timestamps............................✔ 
--> Updating Composer.......................................✔ 
--> Installing Composer dependencies........................✘ 
*** [err :: somsom.jp] [RuntimeException] 
*** [err :: somsom.jp] An error occurred when executing the "'cache:clear --no-warmup'" command. 
*** [err :: somsom.jp] 
*** [err :: somsom.jp] Exception trace: 
*** [err :: somsom.jp]() at /var/www/html/somsom.jp/shared/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php:182 
*** [err :: somsom.jp] Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::executeCommand() at /var/www/html/somsom.jp/shared/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php:62 
*** [err :: somsom.jp] Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache() at phar:///var/www/html/somsom.jp/releases/20131223074835/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:165 
*** [err :: somsom.jp] Composer\EventDispatcher\EventDispatcher->executeEventPhpScript() at phar:///var/www/html/somsom.jp/releases/20131223074835/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:138 
*** [err :: somsom.jp] Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///var/www/html/somsom.jp/releases/20131223074835/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:107 
*** [err :: somsom.jp] Composer\EventDispatcher\EventDispatcher->dispatchCommandEvent() at phar:///var/www/html/somsom.jp/releases/20131223074835/composer.phar/src/Composer/Installer.php:288 
*** [err :: somsom.jp] Composer\Installer->run() at phar:///var/www/html/somsom.jp/releases/20131223074835/composer.phar/src/Composer/Command/InstallCommand.php:110 
*** [err :: somsom.jp] Composer\Command\InstallCommand->execute() at phar:///var/www/html/somsom.jp/releases/20131223074835/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:244 
*** [err :: somsom.jp] Symfony\Component\Console\Command\Command->run() at phar:///var/www/html/somsom.jp/releases/20131223074835/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:897 
*** [err :: somsom.jp] Symfony\Component\Console\Application->doRunCommand() at phar:///var/www/html/somsom.jp/releases/20131223074835/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:191 
*** [err :: somsom.jp] Symfony\Component\Console\Application->doRun() at phar:///var/www/html/somsom.jp/releases/20131223074835/composer.phar/src/Composer/Console/Application.php:117 
*** [err :: somsom.jp] Composer\Console\Application->doRun() at phar:///var/www/html/somsom.jp/releases/20131223074835/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:121 
*** [err :: somsom.jp] Symfony\Component\Console\Application->run() at phar:///var/www/html/somsom.jp/releases/20131223074835/composer.phar/src/Composer/Console/Application.php:83 
*** [err :: somsom.jp] Composer\Console\Application->run() at phar:///var/www/html/somsom.jp/releases/20131223074835/composer.phar/bin/composer:43 
*** [err :: somsom.jp] require() at /var/www/html/somsom.jp/releases/20131223074835/composer.phar:15 
*** [err :: somsom.jp] 
*** [err :: somsom.jp] 
*** [err :: somsom.jp] install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] 
*** [err :: somsom.jp] 
*** [err :: somsom.jp] 
*** [deploy:update_code] rolling back 
failed: "TERM=dumb sudo -u app /bin/sh -c 'sh -c '\\''cd /var/www/html/somsom.jp/releases/20131223074835 && php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress'\\'''" on somsom.jp 

與logger.level =記錄儀:: MAX_LEVEL

--> Installing Composer dependencies 
    * executing "sh -c 'cd /var/www/html/somsom.jp/releases/20131223135618 && php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress'" 
    servers: ["somsom.jp"] 
    [somsom.jp] executing command 
** [out :: somsom.jp] Loading composer repositories with package information 
** [out :: somsom.jp] Installing dependencies from lock file 
** [out :: somsom.jp] Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them. 
** [out :: somsom.jp] Nothing to install or update 
** [out :: somsom.jp] Generating autoload files 
** [out :: somsom.jp] [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException] 
** [out :: somsom.jp] You have requested a non-existent parameter "locale". 
** [out :: somsom.jp] Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception 
*** [err :: somsom.jp] [RuntimeException] 
*** [err :: somsom.jp] An error occurred when executing the "'cache:clear --no-warmup'" command. 
*** [err :: somsom.jp] 
*** [err :: somsom.jp] Exception trace: 
*** [err :: somsom.jp]() at /var/www/html/somsom.jp/shared/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php:182 
*** [err :: somsom.jp] Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::executeCommand() at /var/www/html/somsom.jp/shared/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php:62 
*** [err :: somsom.jp] Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache() at phar:///var/www/html/somsom.jp/releases/20131223135618/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:165 
*** [err :: somsom.jp] Composer\EventDispatcher\EventDispatcher->executeEventPhpScript() at phar:///var/www/html/somsom.jp/releases/20131223135618/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:138 
*** [err :: somsom.jp] Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///var/www/html/somsom.jp/releases/20131223135618/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:107 
*** [err :: somsom.jp] Composer\EventDispatcher\EventDispatcher->dispatchCommandEvent() at phar:///var/www/html/somsom.jp/releases/20131223135618/composer.phar/src/Composer/Installer.php:288 
*** [err :: somsom.jp] Composer\Installer->run() at phar:///var/www/html/somsom.jp/releases/20131223135618/composer.phar/src/Composer/Command/InstallCommand.php:110 
*** [err :: somsom.jp] Composer\Command\InstallCommand->execute() at phar:///var/www/html/somsom.jp/releases/20131223135618/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:244 
*** [err :: somsom.jp] Symfony\Component\Console\Command\Command->run() at phar:///var/www/html/somsom.jp/releases/20131223135618/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:897 
*** [err :: somsom.jp] Symfony\Component\Console\Application->doRunCommand() at phar:///var/www/html/somsom.jp/releases/20131223135618/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:191 
*** [err :: somsom.jp] Symfony\Component\Console\Application->doRun() at phar:///var/www/html/somsom.jp/releases/20131223135618/composer.phar/src/Composer/Console/Application.php:117 
*** [err :: somsom.jp] Composer\Console\Application->doRun() at phar:///var/www/html/somsom.jp/releases/20131223135618/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:121 
*** [err :: somsom.jp] Symfony\Component\Console\Application->run() at phar:///var/www/html/somsom.jp/releases/20131223135618/composer.phar/src/Composer/Console/Application.php:83 
*** [err :: somsom.jp] Composer\Console\Application->run() at phar:///var/www/html/somsom.jp/releases/20131223135618/composer.phar/bin/composer:43 
*** [err :: somsom.jp] require() at /var/www/html/somsom.jp/releases/20131223135618/composer.phar:15 
*** [err :: somsom.jp] 
*** [err :: somsom.jp] 
*** [err :: somsom.jp] install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] 
*** [err :: somsom.jp] 
*** [err :: somsom.jp] 
    command finished in 3638ms 
*** [deploy:update_code] rolling back 
    * executing "rm -rf /var/www/html/somsom.jp/releases/20131223135618; true" 
    servers: ["somsom.jp"] 
    [somsom.jp] executing command 
    command finished in 152ms 
failed: "TERM=dumb sudo -u app /bin/sh -c 'sh -c '\\''cd /var/www/html/somsom.jp/releases/20131223135618 && php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress'\\'''" on somsom.jp 

它說, '你已要求不存在的參數 「區域設置」' 在我的config.yml

。它需要%locale%

imports: 
    - { resource: parameters.yml } 
    - { resource: security.yml } 
    - { resource: "@AcmeAdminBundle/Resources/config/admin.yml"} 


framework: 
    translator:  { fallback: %locale% } 

and in parameters.yml。有地區價值。

parameters:  
    locale: ja 

它在本地環境中正常工作。

服務器上的更改是什麼?

回答

1

包括此行到您的deploy.rb看得多了細節:

logger.level = Logger::MAX_LEVEL 

驗證的parameters.yml內容,這是一個問題,而頻繁。

+0

謝謝我的記錄器級別已經最大。我現在驗證parameters.yml。 – whitebear

+0

然後用完整的輸出更新您的問題,以便我們可以更詳細地瞭解問題。 –

+0

我犯了一個粗心的錯失。現在我更新了日誌。 – whitebear

1

在我看來,我只是去到應用程序/緩存目錄和室射頻督促室射頻開發

+0

他不能這樣做,因爲部署過程是原子化的......要麼你完全部署,要麼你根本沒有(文件正在被刪除) –

0

我對Capifony這個問題非常感興趣,因爲我在這段時間裏有很多問題。

這是我在谷歌發現:Capistrano: use a custom user instead of root with sudo

那麼,你在你的deploy.rb類似這樣的一條線嗎?

set :default_shell,   "TERM=dumb sudo -u www-data /bin/sh" 
+0

Exactly.I有這樣一行:default_shell,「TERM =啞sudo -u app/bin/sh」。但我認爲這不是造成這個問題的原因。由於我在同一臺服務器上的另一個capifony部署腳本中使用了相同的用戶(它運行良好) – whitebear

0

我有同樣的問題,因爲我已經註冊AppKernel捆(教義夾具),但使用的需要,開發了安裝它

所以composer.json部分(「腳本「symfony標準版的部分)處理緩存被擰緊一旦它在prod服務器上工作