Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix site install #58

Merged
merged 1 commit into from
Aug 26, 2024
Merged

Fix site install #58

merged 1 commit into from
Aug 26, 2024

Conversation

joecorall
Copy link
Contributor

No description provided.

@rosiel rosiel merged commit 8497929 into main Aug 26, 2024
3 checks passed
@rosiel rosiel deleted the fix-install branch August 26, 2024 19:17
@joshdentremont
Copy link
Contributor

joshdentremont commented Sep 5, 2024

@joecorall @aOelschlager Are you able to log in to a new site with this PR merged? My site seems to install ok, but I can't log in using admin/password.

If I revert this PR, the install seems to fail here: https://github.com/Islandora-Devops/isle-buildkit/blob/297e2fcab18b1f10da8d4f265e9cfe5ce1a64a32/drupal/rootfs/etc/islandora/utilities.sh#L242

Trying that command in a working container gives this error:

826b04f44712:/var/www/drupal# drush drupal:directory

In EntityTypeManager.php line 142:

  The "search_api_index" entity type does not exist.

I suspect this is a Drush 13 issue that needs to be fixed (maybe in starter site?) then we can roll this PR back.

I think this is what @aOelschlager was seeing here Islandora-Devops/islandora-starter-site#162, but the error message was misleading. It looks like Drush is actually not working at all:

826b04f44712:/var/www/drupal# drush

In EntityTypeManager.php line 142:

  The "search_api_index" entity type does not exist.


826b04f44712:/var/www/drupal# drush cr

In EntityTypeManager.php line 142:

  The "search_api_index" entity type does not exist.

@joecorall
Copy link
Contributor Author

@joshdentremont - I am able to with this PR #63

@joshdentremont
Copy link
Contributor

joshdentremont commented Sep 5, 2024

Still not working for me with buildkit 3.4.0. It looks like there is something weird going on with the search api module in starter site.

My Drush seems to be totally unusable, and it looks like the install is not creating the admin account.

@joecorall
Copy link
Contributor Author

joecorall commented Sep 5, 2024

@joshdentremont - can you list your steps how you're doing a fresh install? Are you doing a fresh git clone of isle-site-template, and removing any/all old containers/volumes from your previous attempts. It's working for me locally and it's working in GitHub Actions CI tests on #63 so wondering what's going on for you locally.

git clone [email protected]:Islandora-Devops/isle-site-template.git
cd isle-site-template
export ISLANDORA_TAG=main
export ISLANDORA_STARTER_REF=heads/main
./tests/init-template-starter.sh
docker compose --profile dev exec drupal-dev drush uli --uri https://islandora.dev

The traditional step (which requires user interaction so we can't do it in CI) also works for me locally. Though it takes a few minutes after docker compose --profile dev up -d before the site is available

git clone [email protected]:Islandora-Devops/isle-site-template.git
cd isle-site-template
git fetch
git checkout buildkit-tag
./setup.sh
# select main for both starter and buildkit
cd name/of/your/repo
docker compose --profile dev up -d
# wait 2-5 minutes
docker compose --profile dev exec drupal-dev drush uli --uri https://islandora.dev

@joshdentremont
Copy link
Contributor

@joecorall Are you able to log in as admin/password once the site is up?

What I did was:

  • git clone Isle Site Template
  • Follow manual install instructions (without creating a git repo)
    • Pulled starter site main, as described in manual install instructions
  • changed TAG to main in .env
  • build drupal image
  • start containers

After doing this, my site is set up, but I can't log in using admin/password. It does look like drush is working though, so maybe something in the install_site function is causing the drush errors.

I then reverted the changes in this PR and tried rebuilding the drupal container and it is throwing the same error:

isle-site-template-drupal-dev-1  |   Command drupal:directory was not found. Drush was unable to query the datab
isle-site-template-drupal-dev-1  |   ase. As a result, many commands are unavailable. Re-run your command with -
isle-site-template-drupal-dev-1  |   -debug to see relevant log messages.

By skipping the install_site function we are missing a lot of stuff, including the call to this - https://github.com/Islandora-Devops/isle-buildkit/blob/main/drupal/rootfs/usr/local/bin/install-drupal-site.sh, which I suspect might be why I can't log in with this PR.

@joecorall
Copy link
Contributor Author

oh i see. i always just use drush uli so missed this. Yeah we need to fix this, but for now drush uli is a workaround

@joshdentremont
Copy link
Contributor

I tried replacing the install_site command with just the drush command to get some debug info, like this

    create_database "${SITE}"
    drush dd --debug
    wait_for_service "${SITE}" broker

This is what gets spit out to the docker log

drupal-dev-1  |  [preflight] Config paths: /etc/drush/drush.yml,/var/www/drupal/vendor/drush/drush/drush.yml
drupal-dev-1  |  [preflight] Alias paths: /var/www/drupal/web/drush/sites,/var/www/drupal/drush/sites
drupal-dev-1  |  [preflight] Commandfile search paths: /var/www/drupal/vendor/drush/drush/src,/usr/share/drush/
drupal-dev-1  |  [debug] Bootstrap further to find dd [0.67 sec, 9.58 MB]
drupal-dev-1  |  [debug] Trying to bootstrap as far as we can [0.67 sec, 9.58 MB]
drupal-dev-1  |  [info] Drush bootstrap phase: bootstrapDrupalRoot() [0.67 sec, 9.58 MB]
drupal-dev-1  |  [info] Change working directory to /var/www/drupal/web [0.67 sec, 9.58 MB]
drupal-dev-1  |  [info] Initialized Drupal 10.3.1 root directory at /var/www/drupal/web [0.67 sec, 9.63 MB]
drupal-dev-1  |  [info] Drush bootstrap phase: bootstrapDrupalSite() [0.67 sec, 10.08 MB]
drupal-dev-1  |  [debug] Could not find a Drush config file at sites/default/drush.yml. [0.67 sec, 10.26 MB]
drupal-dev-1  |  [info] Initialized Drupal site default at sites/default [0.67 sec, 10.26 MB]
drupal-dev-1  |  [info] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.67 sec, 10.26 MB]
drupal-dev-1  |  [info] key_value table not found. Database may be empty. [0.67 sec, 11.07 MB]
drupal-dev-1  |  [debug] Bootstrap phase bootstrapDrupalDatabase() failed to validate; continuing at bootstrapDrupalConfiguration() [0.67 sec, 11.07 MB]
drupal-dev-1  |  [debug] Done with bootstrap max in Application::bootstrapAndFind(): trying to find dd again. [0.67 sec, 11.07 MB]
drupal-dev-1  |
drupal-dev-1  | In Application.php line 228:
drupal-dev-1  |
drupal-dev-1  |   [Symfony\Component\Console\Exception\CommandNotFoundException]
drupal-dev-1  |   Command dd was not found. Drush was unable to query the database. As a resu
drupal-dev-1  |   lt, many commands are unavailable. Re-run your command with --debug to see
drupal-dev-1  |   relevant log messages.
drupal-dev-1  |
drupal-dev-1  |
drupal-dev-1  | Exception trace:
drupal-dev-1  |   at /var/www/drupal/vendor/drush/drush/src/Application.php:228
drupal-dev-1  |  Drush\Application->bootstrapAndFind() at /var/www/drupal/vendor/drush/drush/src/Application.php:180
drupal-dev-1  |  Drush\Application->find() at /var/www/drupal/vendor/symfony/console/Application.php:266
drupal-dev-1  |  Symfony\Component\Console\Application->doRun() at /var/www/drupal/vendor/symfony/console/Application.php:175
drupal-dev-1  |  Symfony\Component\Console\Application->run() at /var/www/drupal/vendor/drush/drush/src/Runtime/Runtime.php:110
drupal-dev-1  |  Drush\Runtime\Runtime->doRun() at /var/www/drupal/vendor/drush/drush/src/Runtime/Runtime.php:40
drupal-dev-1  |  Drush\Runtime\Runtime->run() at /var/www/drupal/vendor/drush/drush/drush.php:139
drupal-dev-1  |  require() at /var/www/drupal/vendor/drush/drush/drush:4
drupal-dev-1  |  include() at /var/www/drupal/vendor/bin/drush:119

@joshdentremont
Copy link
Contributor

I just confirmed that this commit (Islandora-Devops/islandora-starter-site@d8ec762) is what broke the ability to use the install_site function. My guess is that Drush 13 changed something so that you can't run drush drupal:directory for a site that has not been installed yet.

I think the way to fix this is to replace this line: https://github.com/Islandora-Devops/isle-buildkit/blob/main/drupal/rootfs/etc/islandora/utilities.sh#L242 with something that doesn't use Drush. I have just put in a PR for this - Islandora-Devops/isle-buildkit#349

Assuming that PR goes through, we should be able to revert this PR and go back to install_site "${SITE}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants