My site www.sozoonthe.net is stuck in maintenance mode even though the check box is on "Online". I also ran a query of :

---------------------------------------------------------------
UPDATE variable SET value = 's:1:"0";' WHERE name= 'site_offline';
DELETE FROM cache WHERE cid = 'variables';
---------------------------------------------------------------

This did not work. Anyone have experience with this? Please advise...I am running on a short schedule.

Comments

bwv’s picture

Go into your DB, look for the system table. Look for a row witih the word offline, and change the number from 1 to 0 (or 0 to 1, depending on what it says there).
----------------------------------------------------------------------
http://www.bwv810.com/

I am a writer and researcher. In my spare time I build websites with Drupal.
Je peux communiquer en français. / Я могу общаться на русском языке.

LizD’s picture

Thanks for pointing me in the right direction. In 6.17 its in the Variable table. Find "site_offline" and and change s:1:"0"; to s:1:"1";
I have no idea why I got stuck in maintenance mode but it would not change back.

cog.rusty’s picture

I see that it is fixed now. For anyone reading this, there are other methods without going to the database.

The obvious method: Go to http://yoursite.com/?q=user, login as admin, go the admin/settings page and bring the site online.

If for some reason you can't login, add to the end of the settings.php file the line

$conf['site_offline'] = 0;

This will override the database variable and force the site to come online, until you fix the settings and remove that line.

colemichael’s picture

Thanks guys. I may report that one as a bug if I cannot figure out what caused it.

Cole Michael Lambert
Avant Media
cole.michael@avant-media.com

meganmcc’s picture

Thanks for posting!

ecommercium’s picture

Just edited $conf['site_offline'] = 0; to $conf['maintenance_mode'] = 0; in settings file and did the trick. (Used D7.34)

mdinardo’s picture

Hi there,

My site is currently stuck in maintenance mode from the Drupal 7.51 update. The site logged me out as an admin and we cannot reach the login page since the site seems to be stuck in a loop on maintenance mode. I tried http://yoursite.com/?q=user as well as http://yoursite.com/user but no luck. I saw that you had another suggestion and I was wondering how to give this a try?

Thanks,

Molly

andiec’s picture

i had to goto admin>performance> and clear cache for it to work

blog

jibberish’s picture

Nice one andiec

That just worked for me in drupal 7. In ver 7, it's configuration > performance > clear all caches

Stellar Rush’s picture

This worked for me. I had set back to online but checking the site did not show it back on line. Cleared All Cache and everything is fine now. Thanks!

phdenis63’s picture

If you are using module i18n, the problem can come from a error in i18n variables
(I don't know why but I have sometimes a "site_offline" variable value for french)
Try
DELETE FROM `yourdbname`.`i18n_variable` WHERE `i18n_variable`.`name` = 'site_offline' AND `i18n_variable`.`language` = 'fr'
DELETE FROM `yourdbname`.`i18n_variable` WHERE `i18n_variable`.`name` = 'site_offline_message' AND `i18n_variable`.`language` = 'fr'
Don't forget to clear the caches after the delete

riverrat’s picture

Hi
Altered variable because of another problem to put into maintenance mode, now can not get out of it, even though I followed advice to change settings.php
There is not prob with i18n.
Any ideas anyone?

connieow’s picture

Have Drupal 7

Set it on maintenance mode while I was working and without thinking logged out. Got into a hurry.

Tried the above: the link and the code for settings.php

Have to be logged in to use the admin, cannot log in.

HELP. Desperate.

Connie

mgrenda’s picture

Connie just add /cron.php to your url to get to a login for your site.

connieow’s picture

Keep getting redirected to a 404 page. No matter what links I click. Do not want to start over again. When I transferred my site I lost everything. Now this. Beginning to think someone is trying to tell me something. Not sure what.

Where do I find these files: http://connieowens.com/admin/config/development/maintenance for this address in my file structure? Can I edit the page code?

Where does it log the site in or out of maintenance mode? What file? Where would the code be?

Want to figure this out. Not have to reinstall the site.

Thank you for your help.

Connie

jscoble’s picture

you should be able to access it via http://connieowens.com/?q=user. However this gets redirected to your hosts 404 page.

Do you have direct access to your database? and what version of Drupal are you using?

connieow’s picture

Using Drupal 7.

Used the /cron.php, logged in, clicked the site name, then clicked go online. Was directed back to the 404 page. Clicked other links same issue.

Yes, have access to my database through myPHPadmin. Do not yet fully understand how to use it. Read the line about changing the variable - name- site offline. Could not find it. Still not sure how to use Query. Neglected some of my early learning in regards to this. Took a short cut and now regretting it.

Would rather not go through the install thing again.

Is the site taking a long time to load for you? I need to know if it is my server or my ISP. Thank you.

Thank you.

Connie

jscoble’s picture

Connect to your database through myPHPadmin and run the following:

update variable set value = 'i:0;'
where name = 'maintenance_mode';

truncate table cache;

if your drupal database is not the default database you connect to then you may need to run the following, replacing db_name with the name of your drupal database:

update db_name.variable set value = 'i:0;'
where name = 'maintenance_mode';

truncate table db_name_cache;

I am not sure that this will resolve all your issues since the server is serving up 404 pages, page not found, on urls that should be valid. If that problem persists, you might want to try opening a ticket with your provider.

Good Luck

connieow’s picture

Have access to DB, ran the query, was successful. But.... Log in page is a mess, no theme and now to try changing the settings.php as suggested after this.

Reloading the damn thing sure is a better looking option but really do want to learn what I did wrong so I do not do it again. Had all permissions set for me. Message said I could log in while in maintenance mode. BUT.....

Will get back to ya'll.

Thank you.

blainelang’s picture

I just had a client contact me and their site was locked in Maintenance mode and they swear they did not do this - were only editing the site content when it redirected them and locked them out.

I was not able to login as the user login form would not appear - but no maintenance mode message.

After manually deleting the cache table records, I was able to get the login form to appear and was able to login and disable the maintenance mode - it was checked on.

Focusing on Business Applications but heck we do anything Drupal

rpruitt625’s picture

If you transferred your site, and if you're using Clean URL's - the two servers may be set up differently.

Open your site settings.php file and look for the line :
# $base_url = 'http://www.example.com'; // NO trailing slash!

It's worth a shot. Uncomment this line (remove the # sign) and enter your base url here.

If it doesn't help, put it back the way it was (just comment the line back out).

connieow’s picture

Locked myself out with the maintenance_mode. Signed out and did not put it back. But what I read said I should be able to log in when in maintenance mode. NO...

Think I am going to uninstall and reinstall. Tired of spending so much time trying to find a work around. None of the suggestions work.

Close with the crone.php... But the links keep taking me to the 404 page. ugh.

This looks like something I will want to play with when and if I get the time.

Thanks for your help.

Appreciate the time.

Connie

rpruitt625’s picture

That sure sounds like a problem with how mod_rewrite is handled if you're on an Apache server. Normally, you would just be able to log on by adding /user to your domain name, or even /?q=user and not get a 404 error. Sometimes all it takes is an adjustment to settings.php, otherwise you'd need to explore how mod_rewrite is configured on your new server. Because am betting you are using Clean URL.

connieow’s picture

Using clean urls. Set all that stuff up to ensure easier handling of links, etc. Hate all the extras.

So where do I find mod-rewrite? Use Cpanel the latest one, on an Apache server also. Learning curve, really wishing I had paid more attention to the lessons. Course never considered doing this myself. :) Or ever building a website.

Will keep learning.

Thank you so much for your assist. It is very welcome.

hey_germano’s picture

Look for a file called .htaccess in your site's root directory with your other Drupal files. Your Drupal install should've included one of these, but it's not too hard to miss it when you're uploading everything else since it starts with the dot and is often hidden.

The .htaccess file lets you set Apache configuration options for the directory it's in. The default D7 .htaccess file has the mod_rewrite (clean URL) stuff starting at line 65. But you usually don't have to change anything there - the file just needs to exist and be in the right place.

However, there's a chance that your webhost has things set up so that these sorts of files won't work - if the file is definitely in the right place and is definitely the default Drupal one, you might need to ask your webhost about what's going on.

Good luck!

d_l’s picture

To avoid technical headaches you might consider the option of rapid prototyping your site at drupalgardens.com .. free account .. then have the option of later exporting D7 site to your own site.

The downside is that you must live with the restrictions in that you are allowed to install your own cocktail mix of modules. Or to use PHP. The Theme Builder is useful.

Here is one user site with apparently similar interests to yours ..

http://fumc.drupalgardens.com/node

connieow’s picture

The .htaccess had one line in it: 1

So not sure what happened.

Doing a complete reinstall.

Will be keeping close notes this time and checking and rechecking.

Thank you all for your help.
Bless you.

Connie

yamenshahin’s picture

Hi
I was having the same problem ... When I choose "Clear all Caches" from Home » Administration » Configuration » performance... problem solved.
try it maybe the simplest solution is the only solution.

maxxer’s picture

Hi there,
having the same problem in D7
no i18l installed.
tried updating maintenance_mode in variables table.
using

update variable set value = 'i:0;'
where name = 'maintenance_mode';

truncate table cache;

this query actually failed for me until i removed the ';' in 'i:0;'

tried adding

$conf['site_offline'] = 0;

to settings.php

flushed caches ad nauseam through drupal admin, and also by manually deleting all cache table entries in the DB....

still no dice!
any other thoughts?


I came across this patch:
http://drupal.org/node/1032936
could be related?

simonruffle’s picture

That did not work for me.

However, this did:

update variable set value = 'i:0;'
where name = 'maintenance_mode';

delete from cache_bootstrap where cid = 'variables';

truncate table cache_page;

Tip: I strongly advise having caching turned off before going into maintenance mode, but that does not help if you are already in it and cannot get out!

Another tip for IIS users is: use www.mysite.com/user/login to log in if the rest of your site is giving errors.

I am using Drupal 7.7 with Postgres database on both IIS and Apache.

headdragon’s picture

your site . com / ?q=user worked for me That was simple and back up in seconds

msavike’s picture

In D7, I managed to flush the cash thrice! and it worked, I am guessing I have left the site in Maintenance mode for quite a while...

headdragon’s picture

I have always used www.example.com/exampledrupadirectory/?=admin and always got the login screen. User depends on the front end not admin area of the pages admin takes you to the core you might say. I never log out of my site anymore. I test what it looks like in Chrome Firefox or Opera. Since Safari and Chrome are both written with Apples web-kit they always look the same. So I work in Safari.

joshintosh’s picture

I'm not sure if this is a new D7 thing or not, but everywhere I've looked said to use '/user' (or some variation). This doesn't work in Drupal 7! But this will -> www.yourdrupal7site.com/user/login - hope that helps someone :)

joshintosh’s picture

/user/login Worked for me when just /user didn't.

Rosamunda’s picture

Hi there,
I have the same problem.
I´ve tried everything you said in the comments above, and it works... but after a while (sometimes after an hour, sometimes after half an hour) it happens again.
Note: I´ve checked the variable table, and found that there´s no maintenance_mode, but site_offline variable... Maybe because my site was a D6 updated to D7?
It is happening again and again!
The only temporary solution that I´ve found is to turn off cache! (and yeah, it sucks, it´s not actually a solution).
Please help me solve this. Any ideas?
Thanks!
Rosamunda

Rosamunda’s picture

Update:

I´ve deleted the row 'site_offline' and it works perfectly now!
Could it be that this issue is happening to people that upgraded their sites from D6 and (as in way many other things) D7 changed the way to handle maintenance mode and just "forgot" to delete that row?

I must add that even after deleting it, my site still can be set in and out of maintenance mode (that´s why I assumed that there´s another row handling maintenance mode).

Are my assumptions correct?
Thanks in advance for the clarification!
Rosamunda

Rosamunda’s picture

Well, after a while... the problem resurfaces again. It´s still there: The site puts itself in maintenance mode.
It comes back after manually clearing cache.

ShawnDevin’s picture

I was still logged in as admin on one browser and was able to turn off the maintenance mode easily enough, but the site was still showing as maintenance mode on all other browsers besides that one. Clearing the cache did the trick!
I had a little trouble finding the /#overlay=admin/config/development/performance page, but I googled and found it.

zam_zimbo’s picture

Hi

I got this from Daniel Garneau at the node below

https://www.drupal.org/node/56995

Try the following it worked for me : http://www.example.com/drupal/?q=user
Normally it is http://www.example.com/?q=user
Adding the /drupal/ inbetween worked for me

No need to get into the database

jonodunnett’s picture

I am working on a D7 site that was upgraded from D6, and was having a problem with site staying in maintenance mode in Spanish language (but not in default English).
Eventual fix for me was to empty the Sessions table (just deleted all rows).

barresoft’s picture

This work for me:

update variable set value = 'i:0;' where name = 'maintenance_mode';
truncate table cache;

nellngun’s picture

jscoble you saved my day!

kepesv’s picture

Here was same symptom. We are using memcache.
service memcached restart
solved the problem...