Comments (27)
Question, why don't we always use the already computed hash and we solve the problem for all platforms?
from cache.
@inverse since the last seven days this issue occurred? Nope!
My only workaround was to move the whole project to a non encrypted place on my laptop which is quite annoying.... -.-
from cache.
I have a similar issue on Ubuntu. The annotation cache fails to be written saying
rename(<redacted>/app/cache/dev/annotations/aa/swappz9lFr,<redacted>/app/cache/dev/annotations/aa/5b5b435d496e63656e746565765c57656242756e646c655c456e746974795c50726f66696c6524666565644974656d4e6565644d6f6465726174696f6e405b416e6e6f745d5d5b315d.doctrinecache.data): File name too long
I'm not using Virtualbox or docker in this project, just running it on my computer directly.
from cache.
I have the same issue on a simple Ubuntu LTS 16. The home-directory is encrypted by default (which is a good thing, basically).
As I run most of my projects from my projects-folder in my home-directory (Guess I'm not the only one), I get a load of debug-messages while developing (working with Symfony)
from cache.
Same issue with encrypted home directory here, except I run the project in docker container, and encrypted diretory is on host (Ubuntu 14.04).
I'm using this config setting in a Symfony app as a temporary solution:
framework:
annotations:
cache: doctrine_cache.providers.doctrine.orm.default_metadata_cache
doctrine:
orm:
entity_managers:
default:
metadata_cache_driver: apcu
from cache.
I'm having issues with using filecache running PHP under docker in production.
By default docker uses AUFS driver for file storage which has a 242 character limit for FILE_NAME. See http://aufs.sourceforge.net/aufs3/man.html (Search for 242)
Running on ubuntu 14.04
$ getconf NAME_MAX /
255
Running on ubuntu 14.04 inside docker:
$ getconf NAME_MAX /
242
It's actually quite easy to reproduce. The following code works on normal linux, but fails when in docker:
<?php
require 'vendor/autoload.php';
$cache = new Doctrine\Common\Cache\PhpFileCache('cache');
$size = 113;
$name = str_pad('', $size, 'a');
var_dump($cache->save($name, 123));
var_dump($cache->fetch($name));
Non-docker:
bool(true)
int(123)
Docker:
bool(false)
bool(false)
The simplest solution would be to use a safer limit for file name, such as 200, or to always use the hash.
from cache.
there is even a problem when adding files to tar, for example you warm-up a cache and archive it for deployment
tar-based phar "/tmp/archive584a56835cf9f.tar" cannot be created, filename "var/cache/dev/annotations/01/5b49747576735c4f726d42756e646c655c456e746974795c52756c6c73247573657269
64405b416e6e6f745d5d5b315d.doctrinecache.data" is too long for tar file format
from cache.
I have the same issue, except it's for prod too.
from cache.
same here with ubuntu 16.04
from cache.
Same on Ubuntu 14.04 and PHP 5.5.9, without docker
from cache.
@acasademont I agree. See discussion in #94 (comment)
from cache.
@Tobion seriously? A condition to check for the uniqueness of a SHA256? This is crazy! The person who finds a collision will become instantly famous (and earn some good money), the world hasn't still found a collision on SHA1 :/
@Ocramius can we please reconsider this?
from cache.
ping @Ocramius, happy to work on a PR using the hash as the name, that should be more than enough to solve all these problems
from cache.
@acasademont please send us the PR but don't forget about the tests 😉
from cache.
I'm having this issue also on prod using docker, can update code only containers as cache fails to be added. Any progress on this?
from cache.
It's fascinating how long it takes to revert one commit.
@emudojo we've switched docker from aufs storage driver to overlay2, that should fix your issues.
from cache.
I have the very same issue on Ubuntu 17.04 with encrypted filesystem.
from cache.
@jstuhli mind sharing your daemon.json to try it ?
from cache.
@emudojo
{ "storage-driver": "overlay2" }
https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/
from cache.
@kitingChris did you ever solve this?
from cache.
This issue still exists on Ubuntu 16.04 LTS with an encrypted drive.
Moving the cache dir to /tmp works though (good as a temp workaround)
edit: symlinking your cache to a dir in /tmp is sufficient, no need to move the whole project.
from cache.
Had the same problem, had to do this in AppKernel.php (if you use the prod env in the vagrant box, your conditional may vary a bit).
public function getCacheDir()
{
if (in_array($this->environment, ['dev', 'test'])) {
return '/tmp/symfony/cache/' . $this->environment;
}
return parent::getCacheDir();
}
from cache.
I have the same issue with an encrypted home directory on Mint 18.3
from cache.
@hast did you try my code or @janvernieuwe suggestion to symlink your cache dir to /tmp?
from cache.
@digitall-it yes, both work, but it'd be much better if there were native support for the encrypted folders.
from cache.
If you think about it, cache files better reside in a temporary folder. Also. There are so many different use cases that it could be very difficult to address them all. I understand that In your case there could be security implications.
from cache.
Closing as we're sunsetting this library. Please see #354 for more details.
from cache.
Related Issues (20)
- CI doesn't have PHP 7.3 in the matrix HOT 2
- Support RedisCluster? HOT 3
- mkdir is affected by default `umask()` setting HOT 1
- Suggestion: Refactor code to replace the name "cache" as a directory name HOT 1
- compression? HOT 1
- Sunsetting doctrine/cache HOT 15
- Lazy Redis connection HOT 2
- The typehint for the CacheAdapter constructor is wrong HOT 2
- Is there a docs for v2? HOT 2
- Cache namespace from Setup::createCacheConfiguration gets lost
- Crash in Doctrine/ORM/Tools/Setup/createCacheInstance() after composer update HOT 4
- Performance degradation due to subsequent commit of deferredItems in PSR6 CacheAdapter HOT 8
- 1.12.1 and PHP7 breaking compatibility HOT 16
- Required PHP Version is Incorrect HOT 4
- PHP语法报错 HOT 1
- mark doctrine/cache as abandoned on packagist? HOT 1
- SonarQube Blocker Bug HOT 6
- Not working with symfony/cache v 6.1.1 HOT 10
- Release v3 as a bridge to Laminas or Symfony Cache HOT 6
- Incorrect "mixed" type hint in TypedCacheItem HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cache.