Sometimes site changes like installing a new add-on, upgrading your X-Cart core or rebuilding your store site’s cache may not go as smoothly as planned. A syntax error in the code of a new add-on, an incompatibility of an add-on with the new X-Cart core after an upgrade or a cache rebuild failure may crash your store website. Hence when you attempt to access the store website, you cannot. For example, you may just continuously see a page saying “The site is temporarily closed for maintenance”.
This article describes what you can do if you face this major problem and get your store up and running.
Drop and re-create your site’s cache
If you suspect the problem originates to an improperly completed site’s cache rebuild process, you should try clearing your store’s cache and running the cache rebuild process anew. Normally, cache rebuild process takes place when you apply a core upgrade, install a new add-on, enable/disable an installed add-on, or manually launch the cache rebuild process by selecting Re-deploy the store option on the Cache Management page (System Settings > Cache Management) in your store’s admin area. If your store stopped functioning after one of those actions, chances are high that is because of problems with the site’s cache. There are quite a number of reasons why cache re-generation may go wrong for your site. One of the most popular is closing a page where the cache rebuild process is being executed. But no matter what caused the problem, you can try to resolve it using one of the following methods.
Access your store using a specially crafted URL. As a result, your existing site cache is dropped, and the cache rebuild process is launched automatically.
X-Cart versions 5.3.6.x-188.8.131.52
Use the following URL format:
NB: Replace the part “https://www.example.com/x-cart/” in the URL with the actual address of your store website, and the part “XXXXXXXXXXXXXX” with your actual Safe Mode access key.
The Safe Mode access key can be found in the file
var/data/.safeModeAccessKey in your X-Cart installation folder or if you are using an X-Cart version below 184.108.40.206 can be copied from any of the two reset links that were sent to your site administrator mailbox after X-Cart installation. For X-Cart 5.1.9-5.3.x, the message subject reads “Soft and Hard reset links for your store!”; for X-Cart versions 5.1.8 and earlier the subject is ”New safe mode access key has been generated!”.
X-Cart versions below 220.127.116.11-18.104.22.168
The feature not supported.
X-Cart versions below 22.214.171.124 and later
Use the following URL format:
The part “https://www.example.com/x-cart/” in the URL needs to be replaced with the actual address of your store website, and the part “XXXXXXXXXXXXXX” needs to be replaced with your actual Auth code (See the auth_code value in the file
X-Cart versions below 126.96.36.199
Delete the folder
var/runand the file
var/.rebuildStartedin your X-Cart installation folder.
Go to your store’s admin area. X-Cart will detect the absence of cache and will automatically launch the cache rebuild process.
X-Cart versions 188.8.131.52 and later
https://www.example.com/x-cart/service.php#/login. Be sure to replace the part “https://www.example.com/x-cart/” with your actual site address.
Enter the auth_code from the file
etc/config.phpinto the Auth code field.
https://www.example.com/x-cart/service.php?/rebuild. Again, be sure to use your own site address.
Contact your hosting team
Good hosting companies back up your entire website (databases and files) every day. Excellent ones - even more often.
If your website crashed for any reason, contact your hosting team and ask them to recover your store from backup.
Recover your store using Safe Mode (X-Cart versions below 5.4.x)
It might happen that your hosting provider does not respond to you in time and you have to deal with the situation by yourself. Another possibility is that you are working in a development environment and need to find out what exactly crashed your store so you would be able to fix it. In this case you may want to try using Safe Mode. Safe Mode enables you to re-deploy your store with a limited set of add-ons (or without add-ons), which can help you to identify the source of your problem more easily.
To run your store in Safe Mode, you need to access your store website using a reset link. X-Cart has several types of reset links.
X-Cart versions 5.x-5.2.6: Disables all the custom add-ons uploaded to the store directly via the "Upload addon" feature NOT via the X-Cart App Store.
X-Cart versions 5.2.7-5.3.x (below 5.4.x): Disables all the add-ons except for the ones developed by X-Cart 5 team and Qualiteam.
X-Cart versions 5.x-5.2.6: Disables absolutely all the add-ons and custom mods, leaving only the core.
X-Cart versions 5.2.7-5.3.x (below 5.4.x): Disables all the add-ons except for the ones developed by X-Cart 5 team.
NB: Any custom modifications uploaded to your store in the form of add-ons via the "Upload addon" feature are disabled regardless of the reset link type - no matter who the author of the modification is, whether it be X-Cart service departments, X-Cart partners or 3rd party developers.
After a reset link is used, X-Cart disables the add-ons that need to be disabled according to the type of the link. Then it tries to recover itself. Once the store is back online, it is possible to try enabling the add-ons again one by one in order to identify the one causing the site to crash. As soon as you know which add-on is causing the problem, you can contact the add-on developer to get it fixed.
In X-Cart versions below 184.108.40.206, you can find your Hard and Soft reset links in your store’s Admin area on the Safe mode page (System tools > Safe mode).
You can also find the same links in an email message that was sent to the administrator mailbox after X-Cart installation. For X-Cart versions 5.1.9 and later, the message subject reads “Soft and Hard reset links for your store!”, for earlier versions - “New safe mode access key has been generated!”.
The format of the reset links is as follows:
(If you cannot access your reset links, you can re-create them manually by replacing the part “https://www.example.com/x-cart/” with the actual address of your store and the part ”XXXXXXXXXXXXXX” with your actual Safe Mode access key from the file
In X-Cart versions 5.2.7-5.3.x, the Safe mode section of your store’s Admin area also provides the so-called “Current state” link. This link corresponds to your store’s latest snapshot. It may be useful if you want to capture the current state of your store and bring your store back to this state later. For example, you can copy this link and store it in a separate file before you try to install a new add-on. If the installation goes wrong, you will be able to restore your site by visiting this link: your store will be re-deployed with only the add-ons that were active at the time you copied the link.
The format of the Current state link is as follows:
The link can be easily re-created manually by replacing the part “https://www.example.com/x-cart/” with the actual address of your store, the part ”XXXXXXXXXXXXXX” with your actual Safe Mode access key from the file
<restore_date> with the date of the snapshot that needs to be restored.