Jump to content

Store Offline stopped working


Lynne in NY

Recommended Posts

Hello,

We have been working with the store off line so we could view it as Admins but it wouldn't be available to the gen'l public. Then I put the store online to test it, found some products without images were still displaying, so went back into Admin and took the store off line, then deactivated the incomplete products, then when I went to look at the store again instead of the big red warning banner and the store, we get the message for when the store is offline as seen by the public.

I'm not sure what I broke, and I can't figure out how to get the store visible to Admins again without making it available to the public.

Please advise?

p.s. I did try clearing cache in admin, in the browser and even tried a few other browsers. The only "hack" change I made was to add a line to reduce the spacing between categories in drop downs (which didn't work, btw). Would that line of code mess up the ability to view the store as Admins when it is closed?

 

Link to comment
Share on other sites

Make sure to clear CubeCart's cache.

Then please try logging out of admin. Then log back in and right-click the "Storefront - Closed" link at the upper right corner - selecting "Open in new window/tab".

For some reason, the storefront thinks there is no admin logged in.

Link to comment
Share on other sites

Did that already, but did it again. Once again... cleared all cache in CC, browser, logged off, logged on as Admin, opened store using the right click / open in new window/tab (tried both) and still the store won't display. It ONLY displays when I make it be online.

 

Link to comment
Share on other sites

Note... this is an issue in all browsers now: IE, FireFox, SeaMonkey, Chrome, Safari & Puffin.

It allows me to log in as Admin (I even created a new Admin in case the one I was using got screwed up and same thing for the new admin), and I can make changes in the Admin panel and if I turn the store on, I can see the changes, but if I turn the store offline, I can't see the store at all.

 

 

Link to comment
Share on other sites

I ran into that behavior once some time ago. I ended up going into the config of the database, decoding the base64, flipping the offline switch from 0 to 1, and then encoding back into base64 and replacing the config. Drastic, but it worked. (I did have enough sense to make a copy of the table before such a fool hardy approach.)

Link to comment
Share on other sites

OMG.... I was just logging into the databases when this popped in..... hold that thought.

Holy moly.... The data in the config table is all encrypted. I can't fix it thru resetting something there.

I just wanna get things back to normal without completely losing everything in a re-install.  😢



BhdGgiOiJcLyJ9

Link to comment
Share on other sites

Ok, I got it decoded, but I can't figure out which part controls the store to be online for admins?

\/","catalogue_latest_products":"1","catalogue_latest_products_count":"9","catalogue_popular_products_count":"10","catalogue_popular_products_source":"0","skin_folder":"foundation","skin_style":"default","admin_skin":"default","skin_change":"0","disable_mobile_skin":"1","download_expire":"36000","download_count":"10","stock_level":"1","basket_out_of_stock_purchase":"0","stock_warn_type":"1","stock_warn_level":"1","product_weight_unit":"Kg","show_basket_weight":"0","basket_allow_non_invoice_address":"1","stock_change_time":"2","hide_out_of_stock":"","update_main_stock":"","store_title":"Au Contraire Arts","store_meta_description":"","seo_add_cats":"2","seo_cat_add_cats":"1","seo_metadata":"2","ssl":"1","standard_url":"http:\/\/aucontraireart.com","cookie_domain":".aucontraireart.com","offline":"1","offline_content":"<html>\r\n<head>\r\n\t<title>Store Offline<\/title>\r\n<\/head>\r\n<body>\r\n<p>We are offline right now. Please visit again soon.<\/p>\r\n<\/body>\r\n<\/html>\r\n","email_method":"mail","email_name":"Au Contraire Arts","email_address":"[email protected]","email_smtp_host":"","email_smtp_port":"","email_smtp":"0","email_smtp_user":"","email_smtp_password":"","debug":"0","debug_ip_addresses":"","cache":"1","proxy":"0","proxy_host":"","proxy_port":"","fuzzy_time_format":"%H:%M","time_format":"%b %d %Y, %H:%M","dispatch_date_format":"%b %d %Y","time_offset":"0","time_zone":"America\/New_York","r_admin_activity":"30","r_admin_error":"30","r_email":"30","r_request":"30","r_staff":"30","r_system_error":"30","feed_access_key":"8Or6Luioc6xE","store_copyright":"<p>&copy;2019 aucontraireart.com - All rights reserved.<\/p>\r\n","product_clone":"1","product_clone_images":"","product_clone_options":"","product_clone_options_matrix":"","product_clone_acats":"","product_clone_main_stock":"1","product_clone_code":"1","product_clone_translations":"","product_clone_redirect":"","dbl_opt":"","cookie_dialogue":"","bftime":"600","bfattempts":"5","oid_prefix":null,"oid_postfix":null,"oid_zeros":null,"oid_start":null,"oid_col":"cart_order_id","csrf":"1","enc_key":null,"ssl_url":"https:\/\/aucontraireart.com","ssl_path":"\/"}

Link to comment
Share on other sites

Find this:

"offline":"1","offline_content"

This says Offline mode is enabled. We know that because you are seeing the offline message.

What is not happening is that CubeCart seems to think there is no admin logged in.

In the file /includes/functions.inc.php, function offline(), a test is made with:

if (!Admin::getInstance()->is()) {

If "Is there an admin?" is false, then show the offline content.

My next question (aside from deep-level troubleshooting) is: could there be a server-level caching utility? (From the HTTP headers, there is no indication of a page cache utility in place. This is not the same as CubeCart's cache.)

Link to comment
Share on other sites

I will try to look into that server question... but it's never been at issue before. It's a dedicated server (mine). And everything has been working fine for the last month or so that we've been building with CC. Regardless, even if there were a server side new cache rule (and there've been no recent server updates), I generally set up all web sites to refresh per session. I'm tied up now in another fire ... but thanks all for the input and I will get back to this soon! If not this evening, tomorrow for sure!!

 

Link to comment
Share on other sites

There's a lot of private data displayed in your config info above, like recaptcha keys and email address. Since the offline switch is not the issue at all - you really should delete all the stuff shown in the two comments full of your config data. Sorry that didn't help.

Link to comment
Share on other sites

I don't care about the email address, but thanks for the heads up on the recaptcha. The rest is fairly useless to anyone who would try to access the account.

Problem does still exist, I guess we'll just have to live with only being able to make changes behind the curtain while in front of the audience.

Sucks... though I suppose I can rig up a link to some code to activate an index.htm that says we're off line, but that won't prevent anyone from getting into the store from links they have from previously been there.



 

Link to comment
Share on other sites

  • 1 month later...

This issue with the software not recognizing Administrators is ongoing. Another clue we just discovered to prove that something broke (we sure would like to know what!) is that when viewing the customers online, we see our IP Addresses in the list but the Administrator boxes aren't checked. Does anyone know specifically how the code determines an Administrator? i.e, what field values are analyzed, what modules do the analyzing?

Link to comment
Share on other sites

To have a clue, please enable debugging in admin, and enter your IP address (www.whatismyip.com) in the adjacent field. Clear the cache. Then log out of both the admin and storefront sides.

On the storefront, at the bottom of the page, there is a grey debug section. In the SESSION section, make sure there is no '__admin' part. (There should only be '__client' and '__system'.)

Now log in as a customer. The debug SESSION section still will not have a '__admin' part.

Now log in to the admin side. The debug SESSION will now have '__admin', '__admin_data', and in '__client' there will be an 'admin_id'.

Please let us know if this matches what you see on your site.

Link to comment
Share on other sites

In the SESSION section before logging out there was also '_recaptcha'.

I see all of that exactly as you described.

However- I've been seeing all along in the admin statistics under 'who's online' my ip address, and I noticed in the SESSION '_client' it was different. I verified it was different by checking the ip address in the admin statistics under 'who's online' again. So then I checked what should it be (whatismyip.com) and the one in the '_client' is correct.

😲

Update: Oh, and I just realized I didn't enter my ip address when I turned on debugging. So quite possibly this over sight on my part got us quicker to the problem?


 

Link to comment
Share on other sites

Oh boy. Here is the situation.

We were working with another cart under aucontraireartS.com, and after months of frustration and bugs I installed CC under aucontraireart.com (no 's').

After deciding to fire the programmer and use CC, I didn't want to go through the whole CC install and set up that we'd worked a few weeks on under the ...art.com domain. So I deleted the ...artS.com web site and parked its domain on the ...art.com web site so that anyone who goes to ...art$.com automatically gets redirected to ..art..com

So when logging into admin, we've been using ...art.com. When we use the store we use ...art$.com. So I logged into admin under BOTH ...art and ...art$ so I could see both ip addresses at the same time as users online, and neither of them were recognized as admins (the admin box was not checked).

Link to comment
Share on other sites

In my investigations about Users Online, I see the query that gets the list has the condition that CubeCart_sessions table, 'acp' column equal to zero.

As I think 'acp' is "Admin Control Panel", this query is getting those who are viewing the storefront as opposed to working in the administration pages.

(Also, the list shown is only good for those that made a page request in the past thirty minutes.)

The "Is admin" flag is shown in the table for those session records where the admin_id is greater than zero.

So, it is probably the case that the Users Online list will not show a logged-in admin unless the admin first logs in, then visits the storefront. To verify, on an already opened browser tab showing the storefront, check for the existence in the SESSION debug group for an admin_id that is not zero.

Once a not zero 'admin_id' is showing, then request the Users Online list.

But here's the bugger -- now that you have fetched a page from the administration, the CubeCart_session database table now shows that the 'acp' column is no longer equal to zero. Requesting the Users Online list again will not include the admin!

Does this solve any part of the Store Offline issue? Probably not. We have only discerned why the Users Online list may or may not be showing a logged-in admin.

 

Link to comment
Share on other sites

In admin, Store Settings, SSL tab, you find a "Cookie Domain" setting. While this appears to be a user-editable setting, it is actually re-calculated every time the CubeCart script runs. So, if you have two domains pointing to the same installation of CubeCart, you will see this setting change to match the domain you just used.

Note that with the whole cookie situation, CubeCart specifies that a cookie is valid only for the cookie's specified domain -- the 'HOST' value of the cookie parameters. If there being a different domain, there is a different cookie. And cookies are all what CubeCart uses to keep sessions separate.

(Note: it is possible to overrule the calculation of the domain name. This can be done in /includes/global.inc.php, and is necessary when accessing an installation using an IP address -- avoid using localhost.)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...