contentacms / contenta_jsonapi

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

OS X Quick install failed with: sqlite error 3 Error: unable to open database "/" #342

Closed ehausen closed 5 years ago

ehausen commented 5 years ago

Installation went smoothly until

nstalling Contenta CMS for local usage
-----------------------------------------------
 EXECUTING  /Users/MyUser/Projects/MyProject/contentacms/vendor/drush/drush/drush site-install contenta_jsonapi --verbose --yes \
  --root=/Users/MyUser/Projects/MyProject/contentacms/web \
  --db-url= \
  --site-mail= \
  --account-mail= \
  --site-name= \
  --account-name= \
  --account-pass="[REDACTED]";

 // You are about to DROP all tables in your '/' database. Do you want to
 // continue?: yes.

 [info] Sites directory sites/default already exists - proceeding.
 [info] Executing: sqlite3  /   < /private/tmp/drush_5xE2N8
 [info] Executing: sqlite3  /   < /private/tmp/drush_J5X0dM

In SiteInstallCommands.php line 354:

  [Exception]
  Failed to create database: Error: unable to open database "/": unable to op
  en database file

The second time I tried installing it worked differently

-----------------------------------------------
 Installing Contenta CMS for local usage
-----------------------------------------------
 EXECUTING  /Users/MyUser/Projects/MyProject/contentacms/vendor/drush/drush/drush site-install contenta_jsonapi --verbose --yes \
  --root=/Users/MyUser/Projects/MyProject/contentacms/web \
  --db-url= \
  --site-mail=admin@localhost \
  --account-mail=admin@localhost \
  --site-name=Contenta \
  --account-name=admin \
  --account-pass="[REDACTED]";

Now the sqlite part seemed to go smoothly

I still have problem at the end with the following, but probably not related:

A Drupal installation directory could not be found                                                                                                                                                                     [error]
Command runserver needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command.                                                                 [error]
The drush command 'runserver 127.0.0.1:8888' could not be executed.                                                                                                                                                    [error]
A Drupal installation directory could not be found
ehausen commented 5 years ago

For the record "A Drupal installation directory could not be found" was caused by me having too old drush version. I had to force installing drush version 9 with composer

marcvangend commented 5 years ago

@ehausen can you elaborate on your solution? Is this about the global Drush version on your system? How does one "force install drush version 9 with composer"?

Maintainers, if this is indeed about the global drush version, how can that cause problems given that install.sh uses the local drush: export DRUSH="$DEST_DIR/$COMPOSER_VENDOR_DIR/drush/drush/drush" which is 9.5.2 in my case?

ehausen commented 5 years ago

Sorry, can't really remember at all now. Could maybe find out, if important

marcvangend commented 5 years ago

Thanks for the quick response. I ended up installing a global Drush 9 (composer require global) and symlinking /usr/local/bin/drush to that drush executable. Then I completely removed the folder where I had tried to install contenta before. After that, it installed smoothly.

That said, I still don't see why a global Drush 9 would be needed. It shouldn't be required I guess.

e0ipso commented 5 years ago

@ehausen it seems that the sqlite DB URL is invalid: notice the --db-url= \. If you want to install using sqlite, I recommend you to take a look at https://github.com/contentacms/contenta_jsonapi_project/blob/8.x-2.x/scripts/install-sqlite.sh

It requires to declare: SQLITE_PATH and SQLITE_DATABASE in your .env file.

e0ipso commented 5 years ago

Please request a re-open if that is not the case.

marcvangend commented 5 years ago

Thanks for looking into this. So basically you're saying this is not a bug, but a read-the-documentation problem. That's okay.

However, if a .env file must be edited first, shouldn't we conclude that the single-command quick install method described on www.contentacms.org (php -r "readfile('https://raw.githubusercontent.com/contentacms/contenta_jsonapi/8.x-2.x/installer.sh');" > contentacms-quick-installer.sh chmod a+x contentacms-quick-installer.sh ./contentacms-quick-installer.sh) will never work?

e0ipso commented 5 years ago

In https://raw.githubusercontent.com/contentacms/contenta_jsonapi/8.x-3.x/installer.sh you'll note:

echo -e "SQLITE_PATH=tmp\nSQLITE_DATABASE=site.sqlite\nSITE_MAIL=admin@localhost\nACCOUNT_MAIL=admin@localhost\nSITE_NAME='Contenta CMS Demo'\nACCOUNT_NAME=admin\nACCOUNT_PASS=$ACCOUNT_PASS" >> $install_path/.env
echo -e "ACCOUNT_PASS=$ACCOUNT_PASS" >> $install_path/.env.local

To account for that.

marcvangend commented 5 years ago

OK, let's just hope that my problems were a one-time quirk then, not a reproducible problem. Thanks.