1

I'm trying to make database updates to my Drupal 8 website, but I keep getting the error Your system schema version is -1. Updating directly from a schema version prior to 8000 is not supported., therefore I can't make the updates. I already have the line const CORE_MINIMUM_SCHEMA_VERSION = 8000; in core/lib/Drupal.php. Why am I getting this error?

The full error is as below:

[error]  Your system schema version is -1. Updating directly from a schema version prior to 8000 is not supported. You must upgrade your site to Drupal 8 first, see https://www.drupal.org/docs/8/upgrade. (Currently using Minimum schema version The installed schema version does not meet the minimum.)

 Requirements check reports errors. Do you wish to continue? (yes/no) [yes]:
 >

 ------------------------- ----------------------------------------------- ------------- -------------------------------------------------------------------------------------------------------------------------------------------------
  Module                    Update ID                                       Type          Description
 ------------------------- ----------------------------------------------- ------------- -------------------------------------------------------------------------------------------------------------------------------------------------
  address                   clear_country_list                              post-update   Clear caches to receive the new country list.
  address                   convert_names_subdivisions                      post-update   Re-save all entities with address data to update names and subdivisions.
  adminimal_admin_toolbar   avoid_custom_font                               post-update   Update adminimal_admin_toolbar.settings to include avoid_custom_font.
  block_content             add_views_reusable_filter                       post-update   Adds a 'reusable' filter to all Custom Block views.
  block                     disable_blocks_with_missing_contexts            post-update   Disable all blocks with missing context IDs in block_update_8001().
  block                     disabled_region_update                          post-update   Disable blocks that are placed into the "disabled" region.
  block                     fix_negate_in_conditions                        post-update   Fix invalid 'negate' values in block visibility conditions.
  comment                   enable_comment_admin_view                       post-update   Enable the comment admin view.
  commerce_cart             1                                               post-update   Revert Cart views to fix broken Price fields.
  commerce_cart             2                                               post-update   Revert the cart block and form views.
  commerce_checkout         1                                               post-update   Revert Checkout views to fix broken Price fields.
  commerce_log              1                                               post-update   Revert the Activity view to make the date column sortable.
  commerce_log              2                                               post-update   Revert the Activity view to change page limit and ordering.
  commerce_order            1                                               post-update   Revert Order views to fix broken Price fields.
  commerce_order            2                                               post-update   Update order types.
  commerce_order            3                                               post-update   Revert the Order and Profile entity view displays.
  commerce_order            4                                               post-update   Revert the Order entity view displays.
  commerce_order            5                                               post-update   Revert the Order entity form display.
  commerce_order            6                                               post-update   Update the profile address field.
  commerce_order            7                                               post-update   Revert the 'commerce_order_item_table' view - empty text added.
  commerce_order            8                                               post-update   Unlock the profile 'address' field.
  commerce_order            9                                               post-update   Grants the "manage order items" permission to roles that can update orders.
  commerce_payment          1                                               post-update   Re-save payment methods to populate the payment_gateway_mode field.
  commerce_payment          2                                               post-update   Re-save payments to populate the payment_gateway_mode and completed fields.
  commerce_product          1                                               post-update   Revert the Products view because of the updated permission.
  commerce_product          2                                               post-update   Revert the default order item form display.
  commerce_product          3                                               post-update   Revert the default order item form display.
  commerce_product          4                                               post-update   Expose the status field on every product form.
  commerce_product          5                                               post-update   Enable the "Duplicate" variation button for every product type.
  commerce_product          6                                               post-update   Grants the "manage variations" permission to roles that can update products.
  commerce_product          7                                               post-update   Move the variations form to its own tab.
  commerce_promotion        1                                               post-update   Add the coupons field to orders.
  commerce_promotion        2                                               post-update   Add the 'promotion_id' field to coupons.
  commerce_promotion        3                                               post-update   Delete orphaned coupons.
  commerce_promotion        4                                               post-update   Add the compatibility field to promotions.
  commerce_promotion        6                                               post-update   Update offers and conditions.
  commerce_promotion        7                                               post-update   Add the condition_operator field to promotions.
  commerce_promotion        8                                               post-update   Re-save promotions to populate the condition operator field.
  commerce_promotion        9                                               post-update   Update offers and conditions.
  commerce_store            1                                               post-update   Revert the Stores view because of the updated permission.
  commerce_store            2                                               post-update   Revert the Stores view.
  contextual                fixed_endpoint_and_markup                       post-update   Ensure new page loads use the updated JS and get the updated markup.
  dblog                     convert_recent_messages_to_view                 post-update   Replace 'Recent log messages' with a view.
  editor                    clear_cache_for_file_reference_filter           post-update   Clear the render cache to fix file references added by Editor.
  field                     email_widget_size_setting                       post-update   Adds the 'size' setting for email widgets.
  field                     entity_reference_handler_setting                post-update   Fixes the 'handler' setting for entity reference fields.
  field                     remove_handler_submit_setting                   post-update   Remove the stale 'handler_submit' setting for entity_reference fields.
  field                     save_custom_storage_property                    post-update   Re-save all field storage config objects to add 'custom_storage' property.
  image                     image_style_dependencies                        post-update   Saves the image style dependencies into form and view display entities.
  image                     scale_and_crop_effect_add_anchor                post-update   Add 'anchor' setting to 'Scale and crop' effects.
  language                  language_select_widget                          post-update   Add the 'include_locked' settings to the 'language_select' widget.
  locale                    clear_cache_for_old_translations                post-update   Clear cache to ensure plural translations are removed from it.
  node                      configure_status_field_widget                   post-update   Load all form displays for nodes, add status with these settings, save.
  node                      node_revision_views_data                        post-update   Clear caches due to updated views data.
  system                    add_region_to_entity_displays                   post-update   Update entity displays to contain the region for each field.
  system                    change_action_plugins                           post-update   Change plugin IDs of actions.
  system                    change_delete_action_plugins                    post-update   Change plugin IDs of delete actions.
  system                    classy_message_library                          post-update   Clear caches to ensure Classy's message library is always added.
  system                    extra_fields                                    post-update   Update all entity displays that contain extra fields.
  system                    field_formatter_entity_schema                   post-update   Clear caches due to schema changes in core.entity.schema.yml.
  system                    field_type_plugins                              post-update   Force field type plugin definitions to be cleared.   @see https:www.drupal.orgnode2403703
  system                    hashes_clear_cache                              post-update   Force caches using hashes to be cleared (Twig, render cache, etc.).
  system                    language_item_callback                          post-update   Force cache clear for language item callback.   @see https:www.drupal.orgnode2851736
  system                    recalculate_configuration_entity_dependencies   post-update   Re-save all configuration entities to recalculate dependencies.
  system                    states_clear_cache                              post-update   Force cache clear to ensure aggregated JavaScript files are regenerated.   @see https:www.drupal.orgprojectdrupalissues2995570
  system                    timestamp_plugins                               post-update   Force plugin definitions to be cleared.   @see https:www.drupal.orgnode2802663
  taxonomy                  clear_entity_bundle_field_definitions_cache     post-update   Clear entity_bundle_field_definitions cache for new parent field settings.
  taxonomy                  clear_views_data_cache                          post-update   Clear caches due to updated taxonomy entity views data.
  taxonomy                  handle_publishing_status_addition_in_views      post-update   Add a 'published' = TRUE filter for all Taxonomy term views and converts  existing ones that were using the 'content_translation_status' field.
  user                      enforce_order_of_permissions                    post-update   Enforce order of role permissions.
  views                     boolean_filter_values                           post-update   Set all boolean filter values to strings.
  views                     bulk_field_moved                                post-update   Update dependencies for moved bulk field plugin.
  views                     cleanup_duplicate_views_data                    post-update   Update some views fields that were previously duplicated.
  views                     entity_link_url                                 post-update   Add additional settings to the entity link field and convert node_path usage  to entity_link.
  views                     field_formatter_dependencies                    post-update   Include field formatter dependencies in a view when the formatter is used.
  views                     filter_placeholder_text                         post-update   Add placeholder settings to string or numeric filters.
  views                     grouped_filters                                 post-update   Rebuild caches to ensure schema changes are read in.
  views                     revision_metadata_fields                        post-update   Fix table names for revision metadata fields.   @see https:www.drupal.orgnode2831499
  views                     serializer_dependencies                         post-update   Fix views with serializer dependencies.
  views                     table_display_cache_max_age                     post-update   Fix cache max age for table displays.
  views                     taxonomy_index_tid                              post-update   Fix views with dependencies on taxonomy terms that don't exist.
  views                     update_cacheability_metadata                    post-update   Update the cacheability metadata for all views.
  views                     views_data_table_dependencies                   post-update   Include views data table provider in views dependencies.
 ------------------------- ----------------------------------------------- ------------- -------------------------------------------------------------------------------------------------------------------------------------------------
 Do you wish to run the specified pending updates? (yes/no) [yes]:
 >

 [notice] Update started: address_post_update_clear_country_list
 [ok] Update completed: address_post_update_clear_country_list
 [notice] Update started: address_post_update_convert_names_subdivisions
 [ok] Update completed: address_post_update_convert_names_subdivisions
 [notice] Update started: adminimal_admin_toolbar_post_update_avoid_custom_font
 [ok] Update completed: adminimal_admin_toolbar_post_update_avoid_custom_font
 [notice] Update started: block_content_post_update_add_views_reusable_filter
 [ok] Update completed: block_content_post_update_add_views_reusable_filter
 [notice] Update started: block_post_update_disable_blocks_with_missing_contexts
 [ok] Update completed: block_post_update_disable_blocks_with_missing_contexts
 [notice] Update started: block_post_update_disabled_region_update
 [ok] Update completed: block_post_update_disabled_region_update
 [notice] Update started: block_post_update_fix_negate_in_conditions
 [ok] Update completed: block_post_update_fix_negate_in_conditions
 [notice] Update started: comment_post_update_enable_comment_admin_view
 [error]  'action' entity with ID 'comment_delete_action' already exists.
 [error]  Update failed: comment_post_update_enable_comment_admin_view
 [error]  Update aborted by: comment_post_update_enable_comment_admin_view
 [error]  Finished performing updates.
8
  • It means that the result of drupal_get_installed_schema_version('system') is -1. So in your config, the system module is designated as being version -1, instead of the expected 8000 or greater.
    – Clive
    Feb 6, 2019 at 12:12
  • How can I verify this?
    – Kartagis
    Feb 6, 2019 at 12:13
  • Inspect the result of that line of code
    – Clive
    Feb 6, 2019 at 12:13
  • What is system in this context? I don't have such a table.
    – Kartagis
    Feb 6, 2019 at 12:14
  • 2
    It's in config not a table any more. You can get it via drush cget core.extension module. There's no logical reason it would be -1, unless the original installation failed in some way, or someone/something has manually edited the value. If you want to know what happened, you'll have to go back over backups/git logs etc
    – Clive
    Feb 6, 2019 at 12:35

1 Answer 1

1

You can reset it with Drush

drush ev drupal_set_installed_schema_version('system', 8000)

OR

If you have Devel installed with, you can execute the following PHP Code

drupal_set_installed_schema_version('system', 8000);
2
  • 2
    Careful, unless you’re going from 8.0 that’s likely to cause a lot of errors. OP needs to determine the correct schema version to update the config to, based on what version they’ve upgraded from. Otherwise you’ll be running a lot of updates that have already run
    – Clive
    Feb 6, 2019 at 13:20
  • It was because I truncated key_value table due to getting duplicates when running my custom code.
    – Kartagis
    Feb 16, 2019 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.