File migration create ghost files I tested a migration from Drupal 6 to Drupal 8 on a local installation (2 differents multisites). Sometimes I get "ghost files" after running upgrade_d6_file.


  Processed 1444 items (1441 created, 0 updated, 3 failed, 0 ignored) - done with 'upgrade_d6_file'
  upgrade_d6_file Migration - 3 failed.


Then in admin/content/files, I get files like swadouotoclabruswuspitomiswulusliwokedaspamaslouawrotrephichophasichocutribuhostestus or wruhahachicregiwaspidristocospopowrucrekefrocojegephehoshapracocrewafrispugedrachupuclushipreclochoshusiclastewracrislumufraswiheracribra.

How can I fix this issue?

EDIT1:
In my use case, with a custom node content migration.Not sure about using the Skip on empty option. However file exist, ghost files are created.

id: upgrade_d6_node_diapo_hp
label: Nodes
audit: true
migration_tags:
  - Drupal 6
  - Content
  - Migration_CE
migration_group: migrate_drupal_6_ce
source:
  plugin: d6_node
  node_type: diapo_hp
process:
  # In D6, nodes always have a tnid, but it's zero for untranslated nodes.
  # We normalize it to equal the nid in that case.
  # @see \Drupal\node\Plugin\migrate\source\d6\Node::prepareRow().
  # If you are using this file to build a custom migration consider removing
  # the nid and vid fields to allow incremental migrations.
  nid: tnid
  vid: vid
  langcode:
    plugin: default_value
    source: language
    default_value: "und"
  title: title
  uid: node_uid
  status: status
  created: created
  changed: changed
  promote: promote
  sticky: sticky
  body/format:
    plugin: migration_lookup
    migration: d6_filter_format
    source: format
  body/value: body
  body/summary: teaser
  revision_uid: revision_uid
  revision_log: log
  revision_timestamp: timestamp

  #OK        
  field_diapo_home:
    plugin: d6_field_file
    source: field_diapo_home
    process:
      target_id:
        plugin: migration_lookup
        migration: upgrade_d6_file
        source: fid
        -
        plugin: skip_on_empty
        method: process



#  unmapped d6 fields.
#  tnid
#  translate
#  moderate
#  comment

destination:
  plugin: entity:node
migration_dependencies:
  required:
    - upgrade_d6_user
    - upgrade_d6_node_type
    - upgrade_d6_node_settings
    - upgrade_d6_filter_format
  optional:
    - fields_instance_widget
    - fields_formatter_settings
Try it like this:

  field_diapo_home:
  -
    plugin: d6_field_file
    source: field_diapo_home
    migration: upgrade_d6_file
  -
    plugin: skip_on_empty
    method: process