bondjimbond / islandora_westvault

Automated preservation for Islandora objects
GNU General Public License v3.0
1 stars 1 forks source link

Islandora Westvault works -- but Bagit doesn't #33

Closed bondjimbond closed 5 years ago

bondjimbond commented 5 years ago

I'm testing Islandora Westvault in my Arca multisite production environment... And while my drush commands and everything work beautifully, Islandora Bagit doesn't! The files it produces are empty aside from the info text files added by the plugins.

I've posted about this problem in the Google group: https://groups.google.com/d/topic/islandora/Hp3kUYTJeWQ/discussion

Any ideas what's happening here, @mjordan?

mjordan commented 5 years ago

The function that gets the datastreams is https://github.com/mjordan/islandora_bagit/blob/7.x/islandora_bagit.module#L1029, which uses the normal Tuque API and does not directly point to localhost for fedora. Sorry, I don't know what could be causing it. Stupid question, but are you sure you have enabled some plugins?

mjordan commented 5 years ago

Some Islandora Bagit plugins that is.

bondjimbond commented 5 years ago

Yep, I've enabled each plugin. The Bagit configuration in my production environment is the same as in my Vagrant machine (which works just fine).

bondjimbond commented 5 years ago

Turns out it's a permissions issue on /tmp/islandora_bagit_temp - but it's a hard one to correct.

IF ownership on /tmp/islandora_bagit_temp is "apache apache":

IF ownership on /tmp/islandora_bagit_temp is "myuser mygroup":

Is there a way to set up ownership on this directory that allows bags to be created both ways??

mjordan commented 5 years ago

You could create a group that has write permissions on the Bagit temp dir, then add both apache user and the user running drush to that new group.

bondjimbond commented 5 years ago

Hm, I gave that a try -- but it doesn't work:

Result: only the owner user can get bags working. If owner is apache, it works via UI. If owner is me, it works in drush.

It seems that only the owner (not the group) has full permission to the directory... is that weird?

mjordan commented 5 years ago

Did you also chmod -R g+w?

bondjimbond commented 5 years ago

I did chmod 775 -- does that do the same thing, or are the permissions different?

mjordan commented 5 years ago

What do your error logs say now?

mjordan commented 5 years ago

-R is recursive, you probably should include it.

bondjimbond commented 5 years ago

Same as ever. With apache as owner and bagitusers as group, UI bags are fine. Drush fails. This is my drush output:

$ cd /var/www/drupal7/sites/irbu.arcabc.ca && drush -u 1 westvault-bagit mkdir(): Permission denied islandora_bagit.module:341 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/DC.bin): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] mkdir(): Permission denied plugin_object_archivematica_transfers.inc:33 [warning] mkdir(): Permission denied plugin_object_archivematica_transfers.inc:34 [warning] rename(/tmp/islandora_bagit_tmp/0d26ebd/DC.xml,/tmp/islandora_bagit_tmp/0d26ebd/metadata/dublincore.xml): No such file or directory [warning] plugin_object_archivematica_transfers.inc:37 copy(/tmp/islandora_bagit_tmp/0d26ebd/metadata/dublincore.xml): failed to open stream: No such file or directory bagit.php:438 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/RELS-EXT.rdf): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/MODS.bin): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/DC.bin): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/PDF.pdf): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/TN.jpg): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/PREVIEW.jpg): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/FULL_TEXT.txt): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/POLICY.bin): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/PRESERVATION.xml): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] file_put_contents(/tmp/islandora_bagit_tmp/0d26ebd/foo.xml): failed to open stream: No such file or directory plugin_object_ds_add_file.inc:36[warning] copy(/tmp/islandora_bagit_tmp/0d26ebd/foo.xml): failed to open stream: No such file or directory bagit.php:438 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/RELS-EXT.rdf): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/MODS.bin): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/DC.bin): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/PDF.pdf): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/TN.jpg): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/PREVIEW.jpg): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/FULL_TEXT.txt): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/POLICY.bin): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] fopen(/tmp/islandora_bagit_tmp/0d26ebd/PRESERVATION.xml): failed to open stream: No such file or directory HttpConnection.php:752 [warning] curl_setopt(): supplied argument is not a valid File-Handle resource HttpConnection.php:764 [warning] file_put_contents(/tmp/islandora_bagit_tmp/0d26ebd/foxml.xml): failed to open stream: No such file or directory plugin_object_foxml.inc:51 [warning] copy(/tmp/islandora_bagit_tmp/0d26ebd/foxml.xml): failed to open stream: No such file or directory bagit.php:438 [warning] Bag created and saved at sites/irbu.arcabc.ca/files/Bag-irbu_35.tgz [status] Files added: metadata/dublincore.xml, foo.xml, foxml.xml

mjordan commented 5 years ago

As a test (not in production), make the Bagit temp directory world writable and see if that works. then you know for sure it's a permissions problem an you can progressively dial back the permissions until you get something that works but is not so permissive.

bondjimbond commented 5 years ago

OK, more weirdness... After going back and forth between apache:apache and brandonw:admins trying to figure out the problem, it suddenly started working on both sides without any additional configuration.

This whole process has been pretty strange, but hey, it's working.

All that's left, I think, is either #29 or updating Islandora Bagit for paged and compound objects.