Deployment issue with gulp and npm
Hi
I have successfully configured a manual pull deployment for my development site. The .cpanel.yml file calls a shell scripts that runs everything. Problem is that gulp and npm do not work. and Abort message with no further explanation is all that I get. My .cpanel.yml file looks like this and is working correctly:
deploy.sh contains all the necessary commands to build the site. The script works correctly. If executed from the command line it correctly executes all commands with no error but when executed form the cPanel UI by means of the "Deploy HEAD Commit" button inside the "Git Version Control" Page, it always abort gulp and/or npm commands with no further error message. The contents of the deploy.sh script is:
All composer and artisan commands work correctly, however gulp and npm does not. (I had to comment the npm install line). The output of the log file is as follows:
Wonder if this could be a memory restriction issue with jailshell or some other kind of restriction. I will be very grateful if you can point me out the probable cause of this behaviour and a possible solution. Thanks
---
deployment:
tasks:
- ~/plsapp/deploy.sh 2>&1
#see ~/.cpanel/logs/ for the output of the deploy command
deploy.sh contains all the necessary commands to build the site. The script works correctly. If executed from the command line it correctly executes all commands with no error but when executed form the cPanel UI by means of the "Deploy HEAD Commit" button inside the "Git Version Control" Page, it always abort gulp and/or npm commands with no further error message. The contents of the deploy.sh script is:
#!/bin/bash
set -x
#Deployment script
# Change to the project directory
cd ~/plsapp/
# Turn on maintenance mode
#php artisan down
# Install/update composer dependecies
#composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev
composer install --no-interaction --prefer-dist --optimize-autoloader
composer dump-autoload
# Run database migrations
#php artisan migrate --force
# Run database seeders
#php artisan db:seed --class=NxxxxXxxxxYyy
# Clear caches
php artisan cache:clear
# Clear expired password reset tokens
php artisan auth:clear-resets
# Clear and cache routes
php artisan route:clear
php artisan route:cache
# Clear and cache config
php artisan config:clear
php artisan config:cache
# Clear view
php artisan view:clear;
# Install node modules
#npm install
# Build assets using Laravel Mix
#gulp --scope=all --production
gulp --scope=all
# Turn off maintenance mode
#php artisan up
All composer and artisan commands work correctly, however gulp and npm does not. (I had to comment the npm install line). The output of the log file is as follows:
cat vc_1546571038.39506_git_deploy.log
1546571038.677897724
$ ~/plsapp/deploy.sh 2>&1
+ cd /home/xxxxx/plsapp/
+ composer install --no-interaction --prefer-dist --optimize-autoloader
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
Generating optimized class loader
The compiled services file has been removed.
+ composer dump-autoload
Generating autoload files
+ php artisan cache:clear
Cache cleared successfully.
+ php artisan auth:clear-resets
Expired reset tokens cleared!
+ php artisan route:clear
Route cache cleared!
+ php artisan route:cache
Route cache cleared!
In Route.php line 817:
Unable to prepare route [/] for serialization. Uses Closure.
+ php artisan config:clear
Configuration cache cleared!
+ php artisan config:cache
Configuration cache cleared!
Configuration cached successfully!
+ php artisan view:clear
Compiled views cleared!
+ gulp --scope=all
[14:04:11] Using gulpfile ~/plsapp/gulpfile.js
[14:04:11] Starting 'all'...
[14:04:11] Starting 'webpack'...
/home/xxxxx/plsapp/deploy.sh: line 45: 13251 Aborted gulp --scope=all
Task completed with exit code 134.
1546571051.68816
Build completed with exit code 134
Wonder if this could be a memory restriction issue with jailshell or some other kind of restriction. I will be very grateful if you can point me out the probable cause of this behaviour and a possible solution. Thanks
-
I though that this could be a memory restriction associated with jailed shell or some other kind of restriction, but switching the account to normal shell showed the same behaviour. I will be very grateful if you can point me out the probable cause of this behaviour and a possible solution. Thanks 0 -
SOLVED: Yes I was right this is a memory issue. I just changed the "Max cPanel process memory" in the "Tweak Settings" page from the default of 768 MB to 2000 MB and that did the trick. However I would like to know if this fix will have any repercussions on sites performance (currently we are hosting around 20 different sites in the same server). Thanks 0 -
Hello @jlrueda, Can you verify which cPanel & WHM version is installed on the affected system? You can check with the following command: cat /usr/local/cpanel/version
In version 76, a case was published to address an issue similar to what you reported: Fixed case CPANEL-22645: Fix memory limits for shells spawned within cPanel. Also, can you verify if WHM >> Shell Fork Bomb Protection is enabled on this system? Thank you.0
Please sign in to leave a comment.
Comments
3 comments