You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using Drupal Migrate to write files from a Guzzle stream source to a Fedora destination via FlySystem.
For the first instance of any directory where we write to a file path, I see an attempt to check the directory exists in Fedora logs (HEAD /media/2024-10). My notes record that this fails on initial call and succeeds on subsequent ones. (This might make sense if the first successful upload implicitly creates the directory?)
At this point I'm still debugging, but what I think happens is:
\Drupal\Core\File\FileSystem::prepareDirectory is called with the directory path, eg 2024-10
\Drupal\Core\File\FileSystem::mkdir() is called via @$this->mkdir()
is_dir() is used to check if the directory exists, returning FALSE if it does not
When does this issue occur?
If the destination file is in a subdirectory of the Fedora location, and the attempt to write is the first attempt to that subdirectory.
This may be more visible in new environments, or those which have been reset for testing (eg local dev). I was not successful in reproducing this on the sandbox environment at sandbox.islandora.ca (Drupal 10.2.7, Islandora 2.12.2).
Which page does it occur on?
I believe this can be reproduced on the Media file attachment form as well as from Drupal migrate, provided that the Media's File field has a directory prefix configured (eg at
What happens?
First attempt: error 403 to the Fedora adapter, "Client error: Failed to save a Fedora resource to some_dir/sample.jpg."
Second attempt: success
To whom does it occur (anonymous visitor, editor, administrator)?
User uploading a file into Fedora via Drupal interfaces.
What did you expect to happen?
Create the directory on the fly, and write the file.
Which version of Islandora are you using?
2.12.3
Any related open or closed issues to this bug report?
The text was updated successfully, but these errors were encountered:
xurizaemon
added a commit
to xurizaemon/islandora
that referenced
this issue
Oct 17, 2024
What steps does it take to reproduce the issue?
We're using Drupal Migrate to write files from a Guzzle stream source to a Fedora destination via FlySystem.
For the first instance of any directory where we write to a file path, I see an attempt to check the directory exists in Fedora logs (
HEAD /media/2024-10
). My notes record that this fails on initial call and succeeds on subsequent ones. (This might make sense if the first successful upload implicitly creates the directory?)At this point I'm still debugging, but what I think happens is:
\Drupal\Core\File\FileSystem::prepareDirectory
is called with the directory path, eg2024-10
\Drupal\Core\File\FileSystem::mkdir()
is called via@$this->mkdir()
is_dir()
is used to check if the directory exists, returning FALSE if it does notIf the destination file is in a subdirectory of the Fedora location, and the attempt to write is the first attempt to that subdirectory.
This may be more visible in new environments, or those which have been reset for testing (eg local dev). I was not successful in reproducing this on the sandbox environment at sandbox.islandora.ca (Drupal 10.2.7, Islandora 2.12.2).
I believe this can be reproduced on the Media file attachment form as well as from Drupal migrate, provided that the Media's File field has a directory prefix configured (eg at
User uploading a file into Fedora via Drupal interfaces.
Create the directory on the fly, and write the file.
Which version of Islandora are you using?
2.12.3
Any related open or closed issues to this bug report?
The text was updated successfully, but these errors were encountered: