I can't figure out why, but when I'm connected to a memcache server the thumbnail generation process in Assets hangs for long periods of time, the getElements process throws 403 errors, the generating thumbnails throw 401 errors and then the user is signed out.

This happens in 2 different AWS environments and on my local environment configured using MAMP. In total, three different memcache servers (production, stage, local) have this same thing occur.

The only thing I can find in the logs that seems like it could be related is an error message that reads:

Tried to restore session from a cookie, but the given login name does not match the given uid.

I'm currently running Craft CMS 2.6.3019 (most current version of 2.x at the moment).

Edit: I also wanted to mention these assets all reside in an Amazon S3 bucket. Thought that might be relevant here, too.

Edit 2: I forced hasThumb() to always return false by commenting out these lines. The thumbnails don't generate 401 errors (because no thumbnails are being generated and the placeholder images are being used instead). And getElements runs much quicker, but it stills throws 403 errors after clicking around for some time.

1 Answer 1


My solution to this was to swap memcache for Redis. I realize that doesn't resolve why memcache wasn't working for us, but swapping it corrected this issue.

My best guess is either:

  1. We were caching data to memcache that was too large for it to optimally handle.
  2. Memcache was being overwhelmed when asked to cache the thumbnails for images that Craft was generating.

These are completely unfounded, but just some best guesses on what was happening.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.