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

Update for one-jar Alpaca #208

Merged
merged 9 commits into from
Mar 29, 2022
Merged

Conversation

whikloj
Copy link
Member

@whikloj whikloj commented Nov 13, 2021

GitHub Issue: Islandora/documentation#731

What does this Pull Request do?

Updates islandora-playbook to install the changes in Islandora/Alpaca#82

I'm leaving this as draft until things are merged and this can be pointed back to islandora repos.

How should this be tested?

This will build a system with the runnable jar instead of the karaf installation.

Interested parties

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

Copy link
Contributor

@ruebot ruebot left a comment

Choose a reason for hiding this comment

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

Starting to test now, and noticed this. Also testing this in conjunction with #207.

I'll provide more feedback later 😅

@ruebot
Copy link
Contributor

ruebot commented Nov 16, 2021

I built this in conjunction with #207, and removed all the triplestore call, except alpaca_triplestore_enabled, and it built fine. I would just add a note that alpaca_milliner_base_url should have a trailing slash, otherwise you end up with 😅 :

org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/millinernode/88cce3ab-2d66-4bf9-8fcc-ab8a14b88fd2 with statusCode: 404

I was able to add a test collection, image, and audio objects successfully. The objects ended up fcrepo, and derivatives were created.
Screenshot 2021-11-16 at 09-45-50 Manage Media Islandora 8
Screenshot 2021-11-16 at 09-46-15 Manage Media Islandora 8

I also kept an eye on alpaca.log while ingesting and noticed a couple errors with milliner/media/field_media_image and milliner/media/field_media_audio. Not sure if this is an issue with the the Alpaca configuration, or my version of islandora_defaults:

ERROR 14:42:45.123 [Camel (camel-1) thread #10 - seda://mediaIndex] (DefaultErrorHandler) Failed delivery for (MessageId: ID-islandora8-1637073441695-0-44 on ExchangeId: ID-islandora8-1637073441695-0-45). Exhausted after delivery attempt: 6 caught: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404. Processed by failure processor: FatalFallbackErrorHandler[Channel[log12]]

Message History (complete message history is disabled)
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
[FcrepoIndexerMedia] [FcrepoIndexerMedia] [from[seda://mediaIndex]                                                       ] [      5527]

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------

org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404
	at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:324)
	at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:215)
	at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
	at org.apache.camel.processor.SendDynamicProcessor.lambda$process$0(SendDynamicProcessor.java:195)
	at org.apache.camel.impl.engine.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:317)
	at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:180)
	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.redeliver(RedeliveryErrorHandler.java:788)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:287)
	at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:274)
	at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:187)
	at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:130)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
	Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404
		... 17 common frames omitted
		Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404
			... 17 common frames omitted
			Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404
				... 17 common frames omitted
				Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404
					... 17 common frames omitted
					Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404
						at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:324)
						at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:215)
						at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
						at org.apache.camel.processor.SendDynamicProcessor.lambda$process$0(SendDynamicProcessor.java:195)
						at org.apache.camel.impl.engine.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:317)
						at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:180)
						at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:723)
						at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:632)
						... 10 common frames omitted
WARN 14:42:45.123 [Camel (camel-1) thread #10 - seda://mediaIndex] (SedaConsumer) Error processing exchange. Exchange[]. Caused by: [org.apache.camel.http.common.HttpOperationFailedException - HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404]
org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404
	at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:324)
	at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:215)
	at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
	at org.apache.camel.processor.SendDynamicProcessor.lambda$process$0(SendDynamicProcessor.java:195)
	at org.apache.camel.impl.engine.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:317)
	at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:180)
	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.redeliver(RedeliveryErrorHandler.java:788)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:287)
	at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:274)
	at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:187)
	at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:130)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
	Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404
		... 17 common frames omitted
		Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404
			... 17 common frames omitted
			Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404
				... 17 common frames omitted
				Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404
					... 17 common frames omitted
					Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_audio_file with statusCode: 404
						at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:324)
						at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:215)
						at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
						at org.apache.camel.processor.SendDynamicProcessor.lambda$process$0(SendDynamicProcessor.java:195)
						at org.apache.camel.impl.engine.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:317)
						at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:180)
						at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:723)
						at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:632)
						... 10 common frames omitted
ERROR 14:38:35.745 [Camel (camel-1) thread #10 - seda://mediaIndex] (DefaultErrorHandler) Failed delivery for (MessageId: ID-islandora8-1637073441695-0-20 on ExchangeId: ID-islandora8-1637073441695-0-21). Exhausted after delivery attempt: 6 caught: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404. Processed by failure processor: FatalFallbackErrorHandler[Channel[log12]]

Message History (complete message history is disabled)
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
[FcrepoIndexerMedia] [FcrepoIndexerMedia] [from[seda://mediaIndex]                                                       ] [      5493]

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------

org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404
	at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:324)
	at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:215)
	at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
	at org.apache.camel.processor.SendDynamicProcessor.lambda$process$0(SendDynamicProcessor.java:195)
	at org.apache.camel.impl.engine.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:317)
	at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:180)
	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.redeliver(RedeliveryErrorHandler.java:788)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:287)
	at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:274)
	at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:187)
	at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:130)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
	Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404
		... 17 common frames omitted
		Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404
			... 17 common frames omitted
			Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404
				... 17 common frames omitted
				Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404
					... 17 common frames omitted
					Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404
						at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:324)
						at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:215)
						at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
						at org.apache.camel.processor.SendDynamicProcessor.lambda$process$0(SendDynamicProcessor.java:195)
						at org.apache.camel.impl.engine.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:317)
						at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:180)
						at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:723)
						at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:632)
						... 10 common frames omitted
WARN 14:38:35.746 [Camel (camel-1) thread #10 - seda://mediaIndex] (SedaConsumer) Error processing exchange. Exchange[]. Caused by: [org.apache.camel.http.common.HttpOperationFailedException - HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404]
org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404
	at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:324)
	at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:215)
	at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
	at org.apache.camel.processor.SendDynamicProcessor.lambda$process$0(SendDynamicProcessor.java:195)
	at org.apache.camel.impl.engine.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:317)
	at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:180)
	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.redeliver(RedeliveryErrorHandler.java:788)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:287)
	at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:274)
	at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:187)
	at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:130)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
	Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404
		... 17 common frames omitted
		Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404
			... 17 common frames omitted
			Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404
				... 17 common frames omitted
				Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404
					... 17 common frames omitted
					Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404
						at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:324)
						at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:215)
						at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
						at org.apache.camel.processor.SendDynamicProcessor.lambda$process$0(SendDynamicProcessor.java:195)
						at org.apache.camel.impl.engine.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:317)
						at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:180)
						at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:723)
						at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:632)
						... 10 common frames omitted

@ruebot
Copy link
Contributor

ruebot commented Nov 16, 2021

Oh, I noticed I get these too in the log:

WARN 18:34:51.102 [Camel (camel-1) thread #9 - JmsConsumer[islandora-indexing-fcrepo-media]] (FcrepoIndexer) Could not locate the Json Url for the media, event could be pre-upload. Skipping processing.

Not sure if that's just something to ignore.

@ruebot
Copy link
Contributor

ruebot commented Nov 16, 2021

Since we're doing away with Karaf, we should also:

  • rename karaf.yml to alpaca.yml
  • change host name in alpaca.yml
  • git rm roles/internal/Islandora-Devops.alpaca/tasks/deploy.yml
  • s/karaf/alpaca/ in inventory/vagrant/hosts and playbook.yml
  • remove the Karaf references in
    • roles/internal/Islandora-Devops.alpaca/README.md
    • roles/internal/Islandora-Devops.blazegraph/README.md
    • roles/internal/Islandora-Devops.alpaca/meta/main.yml

@whikloj
Copy link
Member Author

whikloj commented Nov 16, 2021

Was the Milliner 404 error causing a problem? Like was anything not happening correctly?

There are definitely some messages that seem to fail, not sure if its timing or when the message is generated. Like the second error, this normally happens when you select a media file. Drupal immediately starts to upload it and we send a message. But there is no actual media created so Alpaca fails which is expected but also can look like any other error.

@ruebot
Copy link
Contributor

ruebot commented Nov 16, 2021

HTTP operation failed invoking http://localhost:8000/milliner/media/field_media_image with statusCode: 404

Those? I don't think they were causing any problems because all the derivatives were created, so they were sent to the correct microservices. I don't have derivatives in fcrepo, so that could be it?


WARN 18:34:51.102 [Camel (camel-1) thread #9 - JmsConsumer[islandora-indexing-fcrepo-media]] (FcrepoIndexer) Could not locate the Json Url for the media, event could be pre-upload. Skipping processing.

That one is from when I select a file to upload, but haven't uploaded anything yet. So, your explanation makes sense there, and it make sense that it's a WARN.

ruebot added a commit to yorkulibraries/yudl-playbook that referenced this pull request Nov 16, 2021
ruebot added a commit to yorkulibraries/yudl-playbook that referenced this pull request Nov 16, 2021
- Localized updates from:
  - Islandora-Devops/islandora-playbook#208
  - Islandora-Devops/islandora-playbook#207

- Update to fcrepo 6.1.0
- Update PDF.js to most recent version as of this commit
@whikloj
Copy link
Member Author

whikloj commented Nov 18, 2021

So re: deleting the deploy.yml. Once we have a published maven artifact we could avoid re-compiling it everytime and re-use the deploy stuff. I just haven't worked it through yet.

@whikloj
Copy link
Member Author

whikloj commented Nov 18, 2021

Actually maybe the current deploy.yml is all Karaf OSGI stuff. I'll trash it, but we should add in deploying a ready made artifact later.

@ruebot
Copy link
Contributor

ruebot commented Nov 18, 2021

Yeah, I figured at some point the playbook would get updated to allow for a released artifact to be used instead of compiling. We're just in that chicken-egg situation for that now 😄

@alxp
Copy link
Contributor

alxp commented Dec 2, 2021

I ran the playbook build from scratch with this branch.

  1. Logged in, created a node with Model of Image.
  2. Added a PNG with role Original File
  3. The media gets ingested in to Fedora:

image

4. However, the derivatives do not seem to be being generated:

image

Is there some other config that needs to be done?

@adam-vessey
Copy link
Contributor

adam-vessey commented Dec 2, 2021

Encountered a few errors in the run... seems to have come up, eventually:

TASK [Islandora-Devops.matomo : restore dump] **********************************
Thursday 02 December 2021  10:50:58 -0400 (0:00:01.751)       0:22:08.788 *****
fatal: [default]: FAILED! => {"msg": "The conditional check 'motomo_sql_dump_create | changed' failed. The error was: template error while templating string: no filter named 'changed'. String: {% if motomo_sql_dump_create | changed %} True {% else %} False {% endif %}\n\nThe error appears to be in '/home/adam/repos/islandora-playbook/roles/internal/Islandora-Devops.matomo/tasks/console_install.yml': line 12, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: restore dump\n  ^ here\n"}
...ignoring

[...]
TASK [Islandora-Devops.fits : Clean Directory (Failure okay)] ******************
Thursday 02 December 2021  11:15:13 -0400 (0:00:03.517)       0:46:24.080 *****
failed: [default] (item=absent) => {"ansible_loop_var": "item", "changed": false, "item": "absent", "msg": "file (/var/www/html/CrayFits/vendor/symfony/monolog-bundle) is absent, cannot continue", "path": "/var/www/html/CrayFits/vendor/symfony/monolog-bundle"}
failed: [default] (item=directory) => {"ansible_loop_var": "item", "changed": false, "item": "directory", "msg": "file (/var/www/html/CrayFits/vendor/symfony/monolog-bundle) is absent, cannot continue", "path": "/var/www/html/CrayFits/vendor/symfony/monolog-bundle"}
...ignoring

I see that "Failure okay" thing on the second, and "ignore_errors" or whatever in the code for the first... seems... odd to expect errors to be emitted from things, but anyway.


All that said... doesn't seem to lead to a system with Alpaca setup?

As in, doing a ps -ef | grep java on the machine, only getting Tomcat, ActiveMQ and Solr... no Karaf (as expected), but no new service, and no /opt/alpaca directory or whatever...

In the build logs, I do see:

RUNNING HANDLER [geerlingguy.apache : restart apache] **************************
Thursday 02 December 2021  11:22:24 -0400 (0:00:00.608)       0:53:35.117 *****
changed: [default]
[WARNING]: Could not match supplied host pattern, ignoring: karaf

PLAY [karaf] *******************************************************************
skipping: no hosts matched

PLAY [webserver] ***************************************************************

... still trying to do something with Karaf?

I see that the renamed alpaca.yml still contains:

- hosts: karaf
  become: yes

... does this also need to be updated to alpaca or something? Not much experience with Alpaca, do I have.

Update: Tried changing to s/karaf/alpaca/ there and kicked off vagrant provision again, and it seems to be running it now?

Update x2: Seemed to do the trick; however, looks like it runs into the issue as reported over on the Alpaca PR, with the type conversion: Islandora/Alpaca#82 (comment) ... so will continue on things over there...


Something of an aside, but... if we did want to put compiled artifacts somewhere, could possibly roll a "release candidate" kind of release, with the built artifacts, kind of thing?

Comment on lines 3 to 5
if [ -f "/usr/libexec/tomcat9/tomcat-locate-java.sh" ]; then
. /usr/libexec/tomcat9/tomcat-locate-java.sh
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like unnecessary coupling for this to be referencing Tomcat stuff... not the end of the world, but... shrug?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I didn't want to copy the code and $JAVA_HOME doesn't seem to be set by default. Because this is only for Ubuntu I'll just assume where java is.

Copy link
Member Author

Choose a reason for hiding this comment

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

Made a guess based on where Ubuntu should put OpenJDK 11. Resolved in a741462

Comment on lines 10 to 24
- name: Install Alpaca via Gradle
command: ./gradlew install
command: ./gradlew build shadowJar
args:
chdir: "{{ alpaca_clone_directory }}"
when: alpaca_git.changed
Copy link
Contributor

Choose a reason for hiding this comment

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

Should... this be run as a non-root user? Seems like it will create/leave the "gradle daemon" dealio intact running as root... seems less-than ideal?

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to run as the alpaca_user, in a741462

Comment on lines 8 to 9
alpaca_user: tomcat
alpaca_group: tomcat
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this create its own user/group by default? Just yeah... that coupling thing again.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed these to vagrant

Copy link
Contributor

Choose a reason for hiding this comment

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

Apologies if this is not an issue, but can we make sure you aren't hardcoding 'vagrant' in there since we aren't always deploying to vagrant.

{{ ansible_os_user }} is the most current way to reference the user that becomes 'vagrant' on a vagrant box.

The Drupal role gives a more robust expression:

 "{{ ansible_ssh_user | default(ansible_env.SUDO_USER, true) | default(ansible_env.USER, true) | default(ansible_user_id) }}"

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm still using a role variable, sorry I should have been clearer. I just changed the default from tomcat to vagrant, so you can still change this to whatever you want by overridding it in your inventory.

@alxp
Copy link
Contributor

alxp commented Dec 8, 2021

Re-ran with this morning's updates, was able to generate derivatives for image and PDF objects.

@alxp
Copy link
Contributor

alxp commented Dec 10, 2021

Ran this playbook update on top of an existing Vagrant box.

Ansible showed no errors, but did get the following error in alpaca.log when uploading an image in the add media form:

INFO 14:55:06.486 [Camel (camel-1) thread #13 - JmsConsumer[islandora-indexing-triplestore-index]] (TriplestoreIndexer) Unable to find JsonLD Url, this is an error or happens when a file is pre-uploaded to Drupal
ERROR 14:55:06.514 [Camel (camel-1) thread #13 - JmsConsumer[islandora-indexing-triplestore-index]] (DefaultErrorHandler) Failed delivery for (MessageId: ID:islandora8-38751-1638977195832-3:15:-1:1:2 on ExchangeId: A5D8E28EFD775B7-0000000000000000). Exhausted after delivery attempt: 1 caught: ca.islandora.alpaca.support.exceptions.MissingJsonldUrlException: Cannot find JSONLD URL in event message.. Processed by failure processor: FatalFallbackErrorHandler[Channel[log28]]

Message History (complete message history is disabled)
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
[IslandoraTriplesto] [IslandoraTriplesto] [from[broker://queue:islandora-indexing-triplestore-index]                     ] [       806]

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------

ca.islandora.alpaca.support.exceptions.MissingJsonldUrlException: Cannot find JSONLD URL in event message.
	at ca.islandora.alpaca.support.event.AS2Object.getJsonldUrl(AS2Object.java:119)
	at ca.islandora.alpaca.indexing.triplestore.TriplestoreIndexer.lambda$configure$0(TriplestoreIndexer.java:128)
	at org.apache.camel.support.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:66)
	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:714)
	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:623)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
	at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:312)
	at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83)
	at org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:41)
	at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:130)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:736)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:696)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:674)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:318)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:257)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1237)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1227)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1120)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
WARN 14:55:06.522 [Camel (camel-1) thread #13 - JmsConsumer[islandora-indexing-triplestore-index]] (EndpointMessageListener) Execution of JMS message listener failed. Caused by: [org.apache.camel.RuntimeCamelException - ca.islandora.alpaca.support.exceptions.MissingJsonldUrlException: Cannot find JSONLD URL in event message.]
org.apache.camel.RuntimeCamelException: ca.islandora.alpaca.support.exceptions.MissingJsonldUrlException: Cannot find JSONLD URL in event message.
	at org.apache.camel.RuntimeCamelException.wrapRuntimeCamelException(RuntimeCamelException.java:51)
	at org.apache.camel.component.jms.EndpointMessageListener$EndpointMessageListenerAsyncCallback.done(EndpointMessageListener.java:213)
	at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:134)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:736)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:696)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:674)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:318)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:257)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1237)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1227)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1120)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: ca.islandora.alpaca.support.exceptions.MissingJsonldUrlException: Cannot find JSONLD URL in event message.
	at ca.islandora.alpaca.support.event.AS2Object.getJsonldUrl(AS2Object.java:119)
	at ca.islandora.alpaca.indexing.triplestore.TriplestoreIndexer.lambda$configure$0(TriplestoreIndexer.java:128)
	at org.apache.camel.support.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:66)
	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:714)
	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:623)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
	at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:312)
	at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83)
	at org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:41)
	at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:130)
	... 11 common frames omitted
 

The triple store does seem to have entries for the added item so unsure what this error is indicating.

Note this probably belongs in the closed PR for alpaca :P

Copy link
Contributor

@alxp alxp left a comment

Choose a reason for hiding this comment

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

Just a few hard-coded 'vagrant' references that should be changed.

```
alpaca_karaf_dir: /opt/karaf
alpaca_group: vagrant
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be an Ansible default ssh user variable, since it may not be running on Vagrant.

- islandora-connector-broadcast
- islandora-indexing-triplestore
- islandora-indexing-fcrepo
alpaca_user: vagrant
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be the Ansible default ssh user variable, since it may not be running on Vagrant.

@@ -2,16 +2,14 @@

# Comment in to build Alpaca from source
alpaca_from_source: yes
alpaca_version: dev
alpaca_version: one-app
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be flipped back to 'dev' now?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was trying to release Alpaca first so I could put a tag in here, but I can switch it back

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually it should be 2.x. Dev is not up-to-date anymore.

- mvn:org.apache.camel.karaf/apache-camel/2.20.4/xml/features
- mvn:org.apache.activemq/activemq-karaf/5.15.0/xml/features
- mvn:ca.islandora.alpaca/islandora-karaf/1.0.1/xml/features
alpaca_user: vagrant
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be the ansible default ssh user variable and not 'vagrant' as this may not be being run on Vagrant.

Copy link
Member Author

Choose a reason for hiding this comment

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

So I changed this to

alpaca_user: "{{ ansible_user }}"
alpaca_group: "{{ ansible_user }}"

now I get this

TASK [Islandora-Devops.alpaca : Install Alpaca via Gradle] *********************
Monday 20 December 2021  11:39:17 -0600 (0:00:00.316)       0:58:00.653 ******* 
fatal: [default]: FAILED! => {"msg": "The field 'become_user' has an invalid value, which includes an undefined variable. The error was: {{ ansible_user }}: 'ansible_user' is undefined. {{ ansible_user }}: 'ansible_user' is undefined"}

🤷
p.s. I used ansible_user and not ansible_ssh_user because of the note here https://docs.ansible.com/ansible/2.3/intro_inventory.html#list-of-behavioral-inventory-parameters

Copy link
Member Author

Choose a reason for hiding this comment

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

I also tried ansible_ssh_user and it also fails... 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

@alxp I'm going to leave this as is because I can't figure out what is supposed to work. You can override it with your own ansible config and set it to whatever you need.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually for some reason it is using ansible_user in become_user that is the problem. Otherwise it is valid, but there it causes a failure. I'll do a little more digging

@alxp
Copy link
Contributor

alxp commented Dec 20, 2021

Got the following error while running this branch of the playbook:

TASK [Gathering Facts] *********************************************************
Monday 20 December 2021  10:21:06 -0400 (0:00:00.691)       0:27:46.045 ******* 
ok: [default]

TASK [Islandora-Devops.alpaca : Clone CLAW Alpaca] *****************************
Monday 20 December 2021  10:21:07 -0400 (0:00:01.195)       0:27:47.241 ******* 
fatal: [default]: FAILED! => {"changed": false, "cmd": "/usr/bin/git checkout --force one-app", "msg": "Failed to checkout one-app", "rc": 1, "stderr": "error: pathspec 'one-app' did not match any file(s) known to git\n", "stderr_lines": ["error: pathspec 'one-app' did not match any file(s) known to git"], "stdout": "", "stdout_lines": []}

PLAY RECAP 

Probably a branch got deleted?

@alxp
Copy link
Contributor

alxp commented Mar 22, 2022

Getting this building a new playbook:

TASK [Islandora-Devops.alpaca : Clone CLAW Alpaca] *****************************
Tuesday 22 March 2022  13:01:55 -0300 (0:00:01.104)       1:07:47.311 ********* 
fatal: [default]: FAILED! => {"changed": false, "cmd": "/usr/bin/git checkout --force one-app", "msg": "Failed to checkout one-app", "rc": 1, "stderr": "error: pathspec 'one-app' did not match any file(s) known to git\n", "stderr_lines": ["error: pathspec 'one-app' did not match any file(s) known to git"], "stdout": "", "stdout_lines": []}

@whikloj whikloj marked this pull request as ready for review March 23, 2022 15:40
@whikloj whikloj requested review from alxp and ruebot March 23, 2022 15:40
@alxp
Copy link
Contributor

alxp commented Mar 23, 2022

Running playbook now...

@alxp
Copy link
Contributor

alxp commented Mar 24, 2022

In post-install.yml, there's a server variable that needs to be updated.

- name: Force Alpaca host setting to override install profile.
      command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset islandora.settings broker_url tcp://{{ hostvars[groups['alpaca'][0]].ansible_host }}:61613"

@alxp alxp merged commit 6146fa7 into Islandora-Devops:dev Mar 29, 2022
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