eZ Community » Forums » eZ Publish 5 Platform » Storage directory not found...

Storage directory not found...

Storage directory not found...

Monday 29 April 2013 3:29:07 pm - 10 replies

I'm can't figure out why I am unable to render any images which I embed using the wysiwyg editor in my twig templates, all the time getting the error message:

"InvalidArgumentException: Argument '$path' is invalid: Storage directory not found in var/[dir]/storage/images/media/images/[image_name]/[location]-[version]-eng-GB/[image_name].png".

Problem is, I can clearly see the images in the file system.

Anyone willing to give me pointers how to solve this? This problem is soon having me at my wit's end sad.gif Emoticon

Monday 29 April 2013 3:52:02 pm

You've stumbled upon a good one, Charles.

The reason why you get this error is that the image isn't inside the VarDir, as configured in site.ini. The Legacy eZ Publish kernel was okay with this, but the new API isn't, due to a newly layered API. See https://jira.ez.no/browse/EZP-20687.

Fortunately, a fix has been committed to master this morning that will be part of eZ Publish 5.1 and the next community build.

Feel free to grab the patches & script (note that there is a change in a second commit on eZFSFileHandler that is required).

Out of curiosity, did you rename your var directory at some point ?

Monday 29 April 2013 4:32:38 pm

Hi Charles!

I've got the same issue with a fresh install of community project 2013.4 with ezdemo design (with content). And I had a known issue on blog post: http://share.ez.no/blogs/community-project-board/ez-publish-community-project-2013.4-report

To avoid this problem, I re-installed eZ Publish with ezdemo (without demo content). 

Monday 29 April 2013 7:25:20 pm

Hi Bertrand,

Unfortunately, running the upgrade script didn't work for me. It alters the table "ezimagefile" in the database by removing the directory separator before "storage" but leaves on the directory name before it.

It changed my image filepaths from "var/mydir/storage/images..." to "var/mydirstorage/images...". I had to reverse the changes.

Out of curiosity, did you rename your var directory at some point ?

What I did was, after a fresh install of community project 2013.4 with demo content, I created a new bundle with separate database, siteaccesses for frontend and backend, and separate varDir.

Modified on Monday 29 April 2013 7:35:54 pm by Charles Okech

Monday 29 April 2013 7:31:00 pm

Quote from Sylvain Guittard :

To avoid this problem, I re-installed eZ Publish with ezdemo (without demo content). 

Hi Sylvain,

This is what I suspected I'm gonna have to do. I will try it next.

Tuesday 30 April 2013 12:28:20 pm

Hmmm, this is odd.

If it helps, I have published a comment on JIRA about the various use-cases, and the status of the update script in regards to those: https://jira.ez.no/browse/EZP-20687?focusedCommentId=75124#comment-75124

I can help you further if you tell me what path you have, what your old & new vardir are.

Tuesday 30 April 2013 2:07:00 pm

Hi Bertrand,

My setup was as follows:

For eZDemoBundle, the setup wizard created the siteaccesses ezdemo_site_user and ezdemo_site_admin with VarDir=var/ezdemo_site.

I created, for my bundle OtienoHostingBundle, the following siteaccesses: eng, ger and hosting_admin with VarDir=var/hosting, with its own separate database.

After embedding the images for my bundle, they were saved in "var/hosting/storage/images...".

After running the script, this is what I noticed after looking at the table "ezimagefile" in the two databases:

in the ezdemo database, image paths were given as "var/storage/images...". I'm not sure what they were before running the script as I hadn't checked.

in my hosting database, image paths were changed from "var/hosting/storage/images..." to "var/hostingstorage/images/...".

Tuesday 30 April 2013 2:10:51 pm

I've now re-installed without demo content and will confirm later if I encounter the same problem or not.

Tuesday 30 April 2013 3:48:57 pm

Hah, the var/storage like path originated from another bug (cycling parameter injection, kind of), that has been fixed last week.

You should be safe on your new DB/VarDir if every file in ezmediafile does start with var/hosting.

Tuesday 30 April 2013 6:43:02 pm

Hi Bertrand.

I have executed your script with a recent installation of ezpcommunity201304 with demo content. But all images are not fixed.

In my database, I have a lot of images with original alias in ezcontentobject_attribute table, but there is no matching in ezimagefile table.

Example :

ezcontentobject_attribute :  url="var/storage/images/travel/peruvian-amazon/heron-in-the-water/342-1-fre-FR/Heron-in-the-Water.jpg"
ezimagefile :  only the gallerythumbnail and gallery aliases : var/storage/images/travel/peruvian-amazon/heron-in-the-water/342-1-fre-FR/Heron-in-the-Water_gallerythumbnail.jpg  

The original path is in ezcontentobject_attribute, but it is not in ezimagefile. In consequence,  a lot of images are missing.

I'll re-install asap in order to explain that. 




After a new clean installation, your script woks fine, all is good.


Modified on Tuesday 30 April 2013 7:50:19 pm by Arnaud Chasseux

Wednesday 01 May 2013 10:17:57 am

The script will indeed only fix images referenced in ezimagefile. It could indeed have been an option to look into the ezcontentobject_attribute data_text fields for ezimage, but there is no real reason why we would end up with an image here that doesn't reference one in ezimagefile.

As I've said, the var/storage path comes from a bug in the setup wizard that was fixed a couple days ago. If you use a recent (e.g. from this week) GIT version, you shouldn't have to use the script.


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from