contentacms / contenta_jsonapi

Contenta CMS, the decoupled Drupal
http://www.contentacms.org/
GNU General Public License v2.0
328 stars 104 forks source link

Contenta install issues #382

Closed fiasst closed 4 months ago

fiasst commented 5 years ago

Hi, I know this has been discussed before because I've found all those issues when fault finding. I've tried all the solutions I can but unlike other examples, the error doesn't give additional details on why it fails.

I've spent a day trying to install Contenta and I haven't progressed at all and would really appreciate the support.

I have an issue with composer running out of memory even with memory_limit set to -1 which could be a problem. I haven't found out why that is yet.

Marcs-MBP:build marc$ php -r "echo ini_get('memory_limit').PHP_EOL;"
-1

I'm trying to install with:

composer run-script install:with-mysql

The error:

Marcs-MBP:build marc$ composer run-script install:with-mysql
> scripts/install-mysql.sh
-----------------------------------------------
 Installing Contenta CMS for local usage 
-----------------------------------------------
 EXECUTING  /Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/drush site-install contenta_jsonapi --verbose --yes \
  --root=/Users/marc/Documents/Work/playground/v2/build/web \
  --db-url=mysql://contenta_admin:[REDACTED]@localhost:/contenta_8_test1 \
  --site-mail=admin@localhost \
  --account-mail=admin@localhost \
  --site-name=Contenta \
  --account-name=admin \
  --account-pass="[REDACTED]";

 [info] Executing: command -v mysql
 [info] Executing: mysql --defaults-file=/private/tmp/drush_PuXxOx --database=contenta_8_test1 --host=localhost --silent -A < /private/tmp/drush_XmCBsQ

 // You are about to CREATE the 'contenta_8_test1' database. Do you want to     
 // continue?: yes.                                                             

 [info] Sites directory sites/default already exists - proceeding.
 [info] Executing: mysql --defaults-file=/private/tmp/drush_nIitVT --database=contenta_8_test1 --host=localhost --silent -A < /private/tmp/drush_vDgzRa
 [info] Executing: mysql --defaults-file=/private/tmp/drush_polYdY --database=information_schema --host=localhost --silent -A < /private/tmp/drush_Jo6B6H

In SiteInstallCommands.php line 367:

  [Exception]                             
  Failed to drop or create the database:  

Exception trace:
 () at /Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php:367
 Drush\Commands\core\SiteInstallCommands->pre() at /Users/marc/Documents/Work/playground/v2/build/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:43
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->callValidator() at /Users/marc/Documents/Work/playground/v2/build/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:27
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->validate() at /Users/marc/Documents/Work/playground/v2/build/vendor/consolidation/annotated-command/src/CommandProcessor.php:195
 Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /Users/marc/Documents/Work/playground/v2/build/vendor/consolidation/annotated-command/src/CommandProcessor.php:178
 Consolidation\AnnotatedCommand\CommandProcessor->process() at /Users/marc/Documents/Work/playground/v2/build/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:302
 Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /Users/marc/Documents/Work/playground/v2/build/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /Users/marc/Documents/Work/playground/v2/build/vendor/symfony/console/Application.php:987
 Symfony\Component\Console\Application->doRunCommand() at /Users/marc/Documents/Work/playground/v2/build/vendor/symfony/console/Application.php:255
 Symfony\Component\Console\Application->doRun() at /Users/marc/Documents/Work/playground/v2/build/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/src/Runtime/Runtime.php:118
 Drush\Runtime\Runtime->doRun() at /Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/src/Runtime/Runtime.php:49
 Drush\Runtime\Runtime->run() at /Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/drush.php:72
 require() at /Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/drush:4

site:install [--db-url DB-URL] [--db-prefix DB-PREFIX] [--db-su DB-SU] [--db-su-pw DB-SU-PW] [--account-name [ACCOUNT-NAME]] [--account-mail [ACCOUNT-MAIL]] [--site-mail [SITE-MAIL]] [--account-pass ACCOUNT-PASS] [--locale [LOCALE]] [--site-name [SITE-NAME]] [--site-pass SITE-PASS] [--sites-subdir SITES-SUBDIR] [--config-dir CONFIG-DIR] [--existing-config] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--notify] [--druplicon] [--xh-link XH-LINK] [--] <command> [<profile>]...

 ERROR  The Drupal installer failed to install Contenta CMS.
Script scripts/install-mysql.sh handling the install:with-mysql event returned with error code 3
Marcs-MBP:build marc$ drush version
 Drush Version   :  8.3.0 
Marcs-MBP:build marc$ php -v
PHP 7.1.23 (cli) (built: Feb 22 2019 22:19:32) ( NTS )
Marcs-MBP:build marc$ php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
exif
fileinfo
filter
ftp
gd
hash
iconv
json
ldap
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

Contents of .env:

MYSQL_DATABASE=contenta_8_test1
MYSQL_HOSTNAME=localhost
MYSQL_PORT=3306
MYSQL_USER=root

# SQLITE_PATH=tmp
# SQLITE_DATABASE=contenta_8_test1.sqlite

ACCOUNT_NAME=admin
SITE_MAIL=admin@localhost
ACCOUNT_MAIL=admin@localhost
SITE_NAME=Contenta

Contents of .env.local:

MYSQL_PASSWORD=contenta_password
ACCOUNT_PASS=admin

Thanks

fiasst commented 5 years ago

After a lot of trial and error, I've got what feels very close to getting Contenta to install via:

composer run-script install:with-mysql

I now get the following message:

Marcs-MacBook-Pro:build marc$ composer run-script install:with-mysql
> scripts/install-mysql.sh
-----------------------------------------------
 Installing Contenta CMS for local usage 
-----------------------------------------------
 EXECUTING  /Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/drush site-install contenta_jsonapi --verbose --yes \
  --root=/Users/marc/Documents/Work/playground/v2/build/web \
  --db-url=mysql://root:[REDACTED]@localhost:3306/contenta_8_test1 \
  --site-mail=admin@localhost \
  --account-mail=admin@localhost \
  --site-name=Contenta \
  --account-name=admin \
  --account-pass="[REDACTED]";

Executing: mysql --defaults-extra-file=/private/tmp/drush_VD3azi --database=contenta_8_test1 --host=localhost --port=3306 --silent  < /private/tmp/drush_Q6HsAc > /dev/null
You are about to DROP all tables in your 'contenta_8_test1' database. Do you want to continue? (y/n): y
Sites directory                                                         [notice]
/Users/marc/Documents/Work/playground/v2/build/web/sites/default
already exists - proceeding.
Executing: mysql --defaults-extra-file=/private/tmp/drush_0Px7zq --database=contenta_8_test1 --host=localhost --port=3306 --silent  < /private/tmp/drush_HFNb7h > /dev/null
Executing: mysql --defaults-extra-file=/private/tmp/drush_izNG6g --database=contenta_8_test1 --host=localhost --port=3306 --silent  < /private/tmp/drush_RaUW0O
Starting Drupal installation. This takes a while. Consider using the [ok]
--notify global option.
Drupal\Core\Installer\Exception\InstallerException: Resolve all      [error]
issues below to continue the installation. For help configuring your
database server, see the <a
href="https://www.drupal.org/docs/8/install">installation
handbook</a>, or contact your hosting provider.<div
class="item-list"><ul><li>Failed to connect to your database server.
The server reports the following message: <em
class="placeholder">SQLSTATE[HY000] [2054] The server requested
authentication method unknown to the client</em>.<ul><li>Is the
database server running?</li><li>Does the database exist or does the
database user have sufficient privileges to create the
database?</li><li>Have you entered the correct database
name?</li><li>Have you entered the correct username and
password?</li><li>Have you entered the correct database
hostname?</li></ul></li></ul></div> in
/Users/marc/Documents/Work/playground/v2/build/web/core/includes/install.core.inc:973
Stack trace:
#0
/Users/marc/Documents/Work/playground/v2/build/web/core/includes/install.core.inc(624):
install_get_form('Drupal\\Core\\Ins...', Array)
#1
/Users/marc/Documents/Work/playground/v2/build/web/core/includes/install.core.inc(577):
install_run_task(Array, Array)
#2
/Users/marc/Documents/Work/playground/v2/build/web/core/includes/install.core.inc(118):
install_run_tasks(Array, NULL)
#3
/Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/includes/drush.inc(728):
install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#4
/Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/includes/drush.inc(713):
drush_call_user_func_array('install_drupal', Array)
#5
/Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/commands/core/drupal/site_install.inc(82):
drush_op('install_drupal', Object(Composer\Autoload\ClassLoader),
Array)
#6
/Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/commands/core/site_install.drush.inc(271):
drush_core_site_install_version('contenta_jsonap...', Array)
#7
/Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/includes/command.inc(422):
drush_core_site_install('contenta_jsonap...')
#8
/Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/includes/command.inc(231):
_drush_invoke_hooks(Array, Array)
#9
/Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/includes/command.inc(199):
drush_command('contenta_jsonap...')
#10
/Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#11
/Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/includes/preflight.inc(67):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#12
/Users/marc/Documents/Work/playground/v2/build/vendor/drush/drush/drush.php(12):
drush_main()
#13 {main}
Command dispatch complete                                               [notice]
 ERROR  The Drupal installer failed to install Contenta CMS.
Script scripts/install-mysql.sh handling the install:with-mysql event returned with error code 3

That doesn't give much away but when I change the MYSQL password in .env.local I get an Access Denied with Password error so it seems the database is being found and a connection is made successfully. I don't know how to debug it further though.

I run

sqlite3

and start SQL with

brew services start mysql

before I try an install.

I've checked database privileges too with:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON `contenta\_8\_test1`.* TO 'root'@'localhost';

(As described here)

I would really appreciate some suggestions.

gayathrics commented 4 years ago

I was able to install locally using Lando. Here's a blog post that helped - https://thinktandem.io/blog/2019/01/25/lando-contenta-cms-nuxt-pt-1/

pixelass commented 4 years ago

Same error. Even Lando doesn't work for me. Getting Failed to drop or create the database:

josiprajkovic commented 4 years ago

If you are using Lando, try lando mysql command. It downloaded the mysql image and started up the mysql container. Than I ran lando drush si --db-url=mysql://drupal8:drupal8@database/drupal8 again and it worked for me.

pixelass commented 4 years ago

Thank you I had too many issues (could never get it to start) and moved away from contenta but might try again in the future.