Giter VIP home page Giter VIP logo

Comments (24)

chiel avatar chiel commented on August 17, 2024

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.

spencerdeinum avatar spencerdeinum commented on August 17, 2024

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.

chiel avatar chiel commented on August 17, 2024

Yea, that's what I ended up doing, cheers. :)

from laravel.

ikari7789 avatar ikari7789 commented on August 17, 2024

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.

ikari7789 avatar ikari7789 commented on August 17, 2024

If you're still having issues, please open a new issue.

from laravel.

hamony avatar hamony commented on August 17, 2024
  1. 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.
  2. 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.

ikari7789 avatar ikari7789 commented on August 17, 2024

Could you try setting your Laravel version in deploy.rb?
set :laravel_version, 5.2

from laravel.

ikari7789 avatar ikari7789 commented on August 17, 2024

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.

hamony avatar hamony commented on August 17, 2024

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

aceart avatar aceart commented on August 17, 2024

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.

ikari7789 avatar ikari7789 commented on August 17, 2024

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.

ikari7789 avatar ikari7789 commented on August 17, 2024

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

aceart avatar aceart commented on August 17, 2024

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

ikari7789 avatar ikari7789 commented on August 17, 2024

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

hamony avatar hamony commented on August 17, 2024

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

aceart avatar aceart commented on August 17, 2024

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

ikari7789 avatar ikari7789 commented on August 17, 2024

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

hamony avatar hamony commented on August 17, 2024

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

hamony avatar hamony commented on August 17, 2024

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

ikari7789 avatar ikari7789 commented on August 17, 2024

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

hamony avatar hamony commented on August 17, 2024

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

chungth avatar chungth commented on August 17, 2024

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.

ikari7789 avatar ikari7789 commented on August 17, 2024

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.

hamony avatar hamony commented on August 17, 2024

@ikari7789 Thank you for your time, I tried and fixed by myself.

from laravel.

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.