contentacms / contenta_jsonapi

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

During installation config is not found and therefore empty #328

Closed luksak closed 5 years ago

luksak commented 5 years ago

When running a $ drush si I get the following error:

This import is empty and if applied would delete all of your configuration, so has been rejected.

Worth mentioning is that I didn't use an of the install scripts.

What might be wrong?

e0ipso commented 5 years ago

Did you figure this out? there is not much detail on this issue to debug.

Tentatively closing, please request to reopen if necessary.

luksak commented 5 years ago

I'll reopen this issue once I encounter the error again.

luksak commented 5 years ago

Ok, I just reproduced the error. When I filed the issue, i did a manual install. This time I tried with the ddev stack: https://github.com/Mogtofu33/contenta-ddev

I simply ran the install.sh and got this error:

[info] Install ContentaCMS
 [info] Executing: mysql --defaults-file=/tmp/drush_c9JdPa --database=db --host=db --port=3306 --silent -A < /tmp/drush_c4cj0F > /dev/null
 [info] Sites directory sites/default already exists - proceeding.
 [info] Executing: mysql --defaults-file=/tmp/drush_K7eS5a --database=db --host=db --port=3306 --silent -A < /tmp/drush_6AxvXF > /dev/null
 [info] Executing: mysql --defaults-file=/tmp/drush_YG3zub --database=db --host=db --port=3306 --silent -A < /tmp/drush_oAmciG
 [info] Executing: mysql --defaults-file=/tmp/drush_jTJeYb --database=db --host=db --port=3306 --silent -A < /tmp/drush_sVbnJG
 [notice] Starting Drupal installation. This takes a while.
 [error]  Drush command terminated abnormally due to an unrecoverable error.
Failed to execute command [drush si contenta_jsonapi --account-pass=admin --verbose]: Failed to run docker-compose [-f /Users/lukasvonblarer/Sites/contenta-ddev/.ddev/docker-compose.yaml -f /Users/lukasvonblarer/Sites/contenta-ddev/.ddev/docker-compose.pm2.yaml -f /Users/lukasvonblarer/Sites/contenta-ddev/.ddev/docker-compose.portainer.yaml -f /Users/lukasvonblarer/Sites/contenta-ddev/.ddev/docker-compose.vue_nuxt.yaml -f /Users/lukasvonblarer/Sites/contenta-ddev/.ddev/docker-compose.override.yaml exec -e DDEV_EXEC=true -T web drush si contenta_jsonapi --account-pass=admin --verbose], err='exit status 1', stdout='<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8" />
<meta name="Generator" content="Drupal 8 (https://www.drupal.org)" />
<meta name="MobileOptimized" content="width" />
<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex, nofollow" />
<link rel="shortcut icon" href=":default/core/misc/favicon.ico" type="image/vnd.microsoft.icon" />

    <title>Configuration validation | Contenta JSON API</title>
    <style media="all">
@import url(":default/core/assets/vendor/normalize-css/normalize.css?0");
@import url(":default/core/misc/normalize-fixes.css?0");
@import url(":default/core/themes/stable/css/system/components/ajax-progress.module.css?0");
@import url(":default/core/themes/stable/css/system/components/align.module.css?0");
@import url(":default/core/themes/stable/css/system/components/autocomplete-loading.module.css?0");
@import url(":default/core/themes/stable/css/system/components/fieldgroup.module.css?0");
@import url(":default/core/themes/stable/css/system/components/container-inline.module.css?0");
@import url(":default/core/themes/stable/css/system/components/clearfix.module.css?0");
@import url(":default/core/themes/stable/css/system/components/details.module.css?0");
@import url(":default/core/themes/stable/css/system/components/hidden.module.css?0");
@import url(":default/core/themes/stable/css/system/components/item-list.module.css?0");
@import url(":default/core/themes/stable/css/system/components/js.module.css?0");
@import url(":default/core/themes/stable/css/system/components/nowrap.module.css?0");
@import url(":default/core/themes/stable/css/system/components/position-container.module.css?0");
@import url(":default/core/themes/stable/css/system/components/progress.module.css?0");
@import url(":default/core/themes/stable/css/system/components/reset-appearance.module.css?0");
@import url(":default/core/themes/stable/css/system/components/resize.module.css?0");
@import url(":default/core/themes/stable/css/system/components/sticky-header.module.css?0");
@import url(":default/core/themes/stable/css/system/components/tabledrag.module.css?0");
@import url(":default/core/themes/stable/css/system/components/tablesort.module.css?0");
@import url(":default/core/themes/stable/css/system/components/tree-child.module.css?0");
@import url(":default/core/themes/stable/css/system/system.admin.css?0");
@import url(":default/core/themes/stable/css/system/system.maintenance.css?0");
</style>
<style media="all">
@import url(":default/core/themes/seven/css/base/elements.css?0");
@import url(":default/core/themes/seven/css/base/typography.css?0");
@import url(":default/core/themes/seven/css/base/print.css?0");
@import url(":default/core/themes/seven/css/layout/layout.css?0");
@import url(":default/core/themes/classy/css/components/action-links.css?0");
@import url(":default/core/themes/classy/css/components/breadcrumb.css?0");
@import url(":default/core/themes/classy/css/components/button.css?0");
@import url(":default/core/themes/classy/css/components/collapse-processed.css?0");
@import url(":default/core/themes/classy/css/components/container-inline.css?0");
@import url(":default/core/themes/classy/css/components/exposed-filters.css?0");
@import url(":default/core/themes/classy/css/components/field.css?0");
@import url(":default/core/themes/classy/css/components/form.css?0");
@import url(":default/core/themes/classy/css/components/icons.css?0");
@import url(":default/core/themes/classy/css/components/inline-form.css?0");
@import url(":default/core/themes/classy/css/components/item-list.css?0");
@import url(":default/core/themes/classy/css/components/link.css?0");
@import url(":default/core/themes/classy/css/components/links.css?0");
@import url(":default/core/themes/classy/css/components/menu.css?0");
@import url(":default/core/themes/classy/css/components/more-link.css?0");
@import url(":default/core/themes/classy/css/components/pager.css?0");
@import url(":default/core/themes/classy/css/components/tabledrag.css?0");
@import url(":default/core/themes/classy/css/components/tableselect.css?0");
@import url(":default/core/themes/classy/css/components/tablesort.css?0");
@import url(":default/core/themes/classy/css/components/tabs.css?0");
@import url(":default/core/themes/classy/css/components/textarea.css?0");
@import url(":default/core/themes/classy/css/components/ui-dialog.css?0");
@import url(":default/core/themes/classy/css/components/messages.css?0");
@import url(":default/core/themes/seven/css/components/admin-list.css?0");
@import url(":default/core/themes/seven/css/components/content-header.css?0");
@import url(":default/core/themes/seven/css/components/container-inline.css?0");
@import url(":default/core/themes/seven/css/components/container-inline.module.css?0");
</style>
<style media="all">
@import url(":default/core/themes/seven/css/components/breadcrumb.css?0");
@import url(":default/core/themes/seven/css/components/buttons.css?0");
@import url(":default/core/themes/seven/css/components/details.css?0");
@import url(":default/core/themes/seven/css/components/messages.css?0");
@import url(":default/core/themes/seven/css/components/dropbutton.component.css?0");
@import url(":default/core/themes/seven/css/components/entity-meta.css?0");
@import url(":default/core/themes/seven/css/components/field-ui.css?0");
@import url(":default/core/themes/seven/css/components/form.css?0");
@import url(":default/core/themes/seven/css/components/help.css?0");
@import url(":default/core/themes/seven/css/components/menus-and-lists.css?0");
@import url(":default/core/themes/seven/css/components/modules-page.css?0");
@import url(":default/core/themes/seven/css/components/node.css?0");
@import url(":default/core/themes/seven/css/components/page-title.css?0");
@import url(":default/core/themes/seven/css/components/pager.css?0");
@import url(":default/core/themes/seven/css/components/panel.css?0");
@import url(":default/core/themes/seven/css/components/skip-link.css?0");
@import url(":default/core/themes/seven/css/components/tables.css?0");
@import url(":default/core/themes/seven/css/components/search-admin-settings.css?0");
@import url(":default/core/themes/seven/css/components/tablesort-indicator.css?0");
@import url(":default/core/themes/seven/css/components/system-status-report-general-info.css?0");
@import url(":default/core/themes/seven/css/components/system-status-report.css?0");
@import url(":default/core/themes/seven/css/components/tabs.css?0");
@import url(":default/core/themes/seven/css/components/system-status-report-counters.css?0");
@import url(":default/core/themes/seven/css/components/system-status-counter.css?0");
@import url(":default/core/themes/seven/css/components/views-ui.css?0");
@import url(":default/core/themes/seven/css/theme/colors.css?0");
@import url(":default/core/themes/seven/css/theme/maintenance-page.css?0");
@import url(":default/core/themes/seven/css/theme/install-page.css?0");
</style>

<!--[if lte IE 8]>
<script src=":default/core/assets/vendor/html5shiv/html5shiv.min.js?v=3.7.3"></script>
<![endif]-->

  </head>
  <body class="install-page path-default db-offline">
        <a href="#main-content" class="visually-hidden focusable skip-link">
      Skip to main content
    </a>

      <div class="dialog-off-canvas-main-canvas" data-off-canvas-main-canvas>
    <div class="layout-container">

  <header role="banner">
          <h1 class="page-title">
        Contenta JSON API
                  <span class="site-version">8.6.3</span>
              </h1>
      </header>

      <aside class="layout-sidebar-first" role="complementary">
      <h2 class="visually-hidden">Installation tasks</h2>
<ol class="task-list">
  <li class="done">
    Choose language
    <span class="visually-hidden"> (done)</span>  </li>
  <li class="done">
    Verify requirements
    <span class="visually-hidden"> (done)</span>  </li>
  <li class="done">
    Set up database
    <span class="visually-hidden"> (done)</span>  </li>
  <li class="is-active">
    Install configuration
    <span class="visually-hidden"> (active)</span>  </li>
  <li>
    Configure site
      </li>
  <li>
    Generate OAuth 2 keys
      </li>
  <li>
    Enable CORS by default
      </li>
  <li>
    Configure additional modules
      </li>
  <li>
    Install additional modules
      </li>
</ol>

    </aside>
  <main role="main">
          <h2 class="heading-a">Configuration validation</h2>
            <div role="contentinfo" aria-label="Error message" class="messages messages--error">
          <div role="alert">
                  <h2 class="visually-hidden">Error message</h2>
                    <ul class="messages__list">
                      <li class="messages__item">The configuration synchronization failed validation.</li>
                      <li class="messages__item">This import is empty and if applied would delete all of your configuration, so has been rejected.</li>
                  </ul>
                </div>
      </div>

  </main>

</div>
  </div>

    <script src=":default/core/themes/seven/js/mobile.install.js?v=8.6.3"></script>

  </body>
</html>
', stderr=' [info] Executing: mysql --defaults-file=/tmp/drush_c9JdPa --database=db --host=db --port=3306 --silent -A < /tmp/drush_c4cj0F > /dev/null
 [info] Sites directory sites/default already exists - proceeding.
 [info] Executing: mysql --defaults-file=/tmp/drush_K7eS5a --database=db --host=db --port=3306 --silent -A < /tmp/drush_6AxvXF > /dev/null
 [info] Executing: mysql --defaults-file=/tmp/drush_YG3zub --database=db --host=db --port=3306 --silent -A < /tmp/drush_oAmciG
 [info] Executing: mysql --defaults-file=/tmp/drush_jTJeYb --database=db --host=db --port=3306 --silent -A < /tmp/drush_sVbnJG
 [notice] Starting Drupal installation. This takes a while.
 [error]  Drush command terminated abnormally due to an unrecoverable error. '
e0ipso commented 5 years ago

The error makes me think that you are trying to install over a non empty database or with an existing configuration directory.

Have you tried a completely clean install?

luksak commented 5 years ago

My database and the configuration directories are empty.

e0ipso commented 5 years ago

@luksak is there any reason to run install.sh directly? Why not the supported way instead: for instance composer run-script install:with-mysql.

e0ipso commented 5 years ago

Please request a re-open if that does not fix the issue.

luksak commented 5 years ago

yes, i want to set it up with docker and want to that manually.

e0ipso commented 5 years ago

@luksak that's great! What I'm trying to understand is why you want to use the install.sh script (which requires some preparation) instead of running the composer commands.

luksak commented 5 years ago

@e0ipso because i already have the mysql connection set up for my docker containers. i don't want to configure mysql.

e0ipso commented 5 years ago

Gotcha! You'll have to expose the environment variables yourself then.

It seems that https://github.com/contentacms/contenta_docker is installing correctly. Is there any difference in what you are doing?

luksak commented 5 years ago

Well, that instructs to run install:with-mysql as well... But no, I havent tried it.

luksak commented 5 years ago

I am back having this issue again... This time using https://github.com/Mogtofu33/contenta-ddev and I am facing the same issue agian but this time running everything in docker... How could I debug this?

luksak commented 5 years ago

I managed to install contentacms, but only by manually copying the config of contenta_jsonapi to my previously configured config folder of my site and the running drush si --existing-config.

Something is really weird here. I tried two completely different approaches. One of them being a preconfigured docker environment... Could you reopen this issue since this actually exists for me :)

annikaC commented 5 years ago

@luksak: $config_directories['sync'] = 'profiles/contrib/contenta_jsonapi/config/sync'; in my settings.php fixed this for me.

luksak commented 5 years ago

@annikaC ok, thank you! I'll try that next time.

What could be causing this?

truumahn commented 4 years ago

Probably related to this: https://www.drupal.org/project/drupal/issues/3026802

rmcveigh commented 2 years ago

Just noting that I ran into this issue as well using DDEV on an initial build/install. I was able to resolve the drush site:install issue by pointing the config sync directory definition in settings.php to the profile config directory $settings['config_sync_directory'] = 'profiles/contrib/contenta_jsonapi/config/sync'; Then, after running drush site:install was able to change the directory to the directory I wanted and performed a drush config:export to get the config into that directory instead.