-1

I am trying to run Deployer to deploy my project. But got problem with Composer.

Is it possible to any one to look this error code and give any idea what is wrong?

I am getting this error

➤ Executing task deploy:vendors
[whocallme.uk] > if hash unzip 2>/dev/null; then echo 'true'; fi
[whocallme.uk] < true
[whocallme.uk] > if hash composer 2>/dev/null; then echo 'true'; fi
[whocallme.uk] < true
[whocallme.uk] > command -v 'composer' || which 'composer' || type -p 'composer'
[whocallme.uk] < /usr/local/bin/composer
[whocallme.uk] > cd /var/www/whocallme.uk/html/releases/1 && /usr/local/bin/composer install --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader --no-suggest
[whocallme.uk] < You are using the deprecated option "--no-suggest". It has no effect and will break in Composer 3.
[whocallme.uk] < Installing dependencies from lock file
[whocallme.uk] < Verifying lock file contents can be installed on current platform.
[whocallme.uk] < Dependency resolution completed in 0.000 seconds
[whocallme.uk] < Package operations: 70 installs, 0 updates, 0 removals
[whocallme.uk] < Installs: voku/portable-ascii:1.5.6, symfony/polyfill-php80:v1.22.0, symfony/polyfill-mbstring:v1.22.0, symfony/polyfill-ctype:v1.22.0, phpoption/phpoption:1.7.5, graham-campbell/result-type:v1.0.1, vlucas/phpdotenv:v5.3.0, symfony/css-selector:v5.2.3, tijsverkoyen/css-to-inline-styles:2.2.3, symfony/var-dumper:v5.2.3, symfony/deprecation-contracts:v2.2.0, symfony/routing:v5.2.3, symfony/process:v5.2.3, symfony/polyfill-php72:v1.22.0, symfony/polyfill-intl-normalizer:v1.22.0, symfony/polyfill-intl-idn:v1.22.0, symfony/mime:v5.2.3, symfony/polyfill-php73:v1.22.0, symfony/http-foundation:v5.2.3, symfony/http-client-contracts:v2.3.1, psr/event-dispatcher:1.0.0, symfony/event-dispatcher-contracts:v2.2.0, symfony/event-dispatcher:v5.2.3, psr/log:1.1.3, symfony/error-handler:v5.2.3, symfony/http-kernel:v5.2.3, symfony/finder:v5.2.3, symfony/polyfill-intl-grapheme:v1.22.0, symfony/string:v5.2.3, psr/container:1.0.0, symfony/service-contracts:v2.2.0, symfony/console:v5.2.3, symfony/polyfill-iconv:v1.22.0, doctrine/lexer:1.2.1, egulias/email-validator:2.1.25, swiftmailer/swiftmailer:v6.2.5, ramsey/collection:1.1.3, brick/math:0.9.2, ramsey/uuid:4.1.1, psr/simple-cache:1.0.1, opis/closure:3.6.1, symfony/translation-contracts:v2.3.0, symfony/translation:v5.2.3, nesbot/carbon:2.44.0, monolog/monolog:2.2.0, league/mime-type-detection:1.7.0, league/flysystem:1.1.3, league/commonmark:1.5.7, webmozart/assert:1.9.1, dragonmantank/cron-expression:v3.1.0, doctrine/inflector:2.0.3, laravel/framework:v8.26.1, psr/http-message:1.0.1, psr/http-client:1.0.1, ralouphie/getallheaders:3.0.3, guzzlehttp/psr7:1.7.0, guzzlehttp/promises:1.4.0, guzzlehttp/guzzle:7.2.0, anhskohbo/no-captcha:3.3.0, fideloper/proxy:4.4.1, asm89/stack-cors:v2.0.2, fruitcake/laravel-cors:v2.0.3, nikic/php-parser:v4.10.4, dnoegel/php-xdg-base-dir:v0.1.1, psy/psysh:v0.10.6, laravel/tinker:v2.6.0, laravel/ui:v3.2.0, spatie/laravel-honeypot:3.0.1, erusev/parsedown:1.7.4, laravelista/comments:4.4.1
[whocallme.uk] <   - Installing voku/portable-ascii (1.5.6): Extracting archive
................................................................
[whocallme.uk] <   - Installing erusev/parsedown (1.7.4): Extracting archive
[whocallme.uk] <   - Installing laravelista/comments (4.4.1): Extracting archive
[whocallme.uk] < Generating optimized autoload files
[whocallme.uk] < > post-autoload-dump: Illuminate\Foundation\ComposerScripts::postAutoloadDump
[whocallme.uk] < > post-autoload-dump: @php artisan package:discover --ansi
[whocallme.uk] < In Compiler.php line 36:
[whocallme.uk] <
[whocallme.uk] <   Please provide a valid cache path.
[whocallme.uk] < Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
➤ Executing task deploy:failed
• done on [whocallme.uk]
✔ Ok [0ms]
➤ Executing task deploy:unlock
[whocallme.uk] > rm -f /var/www/whocallme.uk/html/.dep/deploy.lock
• done on [whocallme.uk]
✔ Ok [64ms]

In Client.php line 103:

  [Deployer\Exception\RuntimeException (1)]
  The command "cd /var/www/whocallme.uk/html/releases/1 && /usr/local/bin/composer install --verbose --prefer-dist --no-progress --no-interactio
  n --no-dev --optimize-autoloader --no-suggest" failed.

  Exit Code: 1 (General error)

  Host Name: whocallme.uk

  ================
  You are using the deprecated option "--no-suggest". It has no effect and will break in Composer 3.
  Installing dependencies from lock file
  Verifying lock file contents can be installed on current platform.
  Dependency resolution completed in 0.000 seconds
  Package operations: 70 installs, 0 updates, 0 removals
  
        .   . . .    .      .      .      .      .      .     . . . . 
    - Installing laravelista/comments (4.4.1): Extracting archive
 Generating optimized autoload files
  > post-autoload-dump: Illuminate\Foundation\ComposerScripts::postAutoloadDump
  > post-autoload-dump: @php artisan package:discover --ansi
  Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1


Exception trace:
  at phar:///usr/local/bin/dep/src/Ssh/Client.php:103
 Deployer\Ssh\Client->run() at phar:///usr/local/bin/dep
.......

But I am not sure if it is problem with composer...

If there is any idea what can cause this error?

Thank you

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Marcin
  • 173
  • 12

2 Answers2

1

The error message is:

Please provide a valid cache path

Create the following directories under storage/framework to resolve the issue.

  • sessions
  • views
  • cache

A similar cause is discussed in this question/answer.

Nicolai Fröhlich
  • 51,330
  • 11
  • 126
  • 130
  • Nothing help, I got folders and still same error when use deployer, but when I copy by ftp very thing works fine. – Marcin Feb 08 '21 at 08:14
0

I think some files or folders are missing. When I did FTP to server all OK. But when try git and deployer something is missing. And got this error when I try run composer update.

  Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   InvalidArgumentException

  Please provide a valid cache path.

  at vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php:36
     32▕      */
     33▕     public function __construct(Filesystem $files, $cachePath)
     34▕     {
     35▕         if (! $cachePath) {
  ➜  36▕             throw new InvalidArgumentException('Please provide a valid cache path.');
     37▕         }
     38▕
     39▕         $this->files = $files;
     40▕         $this->cachePath = $cachePath;

      +20 vendor frames
  21  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()

      +5 vendor frames
  27  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Marcin
  • 173
  • 12