Fixing magento errors can be quite cumbersome especially when you only receive a log message and magento saying that it can't produce any output for security reasons. One error we encountered was quite puzzling and involved an issue with memcached and the native magento caching.

"Can’t get filling percentage"

Is the error we're going to touch base on today. The only prerequisite is that you must have memcached installed. This tutorial only covers a fix to this error when caused by memcached.

Note: it is imperative that memcached is actually running. Type:

service memcached restart

If you encounter any error, contact your webmaster or troubleshoot the issue. We don't necessarily want to use service memcached reload here because it may or may not give us any errors.

Step 1

Verify your app/etc/local.xml file and make sure you. Here is the configuration we used and it works quite well for us:

<config>
	<global>
		<install>
			<date><![CDATA[Thu, 24 Mar 2012 08:15:24 +0000]]></date>
		</install>
		<crypt>
			<key><![CDATA[foobar]]></key>
		</crypt>
		<disable_local_modules>false</disable_local_modules>
		<resources>
			<db>
				<table_prefix><![CDATA[]]></table_prefix>
			</db>
			<default_setup>
				<connection>
					<host><![CDATA[localhost]]></host>
					<username><![CDATA[foo]]></username>
					<password><![CDATA[bar]]></password>
					<dbname><![CDATA[foo]]></dbname>
					<active>1</active>
				</connection>
			</default_setup>
		</resources>
		<session_save><![CDATA[db]]></session_save>
		<!-- begin cache config -->
		<cache>
			<prefix>alphanumeric</prefix>
			<backend><![CDATA[memcached]]></backend>
            <slow_backend><![CDATA[database]]></slow_backend>
			<memcached>
				<servers>
					<server>
						<host><![CDATA[127.0.0.1]]></host>
						<port><![CDATA[11211]]></port>
						<persistent><![CDATA[1]]></persistent>
						<weight><![CDATA[1]]></weight>
						<timeout><![CDATA[10]]></timeout>
                        <retry_interval><![CDATA[10]]></retry_interval>
                        <status><![CDATA[1]]></status>
					</server>
				</servers>
				<compression><![CDATA[0]]></compression>
                <cache_dir><![CDATA[]]></cache_dir>
                <hashed_directory_level><![CDATA[]]></hashed_directory_level>
                <hashed_directory_umask><![CDATA[]]></hashed_directory_umask>
                <file_name_prefix><![CDATA[]]></file_name_prefix>
			</memcached>
		</cache>
		<!-- end cache config -->
	</global>
	<admin>
		<routers>
			<adminhtml>
				<args>
					<frontName><![CDATA[admin]]></frontName>
				</args>
			</adminhtml>
		</routers>
	</admin>
</config>

Verifying that your config file is correct, we need to do one more thing to make sure that magento actually sees this updated config file and not your old cached copy.

With SSH

Navigate to your document root of your magento install.

cd var/cache
rm -rf *

The above commands will completely clear out any remaining cache that magneto might be reading from. Reload your site and see if the issue persists.

With FTP/SCP

Open your favorite FTP/SCP client and navigate to the directory where magento is installed.
Open the var directory
Open the cache directory
Select all of the items and press delete.

Open var/sessions and delete all of the contents in there IF you are using your file system to store the sessions.

Via SSH:

cd /path/to/magento/
rm -rf var/cache/*
# use the following code if you are using your file system to store session data
# if you are not sure then check the app/etc/local.xml file
# look for <session_save><![CDATA[files]]></session_save>
rm -rf var/session/*

If you are using your database to store sessions, be sure you clear these too otherwise the error can persist!
Open phpmyadmin and truncate the core_session table or do it via command-line (see below):

mysql -p -u username database
mysql> TRUNCATE TABLE core_session;

Step 2

Seeing the same error or even a different error? Fear not! We still have some tricks up our sleeves.
Assuming the pecl extension is correctly configured then type the following WHILE logged onto your server via ssh. We must be on the server for this to work.

telnet 127.0.0.1 11211
flush_all

You will see the following output:

telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
flush_all
OK

You have successfully cleared the cache. Try reloading your page now and it should resolve this error.

If this does NOT resolve your error, post comments on this post and any solutions you have found!

Be Sociable, Share!