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

Fixes for running provision on an existing site. #210

Merged
merged 15 commits into from
May 31, 2022
Merged

Conversation

alxp
Copy link
Contributor

@alxp alxp commented Mar 30, 2022

GitHub Issue: (link)

#2070: Updating a site via the Playbook fails due to field_abstract type mismatch

Also fixes error where Grok clone fails with error "Would clobber existing tag."

  • Other Relevant Links (Google Groups discussion, related pull requests,
    Release pull requests, etc.)

What does this Pull Request do?

Fixes so that the playbook will run without error on an existing site.
Fixes a number of errors encountered when running the playbook on an existing Islandora installation.

What's new?

  • Do not attempt to re-import features
  • Fix grok clone error "This would clobber an existing branch".
  • Does this change require documentation to be updated?

  • no (No where is the behaviour of re-importing the features documented)

  • Does this change add any new dependencies?
    no

  • Does this change require any other modifications to be made to the repository
    no

  • Could this change impact execution of existing code?

No

How should this be tested?

If available, run the playbook on an existing Islandora site with the standard install profile.

Also run the playbook as a fresh installation.

Make sure derivative generation works as expected.

Additional Notes:

Note that this PR includes the recent change to move from Karaf to the one-jar Alpaca, so this testing may uncover bugs relating to that update.

Interested parties

Tag (@ mention) interested parties or, if unsure, @Islandora-Devops/committers

#2070: Updating a site via the Playbook fails due to field_abstract type mismatch

Grok clone fails with error "Would clobber existing tag."
@whikloj
Copy link
Member

whikloj commented Apr 1, 2022

@alxp is there a version of islandora_defaults I could set here to get me into a pre-changed state to test this?

@alxp
Copy link
Contributor Author

alxp commented Apr 4, 2022

I've tried testing by doing the following, seeing a new error:

On a fresh install, check out the last commit before Alpaca changes:

3e502a3

and run

vagrant up

Then checkout 2070-update-site-fixes branch and run

vagrant provision 

again.

Currently seeing this error:

TASK [Islandora-Devops.crayfish : Build crayfish code including dependencies] ***
Monday 04 April 2022  10:38:41 -0300 (0:00:01.906)       0:05:59.160 ********** 
failed: [default] (item=Houdini) => {"ansible_loop_var": "item", "changed": false, "item": "Houdini", "msg": "Do not run Composer as root/super user! See https://getcomposer.org/root for details For additional security you should declare the allow-plugins config with a list of packages names that are allowed to run code. See https://getcomposer.org/allow-plugins You have until July 2022 to add the setting. Composer will then switch the default behavior to disallow all plugins. Installing dependencies from lock file Verifying lock file contents can be installed on current platform. In PackageFilter.php line 125: Undefined index: splits install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]", "stdout": "Do not run Composer as root/super user! See https://getcomposer.org/root for details\nFor additional security you should declare the allow-plugins config with a list of packages names that are allowed to run code. See https://getcomposer.org/allow-plugins\nYou have until July 2022 to add the setting. Composer will then switch the default behavior to disallow all plugins.\nInstalling dependencies from lock file\nVerifying lock file contents can be installed on current platform.\n\nIn PackageFilter.php line 125:\n                           \n  Undefined index: splits  \n                           \n\ninstall [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]\n\n", "stdout_lines": ["Do not run Composer as root/super user! See https://getcomposer.org/root for details", "For additional security you should declare the allow-plugins config with a list of packages names that are allowed to run code. See https://getcomposer.org/allow-plugins", "You have until July 2022 to add the setting. Composer will then switch the default behavior to disallow all plugins.", "Installing dependencies from lock file", "Verifying lock file contents can be installed on current platform.", "", "In PackageFilter.php line 125:", "                           ", "  Undefined index: splits  ", "                           ", "", "install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]", ""]}
ok: [default] => (item=Milliner)
ok: [default] => (item=Hypercube)
ok: [default] => (item=Homarus)
ok: [default] => (item=Recast)

PLAY RECAP *********************************************************************
default                    : ok=321  changed=21   unreachable=0    failed=1    skipped=248  rescued=0    ignored=0   

Monday 04 April 2022  10:38:58 -0300 (0:00:16.169)       0:06:15.330 ********** 
=============================================================================== 
geerlingguy.drupal : Install dependencies with composer require (this may take a while). - 122.42s
Islandora-Devops.crayfish : Build crayfish code including dependencies -- 16.17s
geerlingguy.solr : restart solr ---------------------------------------- 12.03s
install extra packages ubuntu ------------------------------------------ 11.66s
Islandora-Devops.crayfish : Install requisite packages ----------------- 10.56s
Islandora-Devops.fits : Downloading FITS executables -------------------- 9.28s
Islandora-Devops.drupal-openseadragon : Install Openseadragon with composer --- 6.52s
install python ---------------------------------------------------------- 5.50s
Copy solr config files -------------------------------------------------- 5.44s
install aptitude -------------------------------------------------------- 3.31s
Gathering Facts --------------------------------------------------------- 2.99s
geerlingguy.git : Ensure git is installed (Debian). --------------------- 2.40s
geerlingguy.apache : Ensure Apache is installed on Debian. -------------- 2.38s
geerlingguy.apache : Ensure Apache is installed on Debian. -------------- 2.37s
geerlingguy.git : Ensure git is installed (Debian). --------------------- 2.20s
Islandora-Devops.grok : Clone Grok -------------------------------------- 2.19s
Islandora-Devops.fcrepo-syn : Download syn jar file --------------------- 2.13s
gather facts ------------------------------------------------------------ 2.08s
geerlingguy.php : Ensure configuration directories exist. --------------- 2.01s
Islandora-Devops.crayfish : Install crayfish code ----------------------- 1.91s
Ansible failed to complete successfully. Any error output should be
visible above. Please fix t

Unsure why this hasn't been a problem before.

@alxp
Copy link
Contributor Author

alxp commented Apr 6, 2022

This is opening a few cans of worms it looks like.

After fixing it so that the Crayfish application's file tree is not owned by root, composer install on each of the Crayfish apps is failing with an error in Houdini:


vagrant@islandora8:/var/www/html/Crayfish/Houdini$ composer install
symfony/flex contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "symfony/flex" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] yes
y - add package to allow-plugins in composer.json and let it run immediately
n - add package (as disallowed) to allow-plugins in composer.json to suppress further prompts
d - discard this, do not change composer.json and do not allow the plugin to run
? - print help
Do you trust "symfony/flex" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] yes
y - add package to allow-plugins in composer.json and let it run immediately
n - add package (as disallowed) to allow-plugins in composer.json to suppress further prompts
d - discard this, do not change composer.json and do not allow the plugin to run
? - print help
Do you trust "symfony/flex" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] yes
y - add package to allow-plugins in composer.json and let it run immediately
n - add package (as disallowed) to allow-plugins in composer.json to suppress further prompts
d - discard this, do not change composer.json and do not allow the plugin to run
? - print help
Do you trust "symfony/flex" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.

In PackageFilter.php line 125:
                           
  Undefined index: splits  
                           

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]

vagrant@islandora8:/var/www/html/Crayfish/Houdini$ 

Looks like an outdated dependent according to this:

symfony/flex#890

@alxp alxp marked this pull request as draft April 6, 2022 14:56
@whikloj
Copy link
Member

whikloj commented Apr 7, 2022

Seems like maybe we need to upgrade Crayfish from Flex to Symfony

@whikloj
Copy link
Member

whikloj commented Apr 7, 2022

I'm hitting the drush conflict on the migrations piece when I go back to 3e502a3

TASK [Run migrations] **********************************************************
Thursday 07 April 2022  09:51:19 -0500 (0:00:00.740)       0:32:56.179 ******** 
fatal: [default]: FAILED! => {"changed": true, "cmd": ["/var/www/html/drupal/vendor/drush/drush/drush", "--root", "/var/www/html/drupal/web", "-y", "-l", "localhost:8000", "--userid=1", "mim", "--group=islandora"], "delta": "0:00:00.317594", "end": "2022-04-07 14:51:19.996858", "msg": "non-zero return code", "rc": 1, "start": "2022-04-07 14:51:19.679264", "stderr": "\n                                        \n  The \"--group\" option does not exist.  \n                                        ", "stderr_lines": ["", "                                        ", "  The \"--group\" option does not exist.  ", "                                        "], "stdout": "", "stdout_lines": []}

Workaround for failing symfony/flex update.
@alxp
Copy link
Contributor Author

alxp commented Apr 7, 2022

@whikloj Got past the migrate now that #211 is merged.

I'm using Vagrant snapshot to make this testing faster.

After checking out 3e502a3

I ran

$ vagrant snapshot save pre-alpac

Then checking out this PR's branch, and running

$ vagrant provision

Then if something fails to re-test I run

$ vagrant snapshot restore pre-alpaca

@alxp
Copy link
Contributor Author

alxp commented Apr 7, 2022

Finally got a clean Ansible playbook run to update a pre-Alpaca site.

new error:

This seems to be related to filehash, but if I now go to the Add Media page and choose a file, I get this error when hitting Save:

image

DBLog shows the following error:

TypeError: Argument 3 passed to Drupal\filehash\FileHash::hash() must be of the type bool, null given, called in /var/www/html/drupal/web/modules/contrib/filehash/filehash.module on line 65 in Drupal\filehash\FileHash->hash() (line 233 of /var/www/html/drupal/web/modules/contrib/filehash/src/FileHash.php)
#0 /var/www/html/drupal/web/modules/contrib/filehash/filehash.module(65): Drupal\filehash\FileHash->hash(Object(Drupal\file\Entity\File), NULL, NULL)
#1 [internal function]: filehash_file_create(Object(Drupal\file\Entity\File))
#2 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array(Object(Closure), Array)
#3 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'filehash')
#4 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith('file_create', Object(Closure))
#5 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(249): Drupal\Core\Extension\ModuleHandler->invokeAll('file_create', Array)
#6 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(901): Drupal\Core\Entity\EntityStorageBase->invokeHook('create', Object(Drupal\file\Entity\File))
#7 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(101): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('create', Object(Drupal\file\Entity\File))
#8 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php(1143): Drupal\Core\Entity\ContentEntityStorageBase->create(Array)
#9 /var/www/html/drupal/web/core/modules/file/src/Upload/FileUploadHandler.php(201): Drupal\Core\Entity\ContentEntityBase::create(Array)
#10 /var/www/html/drupal/web/core/modules/file/file.module(846): Drupal\file\Upload\FileUploadHandler->handleFileUpload(Object(Drupal\file\Upload\FormUploadedFile), Array, 'fedora://2022-0...', 0)
#11 /var/www/html/drupal/web/core/modules/file/file.module(722): file_save_upload('field_media_ima...', Array, 'fedora://2022-0...', NULL, 0)
#12 /var/www/html/drupal/web/core/modules/file/file.module(1447): _file_save_upload_from_form(Array, Object(Drupal\Core\Form\FormState))
#13 /var/www/html/drupal/web/core/modules/file/src/Element/ManagedFile.php(76): file_managed_file_save_upload(Array, Object(Drupal\Core\Form\FormState))
#14 /var/www/html/drupal/web/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php(323): Drupal\file\Element\ManagedFile::valueCallback(Array, Array, Object(Drupal\Core\Form\FormState))
#15 [internal function]: Drupal\file\Plugin\Field\FieldWidget\FileWidget::value(Array, Array, Object(Drupal\Core\Form\FormState))
#16 /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(1258): call_user_func_array(Array, Array)
#17 /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(1000): Drupal\Core\Form\FormBuilder->handleInputElement('media_image_add...', Array, Object(Drupal\Core\Form\FormState))
#18 /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(1070): Drupal\Core\Form\FormBuilder->doBuildForm('media_image_add...', Array, Object(Drupal\Core\Form\FormState))
#19 /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(1070): Drupal\Core\Form\FormBuilder->doBuildForm('media_image_add...', Array, Object(Drupal\Core\Form\FormState))
#20 /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(1070): Drupal\Core\Form\FormBuilder->doBuildForm('media_image_add...', Array, Object(Drupal\Core\Form\FormState))
#21 /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(574): Drupal\Core\Form\FormBuilder->doBuildForm('media_image_add...', Array, Object(Drupal\Core\Form\FormState))
#22 /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm('media_image_add...', Array, Object(Drupal\Core\Form\FormState))
#23 /var/www/html/drupal/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\media\MediaForm), Object(Drupal\Core\Form\FormState))
#24 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#25 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#26 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#27 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#28 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#29 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#30 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#31 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /var/www/html/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /var/www/html/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /var/www/html/drupal/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#38 /var/www/html/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#39 /var/www/html/drupal/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#40 {main}

This is still occurring after running drush updatedb which has some file file hash related changes.

Investigating further.

@misilot
Copy link
Contributor

misilot commented Apr 7, 2022

@alxp hope you don't mind me putting my findings in here. You mentioned this PR in slack fixing some crawfish things.

This fixes some steps in the new install but as is, it errors out at below because of permission issues. I am pretty sure this is because of the removal of the become. I am going to try removing that commit and running again.

TASK [Islandora-Devops.crayfish : Install crayfish code] ***************************************************************************************************************************************************
fatal: [default]: FAILED! => {"changed": false, "cmd": "/usr/bin/git clone --origin origin https://github.com/Islandora/Crayfish.git /var/www/html/Crayfish", "msg": "Cloning into '/var/www/html/Crayfish'...\n/var/www/html/Crayfish/.git: Permission denied", "rc": 1, "stderr": "Cloning into '/var/www/html/Crayfish'...\n/var/www/html/Crayfish/.git: Permission denied\n", "stderr_lines": ["Cloning into '/var/www/html/Crayfish'...", "/var/www/html/Crayfish/.git: Permission denied"], "stdout": "", "stdout_lines": []}

Update

Same error even putting back in the become: yes

Update:

Put back the commit to remove become: yes
Updated the following task to be crayfish_user instead of webserver_app_user

- name: Fix Crayfish directory ownership
  file:
    state: directory
    path: "{{ crayfish_install_dir }}"
    owner: "{{ crayfish_user }}"
    group: "{{ crayfish_user }}"
    mode: "g+rw"
    recurse: yes
    force: yes
  become: true

also

  become: true

the following tasks (since no longer running as root) and become_user doesn't assume become for some of the roles

  • - name: Install crayfish code
  • - name: Build crayfish code including dependencies
  • - name: Install crayfish httpd config file
  • - name: Symlink crayfish httpd config file into action

@misilot
Copy link
Contributor

misilot commented Apr 7, 2022

I created a PR with the changes I had to make for this PR to install a new site. Feel free to merge/rebase later as needed. Thanks!

@alxp
Copy link
Contributor Author

alxp commented Apr 7, 2022

Glad you got it working, I'll take a look at the changes tomorrow.

Thanks!

@alxp
Copy link
Contributor Author

alxp commented Apr 8, 2022

Looks like another problem with Filehash and default configs.

This function call in filehash.module is passing NULL in argument 3 which results in a type mismatch:

function filehash_file_create(EntityInterface $file): void {
  Drupal::service('filehash')->hash($file, NULL, Drupal::config('filehash.settings')->get('original'));
}

@alxp
Copy link
Contributor Author

alxp commented Apr 8, 2022

Opened issue on Drupal dot org: Can't upload files after Installing File Hash 1.x, then updating to 2.x

@alxp alxp marked this pull request as ready for review April 26, 2022 00:15
@alxp
Copy link
Contributor Author

alxp commented Apr 26, 2022

Resolved a file ownership problem with Alpaca and its log folder.

This now works with the testing instructions above. Can verify that new data media get their derivatives generated, and it is Alpaca that is doing it.

Other problems identified with pinning a Drupal stable version and importing features on a fresh site I will deal with in separate tickets.

Screen shot showing derivatives and the Alpaca log

@whikloj
Copy link
Member

whikloj commented May 4, 2022

Ok I pulled an old version of islandora-playbook and when upgrading it to this PR I hit this one.

TASK [Islandora-Devops.fits : Install FITS Microservice from Github] ***********
Wednesday 04 May 2022  15:29:07 -0500 (0:00:00.314)       0:05:54.471 ********* 
fatal: [default]: FAILED! => {"changed": false, "msg": "Failed to set a new url https://github.com/roblib/CrayFits.git for origin:  fatal: unsafe repository ('/var/www/html/CrayFits' is owned by someone else)\nTo add an exception for this directory, call:\n\n\tgit config --global --add safe.directory /var/www/html/CrayFits\n"}

I didn't hit this last time, so I'm not sure if I did something different. I'm going to try again, but thought I would note this.

@misilot
Copy link
Contributor

misilot commented May 4, 2022 via email

@misilot
Copy link
Contributor

misilot commented May 4, 2022

You will probably need to add something like the following

- name: "Get git config global safe directories dir"
  shell: "git config --global --get-all safe.directory || echo ''"
  register: "__git_config_global_safe_dir"

- name: "Set Fixity source directory as git safe dir"
  command: "git config --global --add safe.directory {{ crayfits_home }}/CrayFits"
  when:
    - crayfits_home + '/CrayFits' not in __git_config_global_safe_dir.stdout_line

around this line https://github.com/Islandora-Devops/islandora-playbook/blob/dev/roles/internal/Islandora-Devops.fits/tasks/build-fits-site.yml#L26

@alxp
Copy link
Contributor Author

alxp commented May 5, 2022

Thanks @misilot , the announcement of the vulnurability is here: https://github.blog/2022-04-12-git-security-vulnerability-announced/

CrayFits is owned by www-data which is what we want I think, but the command will be being run by Vagrant, so adding the safe directory config option is probably the correct one. I'll put it in and push it up.

@alxp
Copy link
Contributor Author

alxp commented May 5, 2022

This is coming up further along the build process also, ironically in Alpaca is where it appears next:

TASK [Islandora-Devops.alpaca : Clone CLAW Alpaca] *****************************
Thursday 05 May 2022  09:53:14 -0300 (0:00:01.254)       0:07:05.792 ********** 
fatal: [default]: FAILED! => {"changed": false, "msg": "Failed to set a new url https://github.com/Islandora/Alpaca.git for origin:  fatal: unsafe repository ('/opt/alpaca' is owned by someone else)\nTo add an exception for this directory, call:\n\n\tgit config --global --add safe.directory /opt/alpaca\n"}

@alxp
Copy link
Contributor Author

alxp commented May 5, 2022

Successful build on existing site. We should probably look at a more correct way to deal with checking out a repository to be one by one user in a folder owned by root but we can deal with that later.

@whikloj
Copy link
Member

whikloj commented May 18, 2022

Ok, no more commits on this PR. I have built a site waay back at 3e502a3 and added some resources. Now "upgrading" the site.

Copy link
Member

@whikloj whikloj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I was able to run this over an existing site and stand up a new site using it. 👍

@whikloj whikloj merged commit 670cb2a into dev May 31, 2022
@whikloj whikloj deleted the 2070-update-site-fixes branch May 31, 2022 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants