solved Unable to copy to Cache directory

sekeri
sekeri
@ilker
10 years ago
334 posts
I have just purchased Youtube module and installed it without any problems.

But when I go to ACP->Modules->Youtube Support->Language Tab
I get the error message below;
CRI: Unable to copy modules/jrCore/templates/page_link_cell.tpl to template cache directory: data/cache/jrCore

I have no errors navigating the other tabs of Youtube module.

I had similar errors about cache directory time to time before and deleting the items under data/cache/ and recreating permissions solves the problem. I know it will solve again but I need to get rid of this problem permanently.
I am using DigitalOcean for hosting and followed the instructions on this website step by step during the installation.

Any help highly appreciated.
updated by @ilker: 05/30/14 03:47:23AM
brian
@brian
10 years ago
10,148 posts
Check that the file:

jrCore/templates/page_link_cell.tpl

actually exists on the system - if not, reload the core module and see if that fixes it.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sekeri
sekeri
@ilker
10 years ago
334 posts
It is there because I can display it with template editor.

modules/jrCore/templates/page_link_cell.tpl
brian
@brian
10 years ago
10,148 posts
sekeri:
It is there because I can display it with template editor.

modules/jrCore/templates/page_link_cell.tpl

That doesn't for sure mean it is there - does that template show modified at all?

The error you are getting only happens because either that template file is NOT readable, or where it is trying to copy it to:

data/cache/jrCore

is not writable by the web user.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sekeri
sekeri
@ilker
10 years ago
334 posts
How can I make data/ folder and its sub directories writable properly? And newly created files by Jamroom folders/files writable?

I am asking because I have searched the web for how to do it a couple of times. When I first do it it works. But like today, when I install something or upload something then it gives such messages about copying to cache directory.

Maybe if you explain this folder permissions topic step by step it would be very helpful for all. Because your "High Performance Jamroom On DigitalOcean" document was really great.

Thanks,
Ilker.
brian
@brian
10 years ago
10,148 posts
If you are on SSH, the easiest way is to go into your /home/whatever directory - replace "whatever" with the username you created - as root, and type:

chown -R whatever. *

Note that the period at the end if "whatever" is needed - that's not a typo.

This will change ownership to the "whatever" user for all files and directories in the home directory - this is what you want if you followed my DO guide.

You should never need to change permissions as long as the ownership is correct.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sekeri
sekeri
@ilker
10 years ago
334 posts
I will try this! Thanks.
Developer Networks
Developer Networks
@developer-networks
10 years ago
566 posts
Also not sure if this will apply to your situation but apache saves files as a user called www-data. So if you updated or use the marketplace to install your files chances are Apache has saved under its user www-data. You will want to add www-data to your usergroup and also chown all the files to your user after updating.
sekeri
sekeri
@ilker
10 years ago
334 posts
I have updated the ownership of the folders/subfolders and it works for now. But I am following it. Because as you mentioned above the reason may be that "Apache saves under user www-data" and newly created folders/files are not writable.

If I face it again I sure will try your sugession. Thanks!
brian
@brian
10 years ago
10,148 posts
sekeri:
I have updated the ownership of the folders/subfolders and it works for now. But I am following it. Because as you mentioned above the reason may be that "Apache saves under user www-data" and newly created folders/files are not writable.

This is not the case if you have followed my DO guide...


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
michael
@michael
10 years ago
7,714 posts
Same thing happens often for me on my local server. Its no big deal there because its not mission critical and its not on-line

Things i do to fix it:
#1 SSH into the server
#2
[code]sudo chmod -R 777 /var/www/vhosts/path/to/my/webfolder/httpdocs/[code]

Then login via FTP and delete everything in
/httpdocs/data/cache

Then load the page your wanting to load again and it will all come back up.

I know its got something to do with the user the webserver runs as is not the same as the user FTP runs as, but its not a big enough issue to go looking for how to change it in my case.

For a production server I would use @brian's DO guide
<a href="https://www.jamroom.net/the-jamroom-network/blog/23/high-performance-jamroom-on-digitalocean" target="_blank" rel="nofollow">https://www.jamroom.net/the-jamroom-network/blog/23/high-performance-jamroom-on-digitalocean</a>

Tags