I met following error during a migration tryout:

Migration failed with source plugin exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ua.alias' in 'field list'

The following code fixes an issue:

diff d7.inc
51,52c51,52
< ->fields('ua', array('alias'))
< ->condition('source', $source)
---
> ->fields('ua', array('dst'))
> ->condition('src', $source)

Comments

pmackay’s picture

I've experienced a similar issue to this (with a different column not found). Even when I select the source fields in the UI to exclude them related to that column. Is there a more general issue here, as the code change above looks specific to the ua.alias column not found, but I get a different column.

mikeryan’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

https://drupal.org/patch/submit

It appears that your suggested patch would change the D7 handling code from 'alias' and 'source' to the D6 column names of 'dst' and 'src', which doesn't seem to make sense?

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Harry Slaughter’s picture

Status: Closed (cannot reproduce) » Needs review

Disregard, does not apply :)

The attached patch does fix the 'unknown column' problem. The field names for the d6 url_alias table are wrong. They should be src and dst NOT source and alias.

I'm still using 7.x-2.1-beta1+37-dev, so my apologies if this has been fixed.

BTW, Also noticed the same problem with d6 taxonomy tables being referenced with d7 names.

mikeryan’s picture

Status: Needs review » Closed (cannot reproduce)
webdrips’s picture

Version: 7.x-2.x-dev » 7.x-2.1
Status: Closed (cannot reproduce) » Active

Hate to re-open this issue, but I'm getting the exact same error when trying to use D2D to migrate users using the latest stable versions of Migrate, Migrate D2D, etc.

If the migration is run without using the D2D UI, the users migrate fine. It's only when the D2D path is used (and we select a small subset of roles to migrate), do we encounter the above issue.
dD

Note: when using the D2D UI, we're only opting to have the users migrated, and everything else is set to "Do not import".

mikeryan’s picture

Title: Migration failed with source plugin exception: SQLSTATE[42S22] » Migration failed with unknown column 'ua.alias'
Status: Active » Postponed (maintainer needs more info)

@webdrips: Are you migrating from D6 or D7? When you say it's "run without using the D2D UI", you mean you have a programmed version of the migration that works, but when you use the UI to configure the migration it fails?

webdrips’s picture

@mikeryan

Yes I am migrating from D6 to D7, and Yes to your second question. I can use the "original" migrate UI (or drush) to run the user migration, but when I use the D2D "wizard", select a few roles to migrate, then attempt the migration, I get the exact error above.

I don't mind using the original method, but then this ticket will turn into a support question about how to properly modify the query :)

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Active

Always reset the status to Active when providing more info to a "Postponed (maintainer needs more info)".

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

So, you are migrating from Drupal 6, and getting the exact error message "Unknown column 'ua.alias' in 'field list'"? The only place migrate_d2d selects ua.alias is in DrupalVersion7::getPath(), so it seems like somehow it thinks your Drupal 6 database is actual a Drupal 7 database. You don't have a mix of Drupal 6 and Drupal 7 tables in the same database, do you? Specifically, is it possible you have a table named 'filter_format' (the D7 name) in your D6 database (the table name was 'filter_formats' in previous versions)?

webdrips’s picture

Status: Postponed (maintainer needs more info) » Active

@MikeRyan,

Yes I was getting that exact same message. Funny you mentioned D7 being mixed with D6, because when I was searching the table descriptions for some of the table columns in the D6 database, I was coming up with D7 descriptions straight from the D7 API. I wonder if someone actually made an attempt to upgrade the D6 database, then abandoned that in favor of migration? Or maybe it's that some of the modules used D7 descriptions when they were in early alpha. I'm not sure, but I can definitely say without a doubt that the modules installed/active are all D6 versions based on drush pm-list --type=module --no-core --status=enabled.

In any case, the fix that worked was to delete a problematic row from the database:
drush sql-query "DELETE FROM content_node_field_instance WHERE field_name = 'field_thumbnail' AND type_name = 'product'"

Apparently the field_thumbnail field was never properly deleted from a content type named product. Since I solved the issue that way, I'm not sure it's worth looking into the root cause or not, but I'm willing to test out an alternate solution. Otherwise, please just close the issue.

mikeryan’s picture

Category: Bug report » Support request
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

araujo.guntin’s picture

Hi,

I'm still with this error... what kind of update I should download? I'm working with 7.x-2.1 version

thanks,

aitala’s picture

Hi,

I'm getting this issue now as well.

Error is:

Migration for DrupalNode7Migration failed with source plugin exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ua.alias' in 'field list', in /home/ipmsusa3/public_html/drupal7/includes/database/database.inc:2227

I also notice on the Migration Dashboard - "Source system" is Drupal 7, but the site is Drupal 6. Are there other tables other than "filter_format", which I renamed, that could be a problem?

Thanks,
Eric