snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Call to undefined method Monolog\Logger::useFiles()

Open stbr4 opened this issue 7 years ago • 5 comments

Hi,

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

Describe the bug I'm trying to import Assets using php artisan snipeit:import which causes an exception:

In Logger.php line 273:
                                                           
  [Symfony\Component\Debug\Exception\FatalThrowableError]  
  Call to undefined method Monolog\Logger::useFiles() 

Importing the same csv file via the web interface works.

To Reproduce Steps to reproduce the behavior:

on the cli: php artisan snipeit:import --verbose /tmp/tst.csv

Server (please complete the following information):

  • Snipe-IT Version: latest develop branch e40a5a7
  • OS: Debian Buster
  • Web Server: Apache
  • PHP Version: PHP 7.3.4-2 (cli) (built: Apr 13 2019 19:05:48) ( NTS )

Error Messages

# php artisan snipeit:import --verbose  /tmp/tst.csv 

In Logger.php line 273:
                                                           
  [Symfony\Component\Debug\Exception\FatalThrowableError]  
  Call to undefined method Monolog\Logger::useFiles()      
                                                           

Exception trace:
 () at /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/Logger.php:273
 Illuminate\Log\Logger->__call() at /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:581
 Illuminate\Log\LogManager->__call() at /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:237
 Illuminate\Support\Facades\Facade::__callStatic() at /var/www/snipe-it/app/Console/Commands/ObjectImportCommand.php:59
 App\Console\Commands\ObjectImportCommand->handle() at n/a:n/a
 call_user_func_array() at /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87
 Illuminate\Container\BoundMethod::callBoundMethod() at /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31
 Illuminate\Container\BoundMethod::call() at /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/Container.php:572
 Illuminate\Container\Container->call() at /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Console/Command.php:183
 Illuminate\Console\Command->execute() at /var/www/snipe-it/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Console/Command.php:170
 Illuminate\Console\Command->run() at /var/www/snipe-it/vendor/symfony/console/Application.php:908
 Symfony\Component\Console\Application->doRunCommand() at /var/www/snipe-it/vendor/symfony/console/Application.php:269
 Symfony\Component\Console\Application->doRun() at /var/www/snipe-it/vendor/symfony/console/Application.php:145
 Symfony\Component\Console\Application->run() at /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Console/Application.php:89
 Illuminate\Console\Application->run() at /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:122
 Illuminate\Foundation\Console\Kernel->handle() at /var/www/snipe-it/artisan:35

Additional context

  • Is this a fresh install or an upgrade? fresh install
  • What OS and web server you're running Snipe-IT on Debian Buster, Apache 2.4.38
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) Manual installation https://www.techrepublic.com/article/how-to-install-the-asset-manager-snipe-it-on-ubuntu-server/
  • Include what you've done so far in the installation, and if you got any error messages along the way. I just played around a bit in the web interface and imported assets there.
  • Indicate whether or not you've manually edited any data directly in the database I restored the db a couple of times from a sql dump while testing the import feature in the web interface.

Add any other context about the problem here.

While searching, i found a bugreport which might be related: https://github.com/stevegrunwell/lost-in-translation/issues/6

Regards, Stefan

stbr4 avatar May 17 '19 08:05 stbr4

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Jul 16 '19 08:07 stale[bot]

This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.

stale[bot] avatar Jul 23 '19 08:07 stale[bot]

This is still an issue. I am getting the same error on Snipe-It v5.0.5-pre build 5457, PHP 7.2.24.

# php artisan snipeit:import --item-type user --verbose --logfile ~/importer.log --update /home/myuser/user_test.csv 

In Logger.php line 273:
                                                           
  [Symfony\Component\Debug\Exception\FatalThrowableError]  
  Call to undefined method Monolog\Logger::useFiles()      
                                                           

Exception trace:
  at /opt/inventory/vendor/laravel/framework/src/Illuminate/Log/Logger.php:273
 Illuminate\Log\Logger->__call() at /opt/inventory/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:630
 Illuminate\Log\LogManager->__call() at /opt/inventory/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261
 Illuminate\Support\Facades\Facade::__callStatic() at /opt/inventory/app/Console/Commands/ObjectImportCommand.php:59
 App\Console\Commands\ObjectImportCommand->handle() at n/a:n/a
 call_user_func_array() at /opt/inventory/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32
 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /opt/inventory/vendor/laravel/framework/src/Illuminate/Container/Util.php:36
 Illuminate\Container\Util::unwrapIfClosure() at /opt/inventory/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:90
 Illuminate\Container\BoundMethod::callBoundMethod() at /opt/inventory/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:34
 Illuminate\Container\BoundMethod::call() at /opt/inventory/vendor/laravel/framework/src/Illuminate/Container/Container.php:590
 Illuminate\Container\Container->call() at /opt/inventory/vendor/laravel/framework/src/Illuminate/Console/Command.php:134
 Illuminate\Console\Command->execute() at /opt/inventory/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /opt/inventory/vendor/laravel/framework/src/Illuminate/Console/Command.php:121
 Illuminate\Console\Command->run() at /opt/inventory/vendor/symfony/console/Application.php:1001
 Symfony\Component\Console\Application->doRunCommand() at /opt/inventory/vendor/symfony/console/Application.php:271
 Symfony\Component\Console\Application->doRun() at /opt/inventory/vendor/symfony/console/Application.php:147
 Symfony\Component\Console\Application->run() at /opt/inventory/vendor/laravel/framework/src/Illuminate/Console/Application.php:93
 Illuminate\Console\Application->run() at /opt/inventory/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:131
 Illuminate\Foundation\Console\Kernel->handle() at /opt/inventory/artisan:35

Looking at https://github.com/stevegrunwell/lost-in-translation/issues/6 referenced above, it is mentioned that:

The new logging method (using Monolog) doesn't allow for changing the file "on the fly" anymore.

I also cannot find the method useFiles in the source code for Monolog\Logger.

What can be done to fix this, @snipe ?

kearneymo avatar Nov 06 '20 16:11 kearneymo

I'm also getting this error in v5.0.6 - build 5526

PauloFreire70 avatar Nov 13 '20 15:11 PauloFreire70

@PauloFreire70 I opened https://github.com/snipe/snipe-it/issues/8740 since this issue was already closed.

kearneymo avatar Nov 13 '20 20:11 kearneymo