Fatal error reading origin content

Created on 11 October 2024, 3 months ago

Problem/Motivation

After creating the connection to the D7 database, attempting to read origin nodes, vocabularies, paragraphs, or media results in "The website encountered an unexpected error. Try again later." Three entries are written to dblog when this happens, summarized in the first comment below.

Curiously, reading origin field collections is working β€” at least, the module is reading the data from the D7 site. Clicking a "Manage Fields Origin Field collections" button on that screen after reading throws the error, though.

I haven't tried debugging yet but I'm thinking I must be missing a setup step if it's working for other folks at all.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jmcintyre

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jmcintyre
  • πŸ‡ΊπŸ‡ΈUnited States jmcintyre

    dblog entries (just the PHP message and first stack trace item), in the order they're logged:

    Warning: Undefined array key "default" in Drupal\Core\Database\Database::openConnection() (line 454 of /app/web/core/lib/Drupal/Core/Database/Database.php)
    #0 /app/web/core/includes/bootstrap.inc(166): _drupal_error_handler_real(2, 'Undefined array...', '/app/web/core/l...', 454)
    
    Warning: Trying to access array offset on value of type null in Drupal\Core\Database\Database::openConnection() (line 454 of /app/web/core/lib/Drupal/Core/Database/Database.php)
    #0 /app/web/core/includes/bootstrap.inc(166): _drupal_error_handler_real(2, 'Trying to acces...', '/app/web/core/l...', 454)
    
    Drupal\Core\Database\DriverNotSpecifiedException: Driver not specified for this database connection: in Drupal\Core\Database\Database::openConnection() (line 455 of /app/web/core/lib/Drupal/Core/Database/Database.php).
    #0 /app/web/core/lib/Drupal/Core/Database/Database.php(191): Drupal\Core\Database\Database::openConnection('', 'default')
    
  • πŸ‡ͺπŸ‡ΈSpain Carlos Romero

    Hello,

    I think your connection configuration to the drupal 7 database is not correct.

    In the database entity configuration offered in the module, you have to put the data in the same way as when you add it in the settings.php file.

    There are many tutorials and documentation about how to do it.

    In the description of migrate wizard there is an image that shows how it should be:

    Although there is some data that I suppose will vary, such as the name of the database, user, password, host, port... adapt this data to what you need, you can see the settings.php file of your drupal7 to see what you need.

    If you are using Lando, as slcak has told me, verify that the connection to the drupal database from the drupal 10 docker console works with mysql.
    I use ddev for my local stack and from the drupal 10 docker console I write this:
    mysql -u db -p -h ddev-drupal7-db

    and I can connect to the drupal 7 database.

  • πŸ‡ΊπŸ‡ΈUnited States jmcintyre

    Thank you for your suggestions.

    I believe the settings for my D7 database β€” at least the ones I have entered β€” are correct, and that the connection is being made through Lando. If none of that were true the module would not be able to read anything from that database, and that is not the case. For instance, the module displays information it obtained about user roles and text formats when I visit those screens.

    Could it be that some of the fields on the database setup screen that are not marked required are, in fact, required for it to work? For instance, your screenshot shows the value "default" in the "target" field. In mine I've entered nothing. It is not immediately obvious to me what should go in all of those fields, as some of it seems to pertain to the D7 database and some to the D10 installation.

  • πŸ‡ͺπŸ‡ΈSpain Carlos Romero

    Hi, I don't understand why you are getting data from roles and text formats, but your database configuration is not correct.

    Seeing what is happening to you, I think it would be a good idea to set the fields as required.

    I don't understand why it is reading your roles and text formats, but I recommend trying to put the correct data in the database configuration and then test it.

    Sorry if it doesn't seem obvious what data to enter in those fields, but I assumed that it would be understood that it should be done as in the standard configuration for databases, with a quick search on Google I found this tutorial, for example:

    https://octahedroid.com/blog/drupal-7-drupal-10-full-step-step-migration...

    Take a look at it and do your tests.

  • πŸ‡ΊπŸ‡ΈUnited States jmcintyre

    Thank you. I think the problem is that I had not entered a value for 'namespace' in the form. When I added what's in my D10 settings.php.file into that field, the errors went away. Changing this issue type from bug report to support request and marking it closed.

    I think some improvements to the form could help other users avoid the problem I had. If I have time I will create a new issue.

Production build 0.71.5 2024