Snipe-it: Composer config Error: Class log does not exist' in /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container.php:734

Created on 27 Jul 2016  路  6Comments  路  Source: snipe/snipe-it

Expected Behavior (or desired behavior if a feature request)

Run: php composer.phar install --no-dev --prefer-source
To: Installing and configuring composer


Actual Behavior

(what actually happens goes here)

Generating autoload files

php artisan clear-compiled
PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Class log does not exist' in /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container.php:734
Stack trace:

0 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container. php(734): ReflectionClass->__construct('log')

1 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container. php(629): Illuminate\Container\Container->build('log', Array)

2 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Applicati on.php(697): Illuminate\Container\Container->make('log', Array)

3 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container. php(849): Illuminate\Foundation\Application->make('Psr\Log\LoggerI...')

4 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container. php(804): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))

5 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container. php(775): Illuminate\Container\Con in /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 734

Script php artisan clear-compiled handling the post-install-cmd event returned with error code 255

Please confirm you have done the following before posting your bug report:


Please provide answers to these questions before posting your bug report:

  • Version of Snipe-IT you're running

    V3; I cloned it yestarday, by git clone https://github.com/snipe/snipe-it

  • What OS and web server you're running Snipe-IT on

    Ubuntu server 14.04.4 LTS

  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)

    manual installation, but I reference to the install.sh and the day before yesterday I tried use install.sh, same error.(I have )

  • If a stacktrace is provided in the error, include that too.

php artisan clear-compiled
PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Class log does not exist' in /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container.php:734
Stack trace:

0 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container. php(734): ReflectionClass->__construct('log')

1 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container. php(629): Illuminate\Container\Container->build('log', Array)

2 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Applicati on.php(697): Illuminate\Container\Container->make('log', Array)

3 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container. php(849): Illuminate\Foundation\Application->make('Psr\Log\LoggerI...')

4 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container. php(804): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))

5 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container. php(775): Illuminate\Container\Con in /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 734

Script php artisan clear-compiled handling the post-install-cmd event returned with error code 255

  • Include any additional information you can find in app/storage/logs and your webserver's logs.

none

  • Include what you've done so far in the installation, and if you got any error messages along the way.

this is the first error i encountered

  • Indicate whether or not you've manually edited any data directly in the database
    no

Appreciate it if anyone can help me out.

-Simon

not a bug

Most helpful comment

Can you check and make sure there is no extra whitespace in your .env file? No trailing spaces, no empty lines at the bottom, etc. Also check that anything in double or single quotes there has the appropriate closing quotes. We usually see this when something is donked in the .env file

All 6 comments

Can you check and make sure there is no extra whitespace in your .env file? No trailing spaces, no empty lines at the bottom, etc. Also check that anything in double or single quotes there has the appropriate closing quotes. We usually see this when something is donked in the .env file

@snipe Great! Thanks for your suggestions. Yes, I did make a mistakes on .env file.
On "MAIL_FROM_NAME" setting field, I should write as 'Asset Admin'. At first i forgot to use quotes.

Thanks again.

Thanks for letting us know that worked. I've updated the documentation so that others may benefit:
https://snipe-it.readme.io/v3.0/docs/common-issues#fatal-error-uncaught-exception-reflectionexception

@snipe One thing that could be done to avoid this issue would be for the .env.example file's MAIL_FROM_NAME entry to have a name with space and quotes to indicate quotes being necessary.

By that I mean instead of:
MAIL_FROM_NAME=Snipe-IT

It could be set to this:
MAIL_FROM_NAME='Snipe-IT Asset Management'

I ran into this issue myself and resolved it the same way @WaGuan did.

screen shot 2018-07-06 at 11 31 56 am

Can anyone help me with this error in webhost. I checked the db name and and username, it isn't a problem.

@annsmarmalarki Hi there - this issue is closed. Please create a new issue and fill in all of the questions in the new issue form. (When you reply to old, closed threads, it sends an email notification to everyone who ever participated in it, which can be pretty annoying to have happen on a thread that's been resolved for a while.)

You'll need to check that anything with spaces or special characters in it is enclosed in quotes in your .env (not just the db username/password), per the documentation. https://snipe-it.readme.io/docs/installation-issues#section-fatal-error-uncaught-exception-reflectionexception-with-message-class-log-does-not-exist

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mauroaltamura picture mauroaltamura  路  5Comments

WELLBOREIS picture WELLBOREIS  路  3Comments

Supsuop picture Supsuop  路  4Comments

alextheberge picture alextheberge  路  4Comments

snipe picture snipe  路  5Comments