cerebrate-project / cerebrate

Cerebrate is an open-source platform meant to act as a trusted contact information provider and interconnection orchestrator for other security tools.
https://www.cerebrate-project.org/
GNU Affero General Public License v3.0
83 stars 16 forks source link

Installation issues using the install.md #75

Closed drizzit56 closed 3 years ago

drizzit56 commented 3 years ago

Installation fails at numerous places

OS Ubuntu 20.04 PHP version 7.4 Compose version 1 + (2 manually installed)

When installing the application on Ubuntu 20.04:

All goes well until the Run composer stage

cd /var/www/cerebrate sudo -u www-data composer install

Two issues with Composer

1) composer cannot cache and gives errors:

Cannot create cache directory /var/www/.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /var/www/.composer/cache/files/, or directory is not writable. Proceeding without cache

This can be easily fixed or ignored by fixing permisssions on the /var/html/ folder

2) If this is fixed still get more errors about Composer 1 being deprecated and the install just eventually times out:

Loading composer repositories with package information
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Updating dependencies (including require-dev)
Killed

Upgrading to version 2 of Composer manually as repos on ubuntu do not have this, gets up past this part however then gives the error listed in #33 which leads me to think that maybe something has changed on Composer side?

After installing with Composer 2 and using the rest of the guide the application then has more errors when you try and login to the system:

Thu Oct 28 17:49:23.028842 2021] [php7:warn] [pid 67064] [client X.X.X.X:50794] PHP Warning:  file_put_contents(/var/www/cerebrate/logs/error.log) [<a href='https://secure.php.net/function.file-put-contents'>function.file-put-contents</a>]: failed to open stream: No such file or directory in /var/www/cerebrate/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140, referer: http://X.X.X.X:8000/users/login?redirect=%2F

Which points to the application expecting a logs folder in the /var/www/cerebrate file, after manually adding this for testing purposes i was able to find these errors being pushed to an errors.log in the webroot logs folder mentioned previously:

cat /var/www/cerebrate/logs/error.log 
2021-10-28 18:06:37 warning: Warning (2): in_array() expects parameter 2 to be array, null given in [/var/www/cerebrate/src/Controller/Component/Navigation/sidemenu.php, line 130]
Request URL: /users/login
Referer URL: http://cerebrate.local/users/login?redirect=%2F
Client IP: X.X.X.X
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 185
in_array - [internal], line ??
SidemenuNavigation\Sidemenu::get() - APP/Controller/Component/Navigation/sidemenu.php, line 130
App\Controller\Component\NavigationComponent::getSideMenu() - APP/Controller/Component/NavigationComponent.php, line 53
App\Controller\Component\ACLComponent::getMenu() - APP/Controller/Component/ACLComponent.php, line 458
App\Controller\AppController::beforeFilter() - APP/Controller/AppController.php, line 115
Cake\Event\EventManager::_callListener() - CORE/src/Event/EventManager.php, line 309
Cake\Event\EventManager::dispatch() - CORE/src/Event/EventManager.php, line 286
Cake\Controller\Controller::dispatchEvent() - CORE/src/Event/EventDispatcherTrait.php, line 92
Cake\Controller\Controller::startupProcess() - CORE/src/Controller/Controller.php, line 632
Cake\Controller\ControllerFactory::handle() - CORE/src/Controller/ControllerFactory.php, line 130
Cake\Controller\ControllerFactory::invoke() - CORE/src/Controller/ControllerFactory.php, line 115
Cake\Http\BaseApplication::handle() - CORE/src/Http/BaseApplication.php, line 317
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 77
Cake\Http\Middleware\BodyParserMiddleware::process() - CORE/src/Http/Middleware/BodyParserMiddleware.php, line 162
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Authentication\Middleware\AuthenticationMiddleware::process() - ROOT/vendor/cakephp/authentication/src/Middleware/AuthenticationMiddleware.php, line 124
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 77
Cake\Http\Middleware\CsrfProtectionMiddleware::process() - CORE/src/Http/Middleware/CsrfProtectionMiddleware.php, line 174
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Http\Runner::run() - CORE/src/Http/Runner.php, line 58
Cake\Routing\Middleware\RoutingMiddleware::process() - CORE/src/Routing/Middleware/RoutingMiddleware.php, line 167
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Routing\Middleware\AssetMiddleware::process() - CORE/src/Routing/Middleware/AssetMiddleware.php, line 68
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Error\Middleware\ErrorHandlerMiddleware::process() - CORE/src/Error/Middleware/ErrorHandlerMiddleware.php, line 126
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Http\Runner::run() - CORE/src/Http/Runner.php, line 58
Cake\Http\Server::run() - CORE/src/Http/Server.php, line 90
[main] - ROOT/webroot/index.php, line 40

2021-10-28 18:06:37 warning: Warning (2): in_array() expects parameter 2 to be array, null given in [/var/www/cerebrate/src/Controller/Component/Navigation/sidemenu.php, line 142]
Request URL: /users/login
Referer URL: http://cerebrate.local/users/login?redirect=%2F
Client IP: X.X.X.X
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 185
in_array - [internal], line ??
SidemenuNavigation\Sidemenu::get() - APP/Controller/Component/Navigation/sidemenu.php, line 142
App\Controller\Component\NavigationComponent::getSideMenu() - APP/Controller/Component/NavigationComponent.php, line 53
App\Controller\Component\ACLComponent::getMenu() - APP/Controller/Component/ACLComponent.php, line 458
App\Controller\AppController::beforeFilter() - APP/Controller/AppController.php, line 115
Cake\Event\EventManager::_callListener() - CORE/src/Event/EventManager.php, line 309
Cake\Event\EventManager::dispatch() - CORE/src/Event/EventManager.php, line 286
Cake\Controller\Controller::dispatchEvent() - CORE/src/Event/EventDispatcherTrait.php, line 92
Cake\Controller\Controller::startupProcess() - CORE/src/Controller/Controller.php, line 632
Cake\Controller\ControllerFactory::handle() - CORE/src/Controller/ControllerFactory.php, line 130
Cake\Controller\ControllerFactory::invoke() - CORE/src/Controller/ControllerFactory.php, line 115
Cake\Http\BaseApplication::handle() - CORE/src/Http/BaseApplication.php, line 317
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 77
Cake\Http\Middleware\BodyParserMiddleware::process() - CORE/src/Http/Middleware/BodyParserMiddleware.php, line 162
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Authentication\Middleware\AuthenticationMiddleware::process() - ROOT/vendor/cakephp/authentication/src/Middleware/AuthenticationMiddleware.php, line 124
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 77
Cake\Http\Middleware\CsrfProtectionMiddleware::process() - CORE/src/Http/Middleware/CsrfProtectionMiddleware.php, line 174
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Http\Runner::run() - CORE/src/Http/Runner.php, line 58
Cake\Routing\Middleware\RoutingMiddleware::process() - CORE/src/Routing/Middleware/RoutingMiddleware.php, line 167
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Routing\Middleware\AssetMiddleware::process() - CORE/src/Routing/Middleware/AssetMiddleware.php, line 68
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Error\Middleware\ErrorHandlerMiddleware::process() - CORE/src/Error/Middleware/ErrorHandlerMiddleware.php, line 126
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Http\Runner::run() - CORE/src/Http/Runner.php, line 58
Cake\Http\Server::run() - CORE/src/Http/Server.php, line 90
[main] - ROOT/webroot/index.php, line 40

2021-10-28 18:06:37 warning: Warning (2): in_array() expects parameter 2 to be array, null given in [/var/www/cerebrate/src/Controller/Component/ACLComponent.php, line 302]
Request URL: /users/login
Referer URL: http://cerebrate.local/users/login?redirect=%2F
Client IP: X.X.X.X
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 185
in_array - [internal], line ??
App\Controller\Component\ACLComponent::checkAccessUrl() - APP/Controller/Component/ACLComponent.php, line 302
App\Controller\Component\ACLComponent::getMenu() - APP/Controller/Component/ACLComponent.php, line 464
App\Controller\AppController::beforeFilter() - APP/Controller/AppController.php, line 115
Cake\Event\EventManager::_callListener() - CORE/src/Event/EventManager.php, line 309
Cake\Event\EventManager::dispatch() - CORE/src/Event/EventManager.php, line 286
Cake\Controller\Controller::dispatchEvent() - CORE/src/Event/EventDispatcherTrait.php, line 92
Cake\Controller\Controller::startupProcess() - CORE/src/Controller/Controller.php, line 632
Cake\Controller\ControllerFactory::handle() - CORE/src/Controller/ControllerFactory.php, line 130
Cake\Controller\ControllerFactory::invoke() - CORE/src/Controller/ControllerFactory.php, line 115
Cake\Http\BaseApplication::handle() - CORE/src/Http/BaseApplication.php, line 317
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 77
Cake\Http\Middleware\BodyParserMiddleware::process() - CORE/src/Http/Middleware/BodyParserMiddleware.php, line 162
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Authentication\Middleware\AuthenticationMiddleware::process() - ROOT/vendor/cakephp/authentication/src/Middleware/AuthenticationMiddleware.php, line 124
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 77
Cake\Http\Middleware\CsrfProtectionMiddleware::process() - CORE/src/Http/Middleware/CsrfProtectionMiddleware.php, line 174
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Http\Runner::run() - CORE/src/Http/Runner.php, line 58
Cake\Routing\Middleware\RoutingMiddleware::process() - CORE/src/Routing/Middleware/RoutingMiddleware.php, line 167
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Routing\Middleware\AssetMiddleware::process() - CORE/src/Routing/Middleware/AssetMiddleware.php, line 68
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Error\Middleware\ErrorHandlerMiddleware::process() - CORE/src/Error/Middleware/ErrorHandlerMiddleware.php, line 126
Cake\Http\Runner::handle() - CORE/src/Http/Runner.php, line 73
Cake\Http\Runner::run() - CORE/src/Http/Runner.php, line 58
Cake\Http\Server::run() - CORE/src/Http/Server.php, line 90
[main] - ROOT/webroot/index.php, line 40

2021-10-28 18:06:37 error: [TypeError] Return value of App\Controller\Component\ACLComponent::checkAccessUrl() must be of the type bool, null returned in /var/www/cerebrate/src/Controller/Component/ACLComponent.php on line 302
Stack Trace:
- /var/www/cerebrate/src/Controller/Component/ACLComponent.php:464
- /var/www/cerebrate/src/Controller/AppController.php:115
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Event/EventManager.php:309
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Event/EventManager.php:286
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php:92
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Controller/Controller.php:632
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php:130
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php:115
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/BaseApplication.php:317
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Runner.php:77
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php:162
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /var/www/cerebrate/vendor/cakephp/authentication/src/Middleware/AuthenticationMiddleware.php:124
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Runner.php:77
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php:174
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Runner.php:58
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php:167
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php:68
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php:126
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Runner.php:58
- /var/www/cerebrate/vendor/cakephp/cakephp/src/Http/Server.php:90
- /var/www/cerebrate/webroot/index.php:40

Request URL: /users/login
Referer URL: http://cerebrate.local/users/login?redirect=%2F
Client IP: X.X.X.X

I have this running on a number of different machines at various stages of the install process sop if i can give any more information feel free to ask.

drizzit56 commented 3 years ago

Thanks @DocArmoryTech this fixes my issue