backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 40 forks source link

Exception: The configuration directory in settings.php is specified as 'files/config_[some-random-CMI-ID-here]/active', but this directory is either empty or missing crucial files. #264

Closed klonos closed 3 years ago

klonos commented 10 years ago

Every time I try to install Backdrop, right after the stage of enabling modules (progress bar), I am greeted with this error page:

Error The website encountered an unexpected error. Please try again later.

Exception: The configuration directory in settings.php is specified as
'files/config_[some-random-CMI-ID-here]/active', but this directory is either empty or
missing crucial files. Check that the $config_directories variable is correct in settings.php. in
_backdrop_bootstrap_configuration() (line 2470 of /var/www/backdrop/core/includes/bootstrap.inc).
irinaz commented 3 years ago

Hi, I am testing migration from D7 to Backdrop on Pantheon platform. I am following steps in instructions here https://docs.backdropcms.org/documentation/step-3-upgrade-the-drupal-site I am using Pantheon UI to import db and import files (tab Database/files)

Screen Shot 2021-09-12 at 10 04 01 PM

In step 5 (copy files) files directory is created via import process

After I run Step 8 https://backdrop-example.com/update.php I get the following message

The configuration directory in settings.php is specified as './files/config_a1614e81308b9e6b86be181ef0914335/active', but this directory is either empty or missing crucial files. Check that the $config_directories variable is correct in settings.php.

I cannot make change suggested previously because pantheon has its workflow on updating db name/username/password when sync from dev/test/prod. I can also see folder files.pantheon_moved that looks like original files folder.

What might be best solution here?

Thanks, Irina

I changed this:

$database = 'mysql://backgropdpbuser:(password)@localhost/backdropdb';

to this:

$databases['default']['default'] = array ( 'database' => 'coastto1_backdropdb', 'username' => 'coastto1_backgropdpbuser', 'password' => '(password)', 'prefix' => '', 'host' => 'localhost', 'port' => '3306', 'driver' => 'mysql', );

and now the site is working correctly

Screen Shot 2021-09-12 at 10 08 44 PM
klonos commented 3 years ago

Hello @irinaz πŸ‘‹πŸΌ ...I'me reopening this issue, to draw some attention to it.

irinaz commented 3 years ago

Thanks!

On 9/13/21 3:08 PM, Greg Netsas wrote:

Reopened #264 https://github.com/backdrop/backdrop-issues/issues/264.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/backdrop/backdrop-issues/issues/264#event-5295754674, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATBT3OM3IIMZDEP66H35G3UBZY5DANCNFSM4ARKBDWA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Irina Zaks, Fibonacci Web Studio Web Developer and CoFounder

@.*** 650-387-0737

quicksketch commented 3 years ago

I think there may be an error in the documentation that affect Pantheon specifically. Instead of visiting https://backdrop-example.com/update.php, could you try visiting https://backdrop-example.com/core/update.php? The update.php file lives in a subdirectory in Backdrop. On any Apache host, we have a redirect in .htaccess that takes you to the right place, so a lot of devs haven't noticed its new location. Pantheon doesn't run Apache though, so that redirect is not automatic on that hosting platform.

irinaz commented 3 years ago

Nate, thanks! now I am getting different error - I think that I imported db correctly. Happy to give you access to pantheon dashboard if that would help troubleshoot this issue

PDOException: SQLSTATE[HY000]: General error: 1034 Incorrect key file for table 'url_alias'; try to repair it: ALTER TABLE {url_alias} CHANGE language langcode VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'The language code this alias is for; if ’und’, the alias will be used for unknown languages. Each Backdrop path can have an alias for each supported language.', ADD INDEX alias_langcode_pid (alias, langcode, pid), ADD INDEX source_langcode_pid (source, langcode, pid); Array ( ) in db_change_field() (line 3127 of /code/core/includes/database/database.inc).

https://dev-fibo-backdrop.pantheonsite.io/core/update.php

quicksketch commented 3 years ago

Great, I'm glad that was the big problem. I updated our upgrading documentation to include that missing /core/ directory in the instructions.

One of the first things Backdrop does before displaying the update.php page is fix the "url_alias" table, so this tells me you're on the right track.

I'm not sure why that error would be occurring though. A quick Google says it's one of two things:

Both answers from https://dba.stackexchange.com/questions/162969/ample-disk-space-with-error-1034-incorrect-key-file-for-table-table-name-tr

How many rows are in that table? Is it a very large number (millions?) Otherwise I think the likely solution is exactly what's recommended by the error: that the table needs repair. Use the Pantheon MySQL connection string to connect to MySQL through the command line, then run REPAIR TABLE url_alias. Then try loading update.php again.

irinaz commented 3 years ago

Nate, thanks a lot. The table should be small, this is site with 100 nodes and three views. Here is what I see when I connect to new backdrop db that I imported and run REPAIR TABLE url_alias.
+--------------------+--------+----------+---------------------------------------------------------+ | Table | Op | Msg_type | Msg_text | +--------------------+--------+----------+---------------------------------------------------------+ | pantheon.url_alias | repair | note | The storage engine for the table doesn't support repair | +--------------------+--------+----------+---------------------------------------------------------+ 1 row in set (0.07 sec)

I wonder if I should try to repair db locally and try to re-upload it?

jenlampton commented 3 years ago

By Default pantheon tries to run the config files in the /files/ directory with a random hash. I have a lot more success changing the config location to something I can count on for each pantheon site. I wrote a blog post about this here: https://www.jenlampton.com/blog/move-your-backdrop-site-to-pantheon#config-setup

irinaz commented 3 years ago

Hi Jen, that is very useful post, thanks! I worked through instructions in your post, modified them a little for moving D7 to Backdrop and documented them here. I am now getting the following error - I am not sure if I that is because I am moving D7 to Pantheon, not Backdrop The staging configuration directory (./config/staging) could not be found. Please make sure it exists and is properly referenced in settings.php. Not sure why this is happening - I am running /core/update.php not /update.php. Can this be related? Thanks again!

jenlampton commented 3 years ago

As long as you have placed the staging directory that that location, you should be fine. It sounds like maybe you haven't created it yet? (Likely not related to skipping the redirect for update.php)

irinaz commented 3 years ago

Jen, thanks, you are right, I did something wrong with directories/git ignore settings - I can see directories in my local setup but they did not get pushed via git. I added them in sftp mode, and now I am on to the next challenge with url_aliases (that is a different issue :) Thanks!

irinaz commented 3 years ago

@quicksketch , Looks like I cannot repair table on Pantheon. I used this command on local db and I get the same result "The storage engine for the table doesn't support repair ". I deleted all aliases for testing purposes in source D7 db and disabled path related modules. Still when I import db into backdrop and run https://dev-fibo-backdrop.pantheonsite.io/core/update.php I get the same error SQLSTATE[HY000]: General error: 1034 Incorrect key file for table 'url_alias';

What are my options at this point? Thanks a lot!!

Nate, thanks a lot. The table should be small, this is site with 100 nodes and three views. Here is what I see when I connect to new backdrop db that I imported and run REPAIR TABLE url_alias.

| pantheon.url_alias | repair | note | The storage engine for the table doesn't support repair |

I wonder if I should try to repair db locally and try to re-upload it?

jenlampton commented 3 years ago

@irinaz this looks like a fairly common problem for MySQL databases. A quick google of "The storage engine for the table doesn't support repair" shows lots of results. I would start there :)

It sounds you are focusing in on a separate problem now, and that it is a more general issue with your database (not a related to Backdrop, or even Drupal). This is an old issue relating to the database connection syntax in the settings.php file, and sounds unrelated to the problem you are facing now. (I'm going to close this again since there's not a problem with core that needs to be addressed here)

If you still need help, it might be good to start a specific conversation about database engines & repairing tables in the forum (or even on stack overflow?) where you're likely to get more help. Or ask in Zulip!

irinaz commented 3 years ago

@jenlampton , thanks, I will open new thread about the error SQLSTATE[HY000]: General error: 1034 Incorrect key file for table 'url_alias'; Thanks!!

bsharp-azhar commented 1 month ago

Hi there, I am trying to upgrade Drupal 7 to backdrop in my Windows environment. I have followed the steps mentioned here (https://docs.backdropcms.org/documentation/step-3-upgrade-the-drupal-site). I am trying to run http://my-domain/core/update.php. I am facing an error

\files\config_0debc0a99ba77bf3408f30954004a490\active could not be created or could not be made writable. To proceed with the installation, either create the directory and modify its permissions to make it writable, or adjust the permissions on the parent directory to allow the installer to create it automatically.

image

please help me out here.

Thanks !! Azhar

quicksketch commented 1 month ago

Hi @bsharp-azhar, I'm not very familiar with either XAMPP or running on Windows, but I think the problem is likely exactly what the error states. XAMPP is probably unable to write to C:\xampp_8_2\htdocs\backdrop_3\files, which is required to operate Backdrop. See if you can configure XAMPP to make that directory writable, or try moving where XAMPP runs to be under your Window user account's directory (C:\Users\<UserName>).

But overall, I'd recommend using DDEV instead of XAMPP, which has both excellent Windows support and Backdrop support: