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

Development needed for Cantaloupe upgrade from 4.0.3 to 4.1.5 #376

Closed
g7morris opened this issue Mar 26, 2020 · 2 comments
Closed

Development needed for Cantaloupe upgrade from 4.0.3 to 4.1.5 #376

g7morris opened this issue Mar 26, 2020 · 2 comments
Labels
ISLE-APACHE Related to the Docker ISLE-Apache image ISLE-IMAGES Related to the Docker ISLE-ImageServices image

Comments

@g7morris
Copy link
Member

g7morris commented Mar 26, 2020

Issue description

I started poking at a potential Cantaloupe upgrade from 4.0.3 to 4.1.5.

Additionally, I was curious if we could implement the XACML / delegates.rb fix outlined here https://groups.google.com/forum/#!msg/islandora/oW_luXn4BNE/bMerf3q_AwAJ

I was able to change the version number in the Dockerfile and got a local build running.

I changed the delegates.rb code to:

  def httpsource_resource_info(options = {})
    logger = Java::edu.illinois.library.cantaloupe.script.Logger
    require 'cgi'
    values = CGI::unescape(context['identifier']).split('~')
    if values.length != 2
      return nil
    end
    token = context['request_headers']['x-islandora-token']
    logger.info("Token #{token}.")
    pid = values[0]
    dsid = values[1]
    return { 'uri' => "http://apache/islandora/object/#{pid}/datastream/#{dsid}/view?token=#{token}"
  end
  • Within https://isle.localdomain/admin/islandora/islandora_viewers/openseadragon

    • I clicked the Add token as header checkbox (changes to green when clicked) which means "Instead of sending the token as a query parameter, it will be sent in the X-ISLANDORA-TOKEN header."
    • I changed the IIF Identifier from the original value of [islandora_openseadragon:pid]~[islandora_openseadragon:dsid]~[islandora_openseadragon:token] to the new suggested value of [islandora_openseadragon:pid]~[islandora_openseadragon:dsid]
  • I setup a demo site and ingested a tiff file as a test.

  • The problem is that no image displays within the viewer and Cantaloupe throws a 500 error. (see below)

  • I can confirm I see the X-ISLANDORA-TOKEN: 04170d62759c2e7642db64c37b495544eb399bb72d9e2088a2f6fcafc5d9266f within the request headers but am blocked by the 500 error.

More research will be required for this fix to proceed.


Questions:

  • Is the current version of Java (openjdk 1.8 / Java 8) sufficient?
  • If the token and header are required will an additional code change to the isle-apache' image be required?
    • Add ProxyPassReverseCookiePath /cantaloupe/iiif/2 /iiif/2 to the vhost
    • Add ProxyPassReverseCookieDomain cantaloupe/iiif/2 islandora-vagrant to the vhost. please note islandora-vagrant is not the correct setting, use the appropriate ISLE service or domain name instead?
  • Do we need to compile Cantaloupe instead of using the pre-made war files?
    • example from Diego's gist above:
cd $home
git clone https://github.com/cantaloupe-project/cantaloupe
cd cantaloupe
git checkout release/4.1
mvn clean package -DskipTests

For an issue, describe steps to reproduce the issue

System setup (OS information, software versions, etc):

Steps:

  1. Edit Line 16 of the ISLE image-services Dockerfile and change the ${CANTALOUPE_VERSION:-4.0.3} to `${CANTALOUPE_VERSION:-4.1.5}
  2. Change the delegates.rb code to
```bash
  def httpsource_resource_info(options = {})
    logger = Java::edu.illinois.library.cantaloupe.script.Logger
    require 'cgi'
    values = CGI::unescape(context['identifier']).split('~')
    if values.length != 2
      return nil
    end
    token = context['request_headers']['x-islandora-token']
    logger.info("Token #{token}.")
    pid = values[0]
    dsid = values[1]
    return { 'uri' => "http://apache/islandora/object/#{pid}/datastream/#{dsid}/view?token=#{token}"
  end
  1. build the image and push to your docker image repo
  2. update the docker-compose.demo.yml and change the image-services image to your newly built image
  3. docker-compose up -d
  4. Run the installer script docker exec -it isle-apache-ld bash /utility-scripts/isle_drupal_build_tools/isle_islandora_installer.sh
  5. Login as the Drupal admin account and within https://isle.localdomain/admin/islandora/islandora_viewers/openseadragon
    click the Add token as header checkbox (changes to green when clicked) which means "Instead of sending the token as a query parameter, it will be sent in the X-ISLANDORA-TOKEN header."
  6. Change the IIF Identifier from the original value of [islandora_openseadragon:pid]~[islandora_openseadragon:dsid]~[islandora_openseadragon:token] to the new suggested value of [islandora_openseadragon:pid]~[islandora_openseadragon:dsid] and click the Save button at the bottom of the form.
  7. ingest a sample tif file and view results
What's the expected result?
  • Working Cantaloupe 4.1.5 displaying JP2s through the Openseadragon viewer
What's the actual result?
  • No JP2s displayed through Openseadragon viewer and 500 errors from Cantaloupe

Additional details / screenshots

Cantaloupe 500 error from logs

receiver is null

java.lang.NullPointerException: receiver is null
	at org.jruby.embed.jsr223.JRubyEngine.invokeMethod(JRubyEngine.java:208)
	at edu.illinois.library.cantaloupe.script.DelegateProxy.invokeUncached(DelegateProxy.java:363)
	at edu.illinois.library.cantaloupe.script.DelegateProxy.invoke(DelegateProxy.java:330)
	at edu.illinois.library.cantaloupe.script.DelegateProxy.invoke(DelegateProxy.java:315)
	at edu.illinois.library.cantaloupe.script.DelegateProxy.authorize(DelegateProxy.java:174)
	at edu.illinois.library.cantaloupe.auth.DelegateAuthorizer.authorize(DelegateAuthorizer.java:30)
	at edu.illinois.library.cantaloupe.resource.AbstractResource.authorize(AbstractResource.java:243)
	at edu.illinois.library.cantaloupe.resource.iiif.v2.InformationResource.doGET(InformationResource.java:62)
	at edu.illinois.library.cantaloupe.resource.HandlerServlet.handle(HandlerServlet.java:98)
	at edu.illinois.library.cantaloupe.resource.HandlerServlet.doGet(HandlerServlet.java:36)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:364)
	at org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:170)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:609)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1623)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
@g7morris g7morris added ISLE-APACHE Related to the Docker ISLE-Apache image ISLE-IMAGES Related to the Docker ISLE-ImageServices image labels Mar 26, 2020
@g7morris
Copy link
Member Author

Please review the following for inclusion in ISLE release 1.5.0:

These images will need to be rebuilt with new settings:
Islandora-Collaboration-Group/isle-apache#15
Islandora-Collaboration-Group/isle-imageservices#14

@g7morris
Copy link
Member Author

This issue has been completed by the recent releases of 1.5.0 and 1.5.1. Closing ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ISLE-APACHE Related to the Docker ISLE-Apache image ISLE-IMAGES Related to the Docker ISLE-ImageServices image
Projects
None yet
Development

No branches or pull requests

1 participant