[PP-1] AM:A Drush command should execute migrations as user 1, just like the UI

Created on 23 October 2023, about 1 year ago
Updated 6 March 2024, 10 months ago

I'm encountering an issue importing private files using the drush ama:import --all command. The d7_file_private migration works fine for the initial file import, however the d7_file_entity:{default, image, video, audio}:private migrations fails for every file, with the error "You do not have access to the referenced entity".

This is not the case when using the web UI, presumably because it is being run as user 1.

This is possibly a similar issue to πŸ“Œ Run drush imports as user=1 RTBC in migrate_tools.

πŸ› Bug report
Status

Needs work

Version

1.9

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom Hephaestus

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

Merge Requests

Comments & Activities

  • Issue created by @Hephaestus
  • πŸ‡¬πŸ‡§United Kingdom Hephaestus
  • πŸ‡¬πŸ‡§United Kingdom Hephaestus
  • Assigned to wim leers
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    The d7_file_private migration works fine for the initial file import

    πŸ‘

    however the d7_file_entity:{default, image, video, audio}:private migrations fails for every file, with the error "You do not have access to the referenced entity".

    This is possibly a similar issue to #3134245: Run drush imports as user=1 in migrate_tools.

    Hm … interesting! That seems like a very plausible theory πŸ€”

  • Issue was unassigned.
  • Status changed to Postponed: needs info about 1 year ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Just to make sure: could you please run the "Private files" migration through the AM:A UI and let me know whether that works correctly? πŸ™

    (The AM:A UI is always used by user 1 so this should be the case. But I'd like to confirm that before digging in and working on this.)

    Thanks!

  • πŸ‡¬πŸ‡§United Kingdom Hephaestus

    Hi Wim, I can confirm that the private files migration works correctly through the AM:A UI, it's only when using drush ama:import that it fails with this error.

    Thanks!

  • Status changed to Active about 1 year ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    πŸ‘ Thanks, that was very fast!

    I am swamped this month, so I doubt I'd be able to get to this this month. Maybe in January. If you are willing to create an MR against src/Commands/AcquiaMigrateCommands.php, it could go a lot faster πŸ˜‡πŸ˜„

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί
  • First commit to issue fork.
  • Pipeline finished with Failed
    10 months ago
    Total: 258s
    #96800
  • Status changed to Needs work 10 months ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Thanks for the merge request, @jienckebd! πŸ₯³

    The logic changes look good β€” just some minor remarks and this'll be good to go 😊

  • Pipeline finished with Failed
    10 months ago
    Total: 658s
    #96806
  • Pipeline finished with Failed
    10 months ago
    Total: 2631s
    #96833
  • Pipeline finished with Failed
    10 months ago
    Total: 2373s
    #96835
  • Pipeline finished with Failed
    10 months ago
    Total: 921s
    #96878
  • Pipeline finished with Running
    10 months ago
    #96943
  • Pipeline finished with Failed
    10 months ago
    Total: 739s
    #96941
  • Pipeline finished with Canceled
    10 months ago
    Total: 313s
    #97045
  • Pipeline finished with Failed
    10 months ago
    Total: 716s
    #97051
  • Pipeline finished with Failed
    10 months ago
    Total: 3766s
    #97053
  • Pipeline finished with Failed
    10 months ago
    Total: 1305s
    #99928
  • Pipeline finished with Failed
    10 months ago
    Total: 1456s
    #99961
  • Pipeline finished with Failed
    10 months ago
    Total: 3161s
    #102783
  • Pipeline finished with Failed
    10 months ago
    Total: 879s
    #102816
  • Pipeline finished with Failed
    10 months ago
    Total: 783s
    #104471
  • Pipeline finished with Failed
    10 months ago
    Total: 867s
    #104502
  • Pipeline finished with Failed
    10 months ago
    Total: 778s
    #104514
  • Pipeline finished with Failed
    10 months ago
    Total: 681s
    #105410
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Investigating the first random failure in πŸ“Œ CI: frequent (random?) failures of InlineEntityFormCompatibilityTest in "πŸšοΈβ†’ 🏠 Contrib migrations Drupal 10 (next)" job Active . This issue is clearly blocked by that 😬

  • Pipeline finished with Failed
    10 months ago
    Total: 724s
    #109855
  • Pipeline finished with Failed
    10 months ago
    #112368
  • Assigned to jienckebd
  • πŸ‡ΊπŸ‡ΈUnited States jienckebd
  • πŸ‡ΊπŸ‡ΈUnited States jienckebd

    Updated MR to support both "drush ama:*" and "drush migrate:*" commands.

  • Pipeline finished with Failed
    10 months ago
    Total: 808s
    #112370
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Why are we modifying a drush built-in command in this MR now? 😱 And that even without linking to the corresponding upstream issue?! (I spot no @see)

    How do we ensure that this won't break when it is fixed upstream?

Production build 0.71.5 2024