昨天,我在服务器上进行了第 40 次或第 50 次 Symfony2 系统部署。到目前为止一切都很好。今天我遇到了一个严重的错误。发生的情况是这样的:
* executing `symfony:cache:warmup'
* executing "cd /NFS2/oa_sf2/releases/20111214182506 && php app/console cache:warmup --env=prod"
servers: ["151.1.111.19"]
[151.1.111.19] executing command
** [out :: 151.1.111.19] Warming up the cache
** [out :: 151.1.111.19]
** [out :: 151.1.111.19]
** [out :: 151.1.111.19]
** [out :: 151.1.111.19] [RuntimeException]
** [out :: 151.1.111.19] Error creating output file.
** [out :: 151.1.111.19]
** [out :: 151.1.111.19]
** [out :: 151.1.111.19]
** [out :: 151.1.111.19] cache:warmup
** [out :: 151.1.111.19]
** [out :: 151.1.111.19]
command finished
*** [deploy:update_code] rolling back
- 没有机会进一步调查缓存文件夹,因为整个代码树在回滚时被删除
- 我们知道 Capistrano 具有某种方法来禁用回滚,但我们仍然想尝试在无法访问远程服务器的情况下理解 - 它一定是我们这边的问题,从昨天开始一切正常
- 部署用户的读/写/执行权限没有发生任何变化
请对如何推进调查有任何建议吗?
多谢。
ps Stacktrace 上没有类似的问题解决这个特殊问题。
Yesterday I made my 40th or 50th deployment of a Symfony2 system on a server. Everything fine so far. Today I get a nasty error. This is what happens:
* executing `symfony:cache:warmup'
* executing "cd /NFS2/oa_sf2/releases/20111214182506 && php app/console cache:warmup --env=prod"
servers: ["151.1.111.19"]
[151.1.111.19] executing command
** [out :: 151.1.111.19] Warming up the cache
** [out :: 151.1.111.19]
** [out :: 151.1.111.19]
** [out :: 151.1.111.19]
** [out :: 151.1.111.19] [RuntimeException]
** [out :: 151.1.111.19] Error creating output file.
** [out :: 151.1.111.19]
** [out :: 151.1.111.19]
** [out :: 151.1.111.19]
** [out :: 151.1.111.19] cache:warmup
** [out :: 151.1.111.19]
** [out :: 151.1.111.19]
command finished
*** [deploy:update_code] rolling back
- No chance for further investigation into the cache folder because the whole code tree gets removed on rollback
- We know Capistrano features some way to disable the rollback but still we'd like to try understanding with no access on remote server - it must be something on our side, since yesterday it was all OK
- No change was made on the deployment user's read/write/execute rights
Please any suggestion on how to bring investigation forward?
Thanks a lot.
p.s. no similar question on Stacktrace addresses this peculiar issue.
发布评论
评论(3)
我认为这并不是一个与 Capifony 相关的问题。最后它只运行 Symfony 命令。
首先尝试在服务器上手动运行
cache:warmup
任务。这可能是一个权限问题。在预热之前检查缓存目录的权限是什么。您可以通过覆盖任务来做到这一点(只需复制它并在运行实际命令之前在缓存目录上运行 ls -l )。
您不必每次都进行部署来查看问题所在。运行cache:warmup命令本身:
我greped了Symfony 2.0.7源和assetic 的 YUI 压缩器是抛出此类异常的唯一地方(请参阅链接)。这表明这是与使用 assetic 压缩资产有关的问题。可能是您最近添加了此功能并且服务器上没有安装 java。
I think it's not really a Capifony related question. In the end it only runs the Symfony command.
First try running
cache:warmup
task manually on the server.It might be a permissions problem. Check what are the rights to the cache directory just before the warmup. You can do that by overwriting the task (just copy it and run
ls -l
on the cache directory before running an actual command).You don't have to deploy every time to see what's wrong. Run cache:warmup command itself:
I greped Symfony 2.0.7 sources and the assetic's YUI compressor is the only place where such exception is thrown (see link). This suggests it's a problem related to compressing your assets with assetic. Might be you added this feature recently and don't have java installed on the server.
磁盘已满?一旦尝试预热缓存,它可能会变满。
Disk full? Maybe it gets full once it tries to warmup the cache.
缓存预热是一个 symfony 任务 AFAIU,可以通过 XDebug 或其分析器进行检查。
The cache warming is a symfony task AFAIU, it can be inspected through XDebug or its profiler.