V8-archive: Fatal error: Interface 'Monolog\ResettableInterface' not found

Created on 10 Nov 2018  路  6Comments  路  Source: directus/v8-archive

Bug Report

Steps to Reproduce

  1. Install the API via GIT (git clone -b build https://github.com/directus/api.git)
  2. Create config/api.php and enter database credentials
  3. Create a Directus app installation and configure to use above API
  4. Create a test collection i.e. blog_posts
  5. Create an item in blog_posts
  6. Call GET https://www.example.com/_/items/blog_posts/1 to fetch the record

API is installed in /var/www/api and apache config file points to /var/www/api/public
APP is installed in /var/www/app and apache config file points to /var/www/app

The App installation works as expected and can interact with API.
Direct API access fails via Postman or curl request via custom web app

Expected Behavior

Successful API response with blog_posts record with id 1

Actual Behavior

Fatal error in PHP

Warning: include(/var/www/api/vendor/composer/../monolog/monolog/src/Monolog/ResettableInterface.php): failed to open stream: No such file or directory in /var/www/api/vendor/composer/ClassLoader.php on line 444

Warning: include(): Failed opening '/var/www/api/vendor/composer/../monolog/monolog/src/Monolog/ResettableInterface.php' for inclusion (include_path='.:/usr/share/php') in /var/www/api/vendor/composer/ClassLoader.php on line 444

Fatal error: Interface 'Monolog\ResettableInterface' not found in /var/www/api/vendor/monolog/monolog/src/Monolog/Logger.php on line 28

Other Context & Screenshots

api/vendor/monolog/monolog/src/Monolog/ResettableInterface.php is not present, hence the Fatal Error.

If I remove any reference of ResettableInterface from monolog the API calls become successful

(bold text deleted)
monolog/monolog/src/Monolog/Handler/AbstractHandler.php
abstract class AbstractHandler implements HandlerInterface, ResettableInterface

monolog/monolog/src/Monolog/Logger.php
class Logger implements LoggerInterface, ResettableInterface

Technical Details

  • Device: n/a
  • OS: Ubuntu 16.04
  • Web Server: Apache 2.4.37
  • PHP Version: 7.2
  • Database: MySQL 5.7
  • Install Method: cloned build branch
bug help wanted

Most helpful comment

As a temp fix, I have grabbed the missing file from
https://github.com/Seldaek/monolog/blob/master/src/Monolog/ResettableInterface.php

And manually dropped in my installation here:
/vendor/monolog/monolog/src/Monolog/

This will get the API working

Simon

All 6 comments

+1

+1

Thank you everyone... our API Lead is away on vacation for a few days, but we'll get this resolved ASAP!

If this is only happening on the build version then perhaps composer failed to install that dependency during our release process?

@rijkvanzanten would that make sense?

The message No such file or directory in /var/www/api/vendor/composer/ClassLoader.php does make me suspect that something went wrong during the creation of the vendor folder for the build version.. I'll try to confirm this before the end of the day

As a temp fix, I have grabbed the missing file from
https://github.com/Seldaek/monolog/blob/master/src/Monolog/ResettableInterface.php

And manually dropped in my installation here:
/vendor/monolog/monolog/src/Monolog/

This will get the API working

Simon

This commit https://github.com/directus/api/commit/9a87c4953e47c6ebd664e96dec325b4365dab647 seems to fix the issue for me.

The dependency was added, as can be seen here.

Thanks @rijkvanzanten

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benhaynes picture benhaynes  路  4Comments

rijkvanzanten picture rijkvanzanten  路  3Comments

metalmarco picture metalmarco  路  3Comments

chintohere picture chintohere  路  3Comments

cdwmhcc picture cdwmhcc  路  3Comments