Giter Club home page Giter Club logo

Comments (27)

acasademont avatar acasademont commented on July 26, 2024 4

Question, why don't we always use the already computed hash and we solve the problem for all platforms?

from cache.

kitingChris avatar kitingChris commented on July 26, 2024 1

@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.

stof avatar stof commented on July 26, 2024

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.

TorbenKoehn avatar TorbenKoehn commented on July 26, 2024

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.

ostrolucky avatar ostrolucky commented on July 26, 2024

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.

jstuhli avatar jstuhli commented on July 26, 2024

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.

Gamesh avatar Gamesh commented on July 26, 2024

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.

J7mbo avatar J7mbo commented on July 26, 2024

I have the same issue, except it's for prod too.

from cache.

acasademont avatar acasademont commented on July 26, 2024

same here with ubuntu 16.04

from cache.

charlycoste avatar charlycoste commented on July 26, 2024

Same on Ubuntu 14.04 and PHP 5.5.9, without docker

from cache.

Tobion avatar Tobion commented on July 26, 2024

@acasademont I agree. See discussion in #94 (comment)

from cache.

acasademont avatar acasademont commented on July 26, 2024

@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.

acasademont avatar acasademont commented on July 26, 2024

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.

lcobucci avatar lcobucci commented on July 26, 2024

@acasademont please send us the PR but don't forget about the tests 😉

from cache.

emudojo avatar emudojo commented on July 26, 2024

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.

jstuhli avatar jstuhli commented on July 26, 2024

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.

kitingChris avatar kitingChris commented on July 26, 2024

I have the very same issue on Ubuntu 17.04 with encrypted filesystem.

from cache.

emudojo avatar emudojo commented on July 26, 2024

@jstuhli mind sharing your daemon.json to try it ?

from cache.

jstuhli avatar jstuhli commented on July 26, 2024

@emudojo
{ "storage-driver": "overlay2" }
https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/

from cache.

inverse avatar inverse commented on July 26, 2024

@kitingChris did you ever solve this?

from cache.

janvernieuwe avatar janvernieuwe commented on July 26, 2024

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.

digitall-it avatar digitall-it commented on July 26, 2024

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.

ozahorulia avatar ozahorulia commented on July 26, 2024

I have the same issue with an encrypted home directory on Mint 18.3

from cache.

digitall-it avatar digitall-it commented on July 26, 2024

@hast did you try my code or @janvernieuwe suggestion to symlink your cache dir to /tmp?

from cache.

ozahorulia avatar ozahorulia commented on July 26, 2024

@digitall-it yes, both work, but it'd be much better if there were native support for the encrypted folders.

from cache.

digitall-it avatar digitall-it commented on July 26, 2024

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.

alcaeus avatar alcaeus commented on July 26, 2024

Closing as we're sunsetting this library. Please see #354 for more details.

from cache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.