Can not create admin User

Hi,

I installed passbolt with this guide. Everythings works fine until the creation of the admin. I run:
su -s /bin/bash -c "app/Console/cake passbolt register_user -u admin@passbolt.dev -f ada -l lovelace -r admin" www-data

or

`app/Console/cake passbolt register_user -u admin@passbolt.dev -f ada -l lovelace -r admin`

but it’s not working. If I run the first statement I get a lot of these errors/warnings:

PHP Warning: file_put_contents(/var/www/passbolt/app/tmp/logs/error.log): failed to open stream: Permission denied in /var/www/passbolt/lib/Cake/Log/Engine/FileLog.php on line 142
2017-12-01 10:18:33 Warning: SplFileInfo::openFile(/var/www/passbolt/app/tmp/cache/models/passbolt_cake_model_default_passbolt_roles): failed to open stream: Permission denied in [/var/www/passbolt/lib/Cake/Cache/Engine/FileEngine.php, line 356]
Warning Error: SplFileInfo::openFile(/var/www/passbolt/app/tmp/cache/models/passbolt_cake_model_default_passbolt_roles): failed to open stream: Permission denied in [/var/www/passbolt/lib/Cake/Cache/Engine/FileEngine.php, line 356]

PHP Warning: file_put_contents(/var/www/passbolt/app/tmp/logs/error.log): failed to open stream: Permission denied in /var/www/passbolt/lib/Cake/Log/Engine/FileLog.php on line 142
2017-12-01 10:18:33 Warning: SplFileInfo::openFile(/var/www/passbolt/app/tmp/cache/models/passbolt_cake_model_default_passbolt_roles): failed to open stream: Permission denied in [/var/www/passbolt/lib/Cake/Cache/Engine/FileEngine.php, line 356]
Warning Error: cake_model cache was unable to write ‘default_passbolt_roles’ to File cache in [/var/www/passbolt/lib/Cake/Cache/Cache.php, line 328]

If I run the second one I get:

Passbolt commands cannot be executed as root.
The command should be executed with the same user as your web server.
By instance : su -s /bin/bash -c “/var/www/passbolt/app/Console/cake COMMAND” HTTP_USER
HTTP_USER can differ regarding your environment : www-data, nginx, http

What am I doing wrong?

Regards!

Hi @jimb0 can you run a healthcheck and paste the result? It looks like your app/tmp/ directory is not writable.

su -s /bin/bash -c “./app/Console/cake passbolt healthcheck” www-data

hi @remy, thanks for your reply. it seems to be more than just one problem:

Environment

[PASS] PHP version 5.6.30-0+deb8u1
[PASS] PCRE compiled with unicode support
[FAIL] The temporary directory and its content are not writable
[HELP] Ensure the temporary directory and its content are writable by the user the webserver is running as.
[HELP] you can try:
[HELP] sudo chown -R marco:marco /var/www/passbolt/app/tmp
[HELP] sudo chmod 775 $(find /var/www/passbolt/app/tmp -type d)
[HELP] sudo chmod 664 $(find /var/www/passbolt/app/tmp -type f)
[PASS] The public image directory and its content are writable

Config files

[PASS] The core config file is present
[PASS] The database config file is present
[PASS] The email config file is present
[PASS] The application config file is present

Core config

[PASS] Debug mode is off.
[PASS] Cache is working.
[PASS] Unique value set for security.salt
[PASS] Unique value set for security.cipherSeed
[PASS] Full base url is set to https://passbolt.dev
[PASS] App.fullBaseUrl validation OK.
[PASS] /healthcheck/status is reachable.

SSL Certificate

[FAIL] SSL peer certificate does not validate
[FAIL] Hostname does not match when validating certificates.
[WARN] Using a self-signed certificate
[HELP] stream_socket_client(): Peer certificate CN=192.168.0.211' did not match expected CN=passbolt.dev’
stream_socket_client(): Failed to enable crypto
stream_socket_client(): unable to connect to ssl://passbolt.dev:443 (Unknown error)

Database

[PASS] Configured to use a supported database backend
[PASS] The application is able to connect to the database
[PASS] Not using a prefix for database tables
[PASS] 20 tables found
[PASS] Some default content is present
[PASS] The database schema up to date.

GPG Configuration

[PASS] PHP GPG Module is installed and loaded
[PASS] The server gpg key is not the default one
[FAIL] The environment variable GNUPGHOME is set to /home/www-data/.gnupg, but the directory doesn’t exist.
[HELP] Ensure the keyring location exists and is accessible by the user the webserver is running as.
[HELP] you can try:
[HELP] sudo mkdir /home/www-data/.gnupg
[HELP] sudo chown -R marco:marco /home/www-data/.gnupg
[HELP] sudo chmod 700 /home/www-data/.gnupg
[HELP] You can change the location of the keyring by editing the GPG.env.setenv and GPG.env.home variables in app/Config/app.php.
[PASS] The public key file is defined in app/config.php and readable.
[PASS] The private key file is defined in app/config.php and readable.
[PASS] The server key fingerprint matches the one defined in app/config.php.
[FAIL] The server key defined in the app/Config.php is not in the keyring
[HELP] Import the private server key in the keyring of the user the webserver is running as.
[HELP] you can try:
[HELP] sudo su -s /bin/bash -c “gpg --home /home/www-data/.gnupg --import /var/www/passbolt/app/Config/gpg/serverkey.private.asc” marco
[PASS] There is a valid email id defined for the server key.

Application configuration

[PASS] Using latest passbolt version (1.6.5)
[PASS] Passbolt is configured to force SSL use
[PASS] App.fullBaseUrl is set to HTTPS
[PASS] Selenium API endpoints are disabled.
[PASS] Search engine robots are told not to index content.
[PASS] Registration is closed, only administrators can add users.
[PASS] Serving the compiled version of the javascript app
[PASS] All email notifications will be sent.

Development Tools (optional)

[PASS] Phpunit is installed
[PASS] Phpunit version is 3.7.38

After trying the help steps for the tmp folder, I get the following error:

PHP Warning: cake_core cache was unable to write ‘cake_dev_eng’ to File cache in /var/www/passbolt/lib/Cake/Cache/Cache.php on line 328
PHP Warning: /var/www/passbolt/app/tmp/cache/persistent/ is not writable in /var/www/passbolt/lib/Cake/Cache/Engine/FileEngine.php on line 385
PHP Fatal error: Uncaught exception ‘CacheException’ with message ‘Cache engine “cake_core” is not properly configured. Ensure required extensions are installed, and credentials/permissions are correct’ in /var/www/passbolt/lib/Cake/Cache/Cache.php:186
Stack trace:
#0 /var/www/passbolt/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine(‘cake_core’)
#1 /var/www/passbolt/app/Config/core.php(400): Cache::config(‘cake_core’, Array)
#2 /var/www/passbolt/lib/Cake/Core/Configure.php(72): include(’/var/www/passbo…’)
#3 /var/www/passbolt/lib/Cake/bootstrap.php(432): Configure::bootstrap(true)
#4 /var/www/passbolt/lib/Cake/Console/ShellDispatcher.php(145): require(’/var/www/passbo…’)
#5 /var/www/passbolt/lib/Cake/Console/ShellDispatcher.php(100): ShellDispatcher->_bootstrap()
#6 /var/www/passbolt/lib/Cake/Console/ShellDispatcher.php(54): ShellDispatcher->_initEnvironment()
#7 /var/www/passbolt/lib/Cake/Console/ShellDispatcher.php(65): ShellDispatcher->__construct(Array)
#8 /var/www/passbolt/app/Console/cake.php(52): ShellDisp in /var/www/passbolt/lib/Cake/Cache/Cache.php on line 186

Hi @jimbo, can you try again the tutorial from scratch by following each steps? It seems to me that by the results of the healthcheck you did skip a few.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.