deployer icon indicating copy to clipboard operation
deployer copied to clipboard

deploy:symlink rm: cannot remove 'release'

Open Silmi opened this issue 7 years ago • 5 comments

Sometimes i receive a fail on step deploy:symlink. it's not a permanently fail. I get this one time out of ten

Q A
Issue Type Bug, Question
Deployer Version 6.4.3
Local Machine OS Ubuntu16.04
Remote Machine OS N/A
PHP 7.3.0

Content of deploy.php

<?php
namespace Deployer;

require 'recipe/laravel.php';

set('repository', 'repo.git');
set('http_user', 'www-data');
add('shared_files', [
    '.env'
]);
add('shared_dirs', [
    'storage',
    'node_modules',
]);
add('writable_dirs', [
    'bootstrap/cache',
    'storage',
]);
localhost('local')->set('deploy_path', '/var/www/project');
task('build', function () {
    run('cd {{release_path}} && gulp');
});

task('deploy', [
    'deploy:prepare',
    'deploy:lock',
    'deploy:release',
    'deploy:update_code',
    'deploy:shared',
    'deploy:vendors',
    'deploy:writable',
    'build',
    'artisan:down',
    'deploy:symlink',
    'php-fpm:restart',
    'artisan:up',
    'deploy:unlock',
    'cleanup',
]);

after('deploy:failed', 'deploy:unlock');
after('deploy:failed', 'artisan:up');
before('deploy:symlink', 'artisan:migrate');

Output log

➤ Executing task deploy:symlink
[local] > if [[ $(man mv 2>&1 || mv -h 2>&1 || mv --help 2>&1) =~ '--no-target-directory' ]]; then echo 'true'; fi
[local] < sh: 1: [[: not found
[local] > cd /var/www/project && ln -nfs /var/www/project/releases/176 current
[local] > cd /var/www/project && rm release
[local] < rm: cannot remove 'release'
[local] < : No such file or directory
➤ Executing task deploy:failed

Silmi avatar Mar 02 '19 07:03 Silmi

Really strange, did you go to server and check if release symlink are there?

antonmedv avatar Mar 02 '19 08:03 antonmedv

Really strange, did you go to server and check if release symlink are there?

Release symlink is not there

Silmi avatar Mar 02 '19 09:03 Silmi

Can you watch and understand whenrelease symlink deleted?

antonmedv avatar Mar 02 '19 12:03 antonmedv

Is it completely random or does it follow any kind of pattern? The "[[ not found" issues points to your shell not being bash, since [[ ]] is a bash builtin. Can you post the output of deploy:release too?

micvog avatar Jun 03 '19 12:06 micvog

I am cleaning up on issues. Fill free to reopen if needed. Also, we have a new section available: discussions.

antonmedv avatar Oct 08 '20 00:10 antonmedv