Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternate Flysystem drivers leave watchdog error, do not work #1166

Open
mjordan opened this issue Jun 18, 2019 · 9 comments
Open

Alternate Flysystem drivers leave watchdog error, do not work #1166

mjordan opened this issue Jun 18, 2019 · 9 comments
Labels
Type: documentation provides documentation or asks for documentation.

Comments

@mjordan
Copy link
Contributor

mjordan commented Jun 18, 2019

At iCamp_EU we've been trying to get the Dropbox, ZIp, and SFTP Flysystem drivers to work. None are, and they all appear to leave the same error in the watchdog:

Symfony\Component\HttpKernel\Exception\HttpException: The destination directory does not exist, could not be created, or is not writable in Drupal\islandora\MediaSource\MediaSourceService->putToNode() (line 297 of /var/www/html/drupal/web/modules/contrib/islandora/src/MediaSource/MediaSourceService.php).

Here are two of the configurations we're trying. They are from settings.php:

  'zipexample' => [
    'driver' => 'zip',
    'config' => [
      'location' => '/tmp/ziptest.zip',
    ],
  ],

'sftpexample' => [
    'driver' => 'sftp',
    'config' => [
      'host' => 'xxx.xxx.xxx.xxx',
      'username' => 'islandora',
      // 'password' => 'password', // Only one of 'password' or 'privatekey' is needed.
      'privateKey' => '/home/vagrant/.ssh/id_rsa',
      'root' => '/home/islandora',

      // Optional
      'port' => 21,
      'timeout' => 10,
    ],
    'cache' => TRUE, // Cache filesystem metadata.
  ],

Can anyone replicate this error?

@mjordan
Copy link
Contributor Author

mjordan commented Jun 18, 2019

Some initial debugging here by @ibrahimab is showing that resolving the realpath of the filesystem URIs is returning FALSE.

@dannylamb
Copy link
Contributor

@mjordan I can give it a go with zip and see what pops.

@mjordan
Copy link
Contributor Author

mjordan commented Jun 18, 2019 via email

@ppound
Copy link
Member

ppound commented Jun 18, 2019

We tried it successfully with Amazon S3. I'll see if I can find our ticket to see what I did but If I remember correctly there were some underlying dependencies that needed to be installed. Not sure about the sftp or others but for S3 needed to do composer require league/flysystem-aws-s3-v3

@dannylamb
Copy link
Contributor

@mjordan I can confirm zip is failing. This is what I'm getting in the logs:

The upload directory zip://2019-06 for the file field field_media_image could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.

@ibrahimab
Copy link

@dannylamb can you confirm that calling \Drupal::service('file_system')->realpath('zip://') is also returning false? I got the feeling the resolving of these uri's are the reason it is failing.

@dannylamb
Copy link
Contributor

@ibrahimab yep

vagrant@claw:/var/www/html/drupal/web$ drush php:cli
Psy Shell v0.9.9 (PHP 7.2.19-1+ubuntu16.04.1+deb.sury.org+1 — cli) by Justin Hileman
>>> \Drupal::service('file_system')->realpath('zip://');
=> false

@ibrahimab
Copy link

I have installed a fresh Drupal 8 project and installed flysystem. The same problem occurs, so it seems this has nothing to do with islandora, but the project itself. I also took a look at the flysystem repository and the last commit was 2 years ago. It would be wise to use another project. The other option would be taking over maintaining flysystem.

@ppound
Copy link
Member

ppound commented Jul 3, 2019

The SFTP driver seems to work if you paste the contents of the key instead of a file path for the privateKey config and comment out the port (or change it to 22 unless ssh really is running on port 21 on your SFTP server, I also commented out the timeout and cache for our tests ). I tried this on a remote build not a vagrant virtualbox install (I'm not sure if networking would cause issues when using vagrant vm?).

@kstapelfeldt kstapelfeldt added Type: documentation provides documentation or asks for documentation. and removed documentation labels Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: documentation provides documentation or asks for documentation.
Projects
Development

No branches or pull requests

5 participants