F
Filamentβ€’12mo ago
ericmp

Laravel Deployer unknown error

i've installed: https://github.com/lorisleiva/laravel-deployer i've defined the deploy.php file to test if i can run commands in the prod server, i'm just doing pwd to see what it does:
namespace Deployer;

require 'recipe/laravel.php';
require 'contrib/php-fpm.php';
require 'contrib/npm.php';

set('repository', $repoUrl);

host('prod')
->set('remote_user', $linuxUser)
->set('hostname', $hostname)
->set('deploy_path', '/var/www/' . $projectName)
;

task('deploy', [
'deploy:prepare',
'deploy:vendors',
'artisan:storage:link',
'artisan:view:cache',
'artisan:config:cache',
'artisan:migrate',
'npm:install',
'build',
'deploy:publish',
]);

task('build', function () {
run('pwd');
});

after('deploy:failed', 'deploy:unlock');
namespace Deployer;

require 'recipe/laravel.php';
require 'contrib/php-fpm.php';
require 'contrib/npm.php';

set('repository', $repoUrl);

host('prod')
->set('remote_user', $linuxUser)
->set('hostname', $hostname)
->set('deploy_path', '/var/www/' . $projectName)
;

task('deploy', [
'deploy:prepare',
'deploy:vendors',
'artisan:storage:link',
'artisan:view:cache',
'artisan:config:cache',
'artisan:migrate',
'npm:install',
'build',
'deploy:publish',
]);

task('build', function () {
run('pwd');
});

after('deploy:failed', 'deploy:unlock');
9 Replies
ericmp
ericmpOPβ€’12mo ago
but if instead of php vendor/deployer/deployer/dep build i do php vendor/deployer/deployer/dep ssh, it works, i am connected successfully to the machine via ssh anyone knows what happens?
Tieme
Tiemeβ€’12mo ago
@ericmp Don't think so, this is not a filament problem. This package is 3 years old. no updates don't think it supports Laravel 9 or 10 so you can create a issue on the repo. Also it is not maintained anymore. You better can use the main system : https://github.com/deployphp/deployer
GitHub
GitHub - deployphp/deployer: The PHP deployment tool with support f...
The PHP deployment tool with support for popular frameworks out of the box - GitHub - deployphp/deployer: The PHP deployment tool with support for popular frameworks out of the box
ericmp
ericmpOPβ€’12mo ago
i know is not a filament problem, im using non-filament tag the repo link from where im following the instructions uses the same composer package u say so im still having the same issue no idea how to solve it
Tieme
Tiemeβ€’12mo ago
I know, but the code you use in repo https://github.com/lorisleiva/laravel-deployer is 3 years old and uses a old version of deployer.
GitHub
GitHub - lorisleiva/laravel-deployer: πŸš€ Zero-downtime deployment ou...
πŸš€ Zero-downtime deployment out-of-the-box. Contribute to lorisleiva/laravel-deployer development by creating an account on GitHub.
ericmp
ericmpOPβ€’12mo ago
forgot to say: i installed the new version of it, but seems the version isnt the issue i also created from 0 the deploy.php file again using dep init same error appeared i think this is not a problem of the package or the version im using it i think this is something related to ssh connection but i dont understand it, cuz if i do it like this php vendor/deployer/deployer/dep ssh it works just fine
DrByte
DrByteβ€’12mo ago
Your mux_client_request_session does suggest it's an ssh problem. Not sure if it's a muxing issue that turning off muxing would solve, or if the real issue is just "Connection reset by peer" which typically is a result of security credentials failures or firewall blocks. A further complication is that your PC's terminal may be using a different ssh client than that deployer script is using. So it could be that there are handshake protocols supported by your local client that aren't in the packages used to provide ssh connectivity in your deployer script. My first tactic in researching it would likely be to find a way to replicate the complete deploy script using my own raw ssh commands typed at the console, so that I know exactly which ssh tools are being used. That will potentially rule out whatever the deployer script is using for ssh. Another approach would be to turn on verbose mode or some sort of debug logging/output from the deploy-script's ssh client, to get it to tell you more about what happened before the connection was reset: often there are additional warnings provided before the connection is dropped, and discovering those may be the clues you need to get to the root of your issues.
ericmp
ericmpOPβ€’12mo ago
hmm okay ill try all of this, thanks, lets see havent achieved it so far :/ u recommend me any alternatives? i just want to do push and in the server, automatically do pull πŸ€·β€β™‚οΈ (& npm run build & composer install , usual stuff)
DrByte
DrByteβ€’12mo ago
Seems like it's a semi-common issue. Suggestions given include: - disable ssh multiplexing in deployer config - don't use cgywin, switch to bash instead, via WSL - be sure to use latest Deployer version (latest is 7), as some multiplexing bugs were fixed since prior versions https://github.com/deployphp/deployer/issues/1270 https://github.com/deployphp/deployer/discussions/2297
GitHub
Deployer failed complete deploying Β· Issue #1270 Β· deployphp/deploy...
Q A Issue Type Question Deployer Version 5 Local Machine OS Windows-10 Remote Machine OS Debian_8.7(Jessie) Description When trying to deploy, deployer creates the directories properly on remote ma...
GitHub
Connection reset by peer Β· deployphp deployer Β· Discussion #2297
Deployment frequently fails, during any task at any time during the deployment pipeline, with a connection reset by peer message. I have no issues having a PuTTY connection open to the same server ...
ericmp
ericmpOPβ€’12mo ago
thanks πŸ™ ill let u know if i get to do it, let me try this did the trick for me set('ssh_multiplexing', false); thanks a lot again
Want results from more Discord servers?
Add your server