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

[BUG?] Reverse proxy with Alpaca #93

Open
rbos opened this issue Aug 21, 2024 · 3 comments
Open

[BUG?] Reverse proxy with Alpaca #93

rbos opened this issue Aug 21, 2024 · 3 comments
Labels

Comments

@rbos
Copy link

rbos commented Aug 21, 2024

We're running an ISLE site behind a reverse proxy, and when we save a media resource, it generates a lot of error message[0] when invoking a sub-service. When I dig into any of the subservices, it often boils down to complaints about being unable to access the file resource[1] using the external HTTPS url, which is inaccessible to ISLE because it's on the outside of the load-balancer, and ISLE is only configured to speak HTTP.

I can often patch the sub-services to search & replace the URL and speak http only, but that approach has been increasingly tedious and error-prone. Cantaloupe requires a custom delegates.rb, for instance.

Is it possible to have Alpaca hand HTTP urls off to sub-services and solve this problem?

I may be misunderstanding the problem, but I think this is what's been giving me issues.

[0]

alpaca-1      | WARN 17:04:04.837 [Camel (camel-1) thread #6 - seda://nodeIndex] (SedaConsumer) Error processing exchange. Exchange[]. Caused by: [org.apache.camel.http.common.HttpOperationFailedException - HTTP operation faile
d invoking http://milliner:8000/node/d7244cb5-7112-4564-95a5-6397148d167a with statusCode: 500]                                                                                                                                    
alpaca-1      | org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://milliner:8000/node/d7244cb5-7112-4564-95a5-6397148d167a with statusCode: 500
alpaca-1      |         at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:362)                                                                                                
alpaca-1      |         at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:246)                                                                                                                             alpaca-1      |         at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)                        
alpaca-1      |         at org.apache.camel.processor.SendDynamicProcessor.lambda$process$0(SendDynamicProcessor.java:195)                                                                                                         
alpaca-1      |         at org.apache.camel.support.cache.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:317)                                                                                                    alpaca-1      |         at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:180)                                                                       
alpaca-1      |         at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.redeliver(RedeliveryErrorHandler.java:779)                                                                                
alpaca-1      |         at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)                       
alpaca-1      |         at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)                                                                                                      
alpaca-1      |         at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)                                                                                                                                          
alpaca-1      |         at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:312)                                                                                                            
alpaca-1      |         at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:274)
alpaca-1      |         at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:187)                                                                                                                               
alpaca-1      |         at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:130)   
alpaca-1      |         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)                                                                                                               
alpaca-1      |         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)                                                                                                               alpaca-1      |         at java.base/java.lang.Thread.run(Thread.java:840)                                                                                                                                                         
alpaca-1      |         Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://milliner:8000/node/d7244cb5-7112-4564-95a5-6397148d167a with statusCode: 500                  
alpaca-1      |                 ... 17 common frames omitted                                                                                                                                                                       alpaca-1      |                 Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://milliner:8000/node/d7244cb5-7112-4564-95a5-6397148d167a with statusCode: 500
alpaca-1      |                         ... 17 common frames omitted                                                                                                                                                               
alpaca-1      |                         Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://milliner:8000/node/d7244cb5-7112-4564-95a5-6397148d167a with statusCode: 500
alpaca-1      |                                 ... 17 common frames omitted                                                                                                                                                       
alpaca-1      |                                 Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://milliner:8000/node/d7244cb5-7112-4564-95a5-6397148d167a with statusCod
e: 500                                                                                                                                                                                                                             
alpaca-1      |                                         ... 17 common frames omitted                                                                                                                                               alpaca-1      |                                         Suppressed: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://milliner:8000/node/d7244cb5-7112-4564-95a5-6397148d167a with s
tatusCode: 500                                                                                                                                                                                                                     alpaca-1      |                                                 at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:362)                                                        
alpaca-1      |                                                 at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:246)                                                                                     alpaca-1      |                                                 at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)                           
alpaca-1      |                                                 at org.apache.camel.processor.SendDynamicProcessor.lambda$process$0(SendDynamicProcessor.java:195)                                                                 alpaca-1      |                                                 at org.apache.camel.support.cache.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:317)                                                            
alpaca-1      |                                                 at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:180)                                                                          alpaca-1      |                                                 at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:714)                            
alpaca-1      |                                                 at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:623)                                              
alpaca-1      |                                                 ... 10 common frames omitted                                                                                                                                       fcrepo-1      | 192.168.6.2 - anonymous [21/Aug/2024:17:03:59 +0000] "HEAD /fcrepo/rest/d7/24/4c/b5/d7244cb5-7112-4564-95a5-6397148d167a HTTP/1.1" 404 -                                                                           fcrepo-1      | 192.168.6.2 - anonymous [21/Aug/2024:17:03:59 +0000] "HEAD /fcrepo/rest/d7/24/4c/b5/d7244cb5-7112-4564-95a5-6397148d167a HTTP/1.1" 404 -                                                                           

[1]

milliner-1    | [2024-08-21T17:04:03.566733+00:00] app.ERROR: Caught exception creating node resource. {"Exception":"[object] (GuzzleHttp\\Exception\\ConnectException(code: 0): cURL error 7: Failed to connect to [site] port 443 after 1 ms: Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://[site]/node/655?_format=jsonld at /var/www/crayfish/Milliner/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210)"} []                                                                                                                                                                                              milliner-1    | 192.168.6.10 - - [21/Aug/2024:17:04:03 +0000] "POST /node/d7244cb5-7112-4564-95a5-6397148d167a HTTP/1.1" 500 232 "-" "Apache-HttpClient/4.5.13 (Java/17.0.10)" "-"                                                 
@rbos rbos added the bug label Aug 21, 2024
@rbos
Copy link
Author

rbos commented Aug 21, 2024

possibly related: Islandora/documentation#1070

@rbos
Copy link
Author

rbos commented Sep 3, 2024

I was able to resolve the error by masking it.

in milliner container:

./src/Service/MillinerService.php

protected function getFirstPredicate(array $jsonld, string $predicate, bool $value = true): ?string

        if ($malformed) {
            return '1970-01-01T00:00:00Z'; 
        }

@DonRichards
Copy link
Member

I gave this a shot, it helped with the error but I don't believe it fixed the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants