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
Successful API response with blog_posts record with id 1
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
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
build branch+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
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