Comments (24)
Seems this just has to do with the directory structure changing in laravel 5, perhaps?
The storage directory is now sat in the root directory.
from laravel.
As a work around if you set the file_permissions_paths
yourself it will work.
set :file_permissions_paths, [
'storage',
'storage/app',
'storage/framework/cache',
'storage/framework/sessions',
'storage/framework/views',
'storage/logs',
'vendor',
]
See #10
from laravel.
Yea, that's what I ended up doing, cheers. :)
from laravel.
Sorry for the late response. I'll be helping maintain this plugin for the foreseeable future. If any of these issues are still persisting (all of the tickets are quite old), please let me know and I will do what I can to try and help fix things.
from laravel.
If you're still having issues, please open a new issue.
from laravel.
- I still get trouble with permission "Capistrano::FileNotFound: Cannot change permissions: /var/www/{app_name}/releases/2
0161014035727/storage/app is not a file or directory"
I'm using Laravel 5, Linux 16.04, ACL already. - If I "set :laravel_set_acl_paths, false" the
[ErrorException]
mkdir(): No such file or directory
When execute composer:run
Really appreciate if any one can help.
from laravel.
Could you try setting your Laravel version in deploy.rb?
set :laravel_version, 5.2
from laravel.
Oh, I'm sorry, seems it's a different problem. Which version of the gem do you have installed? It looks like you're using an older one?
from laravel.
@ikari7789 Thank you for your quick reply
I'm using ruby-2.3., capistrano lock '3.6.1'
I also follow this instruction http://xmodulo.com/configure-access-control-lists-acls-linux.html but still does not work.
from laravel.
I have the same issue with
ERROR Cannot change permissions: /var/www/vhosts/appname/releases/20161014080741/storage/app is not a file or directory
with ubuntu 12 and laravel 5.3.
Any ideas?
Thank you very much
from laravel.
Hmm, maybe it's related to Ubuntu. I have only tested with CentOS. I'll run some tests to see what's up.
from laravel.
@I-am-Khoa @aceart I've made a pull request that should fix it. If either of you are able to test it in your own environments before I merge it in and release, it would be greatly appreciated.
I've tested this against a default install of Laravel 4.2, 5.0, 5.1, 5.2, and 5.3.
Here is the repository I used for testing:
https://github.com/ikari7789/capistrano-laravel-test/
from laravel.
@ikari7789 @I-am-Khoa I made it run with a few additional settings. The problem is that the build process fails on the first run. This is because the "current" Folder and all other shared Folders aren't created yet.
I (dirty) fixed it by deactivating following settings:
set :laravel_ensure_linked_dirs_exist, false
set :laravel_ensure_acl_paths_exist, false
and I created the following task, which creates the folders, if they don't exist.
The task automatically creates the folders from file_permissions_paths variable
desc 'Create shared folder if not exist'
after "deploy:symlink:linked_dirs", :create_linked_dirs_if_not_exists do
on roles fetch(:laravel_roles) do
fetch(:file_permissions_paths).each do |path|
within shared_path do
execute :mkdir, '-p', path
end
end
end
end
After the build process successfully executes, you can activate the settings above again.
from laravel.
@aceart Did you test it with the version in the pull request or did you re-run as current? The pull request changes the ensure tasks to use the shared path instead of the release path.
from laravel.
@ikari7789 Thank you for your precious time, sorry for my poor knowledge about Ruby. Could you instruct me how to update your pull request. The old one I installed by this command "gem install capistrano-laravel".
from laravel.
@ikari7789 i did use the current master version, not the pull request. Sadly i saw the pull request after i got it work. I looked at the changes you made at the pull request. I will try it as soon as possible
from laravel.
@I-am-Khoa Forgive me for the poor organization of the tests as well ^^;
This will install the gem locally on your machine with my branch. If you then try to deploy from that machine, it will be using the code I have sitting in the pull request.
git clone https://github.com/ikari7789/capistrano-laravel.git -b patch-8
cd capistrano-laravel
bundle install
bundle exec rake install
@aceart Sorry about that. Take your time. I think it should fix the problems. I just want to make sure I'm not introducing more bugs before I merge this in.
from laravel.
@ikari7789 First I want to say thank you so much for your time, I tested on Ubuntu 16.04, Ruby 2.3, Capistrano 3.6.1, and Laravel 5.2. It works without any problems. Thank you again.
from laravel.
@ikari7789 The flow is successful but when I config nginx point to "current" folder for latest release of source, I got the problem.
PHP message: PHP Fatal error: Uncaught UnexpectedValueException: The stream or file "/var/www/laravel/releases/20161021075449/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in var/www/laravel/releases/20161021075449/bootstrap/cache/compiled.php:13891
from laravel.
@I-am-Khoa did you ensure that the user is set correctly? :laravel_server_user
should be the same as your Nginx user.
from laravel.
@ikari7789 I didn't change default setting of :laravel_server_user, this is the same with Nginx user, and grant 777 permission for all users simultaneously. But It didn't work.
from laravel.
I also faced this error, but in bootstrap/cache
folder.
01:03 deploy:set_permissions:check
Cannot change permissions: /home/forge/{app_name}/releases/20161026114841/bootstrap/cache is not a file or directory
(Backtrace restricted to imported tasks)
cap aborted!
Capistrano::FileNotFound: Cannot change permissions: /home/forge/{app_name}/releases/20161026114841/bootstrap/cache is not a file or directory
Tasks: TOP => deploy:set_permissions:acl => deploy:set_permissions:check
(See full trace by running task with --trace)
The deploy has failed with an error: Cannot change permissions: /home/forge/{app_name}/releases/20161026114841/bootstrap/cache is not a file or directory
I also used @aceart 's fix, but It doesn't work
set :laravel_ensure_linked_dirs_exist, false
set :laravel_ensure_acl_paths_exist, false
desc 'Create shared folder if not exist'
after "deploy:symlink:linked_dirs", :create_linked_dirs_if_not_exists do
on roles fetch(:laravel_roles) do
fetch(:file_permissions_paths).each do |path|
within shared_path do
execute :mkdir, '-p', path
end
end
end
end
Did you faced this problem before ?
from laravel.
The problems being faced by @I-am-Khoa and @chungth could possibly be due to the deploy user not having appropriate permissions to set ACL on the directory. For now I've merged in the fix and will make a release shortly.
from laravel.
@ikari7789 Thank you for your time, I tried and fixed by myself.
from laravel.
Related Issues (20)
- Task not found? HOT 3
- Why is .env uploaded instead of linked from shared? HOT 11
- Add support for Lumen deploys HOT 3
- Change the default shared_dir permissions? HOT 1
- Folders not being created... HOT 1
- Trying to set permissions of app/storage in laravel 5 HOT 1
- Possibility of `laravel_dotenv_file` override HOT 1
- Deploy issue with Capistrano 3.8 HOT 8
- Restrict laravel:optimize to laravel_version < 5.5 HOT 1
- Laravel Mix Support HOT 3
- acl paths and env file upload no longer working since upgrade HOT 4
- changes if your site isn't actually in the root of the git repo HOT 2
- /usr/bin/env: 'setfacl': No such file or directory HOT 8
- How/Where would I set migrations to run on each deploy? HOT 4
- 5.8 Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1 HOT 11
- 500 Error HOT 1
- Laravel 6 LTS support HOT 10
- Can't find task after :updating HOT 1
- Laravel Removed artisan optimize but this keeps running when we deploy using Laravel 6 HOT 4
- :cache
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 laravel.