Symfony 1.4: Error Clearing Cache in Maintenance Mode

180 views Asked by At

I'm working with a legacy Symfony 1.4 site, and upgrading at this time is not an option.

In order to deploy the site, I've created a task that first puts the site into maintenance mode, does some other work (pull down code, etc.), then clears the cache, before attempting to put the site back online (out of maintenance mode).

However, I find when I try to clear the cache in maintenance mode, it fails and I instead get the web-page back on the command line. Any suggestions on resolving this?

[geoff.maddock@corp09 smc]$ sudo ./symfony project:disable prod koba frontend2 api api2
[sudo] password for geoff.maddock:
>> file+     /var/www/smc/data/koba_prod.lck
>> enable    koba [prod] has been DISABLED
>> file+     /var/www/smc/data/frontend2_prod.lck
>> enable    frontend2 [prod] has been DISABLED
>> file+     /var/www/smc/data/api_prod.lck
>> enable    api [prod] has been DISABLED
>> file+     /var/www/smc/data/api2_prod.lck
>> enable    api2 [prod] has been DISABLED


[geoff.maddock@corp09 smc]$ sudo ./symfony cc
>> cache     Clearing cache type "all" for "backend" app and "prod" env
>> file+     /var/www/smc/data/backend_prod-cli.lck
>> chmod 777 /var/www/smc/data/backend_prod-cli.lck
>> file-     /var/www/smc/cache/backend/prod/config/modules_sfGuardAuth_config_module.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/config_core_compile.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_circuit_config_filters.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_virtualCenter_config_security.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_home_config_filters.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/config_factories.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/config_databases.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_circuit_config_module.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/config_routing.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_virtualCenter_config_view.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/config_app.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_change_config_module.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_virtualCenter_config_module.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_customer_config_filters.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_home_config_module.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_change_config_filters.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/config_settings.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_customer_config_module.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_circuit_config_security.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_ticket_config_filters.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_sfGuardAuth_config_security.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_customer_config_security.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_change_config_security.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_ticket_config_security.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_virtualCenter_config_filters.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_sfGuardAuth_config_view.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_home_config_security.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/config_config_handlers.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_ticket_config_module.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/config_autoload.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_home_config_view.yml.php
>> file-     /var/www/smc/cache/backend/prod/config/modules_sfGuardAuth_config_filters.yml.php
>> file-     /var/www/smc/data/backend_prod-cli.lck
>> cache     Clearing cache type "all" for "frontend2" app and "prod" env
<!DOCTYPE html>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="title" content="Expedient Support Management Console" />
<meta name="description" content="Expedient Support Management Console" />
<meta name="keywords" content="Expedient Support Management Console" />
<meta name="language" content="en" />
<meta name="robots" content="noindex, nofollow" />
<title>Temporarily Down for Maintenance</title>

<style type="text/css"><!--
* {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial,Sans-Serif;
  font-size: 0.75em;
  line-height: 1.5em;
  color: #444;
  background-color: #fff;
  margin: 20px;
  padding: 20px;
}

div.wrapper {
  position: relative;
  display: block;
  width: 500px;
  margin: 0 auto;
}

div.content {
  font-size: 1.3em;
  line-height: 1.4em;
  padding: 20px;
  background: #f8f8f8;
}

h1 {
  color: #333;
  font-size: 50px;
  line-height: 1.4em;
  font-weight: bold;
  margin: 20px 0;
}

p {
  margin: 10px 0;
}

strong {
  font-weight: bold;
}

--></style>

</head>
<body>

<div class="wrapper">
  <h1>Temporarily Down for Maintenance</h1>
  <div class="content">
    <p>
      We are performing scheduled maintenance.  We should be back shortly.
    </p>
    <p>
      If you need immediate assistance, please contact our support center at 1-888-227-9400.
    </p>
    <p>
      <a href="javascript:window.location.reload()">Try again: Reload Page</a>
    </p>
  </div>
</div>

</body>
1

There are 1 answers

0
Greg On

I’m not a symfony 1.4 specialist/enthusiast, but have you tried with just removing everything from cache dir? You can do it with:

rm -r /path/to/the/dir/with/cache/* 

(Remember about * at the end of a path to remove dirs inside cache dir)