Are any of your service providers modified?
composer update: Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
Hey, I googled a lot, but can't find a solution for my problem.
When I type "composer update" into the terminal, it prints out:
Vincents-MBP:battlerap.club xxx$ composer update
> php artisan clear-compiled
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output:
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--] [<packages>]...
Vincents-MBP:battlerap.club xxx$
I don't have a boostrap/cache/compiled.php - file. Yesterday it works fine, I just added the package:
"pulkitjalan/google-apiclient": "2.*"
But I also tried to remove it with "composer update --no-scripts" but it still don't work. Please help me!
From Berlin, Vincent
@ohffs Yes, yesterday I added this one:
PulkitJalan\Google\GoogleServiceProvider::class
Try removing it - 'artisan' will boot up the framework so any service providers that get called and have an error will cause it to fail every time :-/
@ohffs Removed the packages with "composer update --no-scripts" and removing it from composer.json. Also removed the alias and service provider in config/app.php but same error. :(
Hrm - does 'composer dump-autoload' run ok? If you just run 'php artisan' does it crash?
Vincents-MBP:battlerap.club xxx$ php artisan
Vincents-MBP:battlerap.club xxx$ composer dump-autoload
Generating autoload files
Vincents-MBP:battlerap.club xxx$ php artisan
Vincents-MBP:battlerap.club xxx$ php artisan
Vincents-MBP:battlerap.club xxx$
Nothing. "dump-autoload" changes nothing in my mind - the vendor/autoload.php was not changed - should it? :(
It was just to be extra sure it was artisan that was the problem and not composer :-) Does your site still run ok in the browser?
Yes, still works. But the log also doesn't work, look here: https://laracasts.com/discuss/channels/laravel/dont-create-laravellog - I think it's the same problem... but I can't find it.
Are your storage/ & bootstrap/cache directory writeable by the webserver user?
I think so. Days ago it worked and I changed nothing on the permissions. I'm using MAMP, if it is necessary fyi.
Can do an 'ls -al storage', 'ls -al storage/logs' and 'ls -al bootstrap/cache'?
The log works now.
ls -al storage:
Vincents-MBP:battlerap.club xxx$ ls -al storage
total 16
drwxr-xr-x 8 xxx admin 272 12 Dez 14:28 .
drwxr-xr-x 29 xxx admin 986 12 Dez 15:04 ..
-rwxr-xr-x@ 1 xxx admin 6148 12 Dez 14:30 .DS_Store
drwxr-xr-x 3 xxx admin 102 29 Okt 20:32 app
drwxr-xr-x 4 xxx admin 136 12 Dez 14:30 audio
drwxr-xr-x 7 xxx admin 238 12 Dez 14:30 framework
drwxr-xr-x 4 xxx admin 136 12 Dez 14:30 image
drwxr-xr-x 6 xxx admin 204 12 Dez 15:27 logs
Vincents-MBP:battlerap.club xxx$
ls -al storage/logs:
Vincents-MBP:battlerap.club xxx$ ls -al storage/logs/
total 104
drwxr-xr-x 6 xxx admin 204 12 Dez 15:27 .
drwxr-xr-x 8 xxx admin 272 12 Dez 14:28 ..
-rwxr-xr-x@ 1 xxx admin 6148 12 Dez 14:36 .DS_Store
-rwxr-xr-x 1 xxx admin 14 1 Okt 13:00 .gitignore
-rwxr-xr-x 1 xxx admin 40041 12 Dez 15:29 laravel-2015-12-12.log
-rwxr-xr-x 1 xxx admin 0 12 Dez 14:37 laravel.log
ls -al bootstrap/cache
Vincents-MBP:battlerap.club xxx$ ls -al bootstrap/cache/
total 32
drwxr-xr-x 4 xxx admin 136 12 Dez 13:14 .
drwxr-xr-x 5 xxx admin 170 12 Dez 13:12 ..
-rwxr-xr-x 1 xxx admin 14 1 Okt 13:00 .gitignore
-rwxr-xr-x 1 xxx admin 11702 12 Dez 15:07 services.json
Does 'php artisan' run ok now? I see in your other thread you changed the directory permissions?
@ohffs php artisan doesn't work... the log-file works now (I did something wrong, my mistake), but not "php artisan". :( I've absolutely no idea.
I removed all service providers in config/app.php. But was it correctly how I did it?:
- classes removed in providers- & aliases - Array in config/app.php
- remove packages from composer.json
- composer update --no-scripts (remove the packages)
- php artisan clear-compiled (nothing happens, no output)
- php artisan optimize (nothing happens, no output)
Doesn't work.
I'm totally helpless..
Is your code in a git repo? You could try stepping back a few commits until you find one where it works and then see what changed afterwards? And just to be extra sure - can you try 'cat artisan' just to make sure it's still what it should be?
cat artisan:
Vincents-MBP:battlerap.club xxx$ cat artisan
#!/usr/bin/env php
<?php
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running. We will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/
$kernel->terminate($input, $status);
exit($status);
Vincents-MBP:battlerap.club xxx$
No its not in a repo.
Ah.
Maybe try removing (or just renaming) the 'vendor' folder and re-running composer install? If that doesn't fix things then it's maybe something in your app/Providers - though it's odd that your app still runs ok in the browser.
Doesn't work... I'm giving up for now, maybe I'll try it later. Arghh. If someone has got any idea, please let me know. Thanks.
@vnc00 what about manually deleting the services.json in bootstrap/cache (not using artisan clear-compiled) ?
Hope you get this sorted. I hope this gets fixed in 5.2 because it has happened to me before when I deployed to forge because it seems whenever you add to your providers, the composer update will fail because the framework is booted to run the clear-compiled command.
Keep us posted! :)
@StormShadow I already deleted the services.json manually, without success.
Hope so. Thanks. :)
Hey,
I have exactly the same problem and also no Idea how to fix that.. typing php artisan in console returns nothing and composer update / install returns same error after some steps. -> Script php artisan clear-compiled handling the post-install-cmd event returned with an error
I just want to follow this conversation :)
Anyone who's another idea? I really need this to fix!
Same here
Worked for me:
After updating composer.jsonper the upgrade guide, to get all updated repo's:
composer update --no-scripts
Then: composer dump-autoload -o
Then, I ran an update again so my pre/post update scripts can run: composer update
App loads in browser and all my tests pass again using 5.2. Hope this helps.
Same issue here.
Same here!
Same here....
i had fixed this problem
Removed the bootstrap/cache/config.php file.
composer dumpautoload
composer update.
It's may work for you.
I get this error whenever I try to run composer update and don't have my Web Server and Database Server up and running.
@balasubramani thanks, you saved me from insanity.
Please or to participate in this conversation.