We're updating the issue view to help you get more done. 

REST PDF export throws 500 error

Description

In our installation of 2.5.1 the following curl command returns a valid pdf: `curl -H "X-ArchivesSpace-Session: $S" -O localhost:8089/repositories/2/resource_descriptions/555.pdf`

However, in 2.6.0, the same call (for a different but valid resource) it throws a 500 error "wrong number of arguments (1 for 2)" originating from "app/lib/AS_fop.rb:16:in `initialize'" .

Below is the relevant archivesspace.log output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 D, [2019-07-02T22:44:19.584827 #4106] DEBUG -- : Thread-2018: GET /repositories/2/resource_descriptions/3.pdf [session: #<Session:0x5fb3a838 @store={:user=>"admin", :login_time=>2019-07-02 21:40:55 +0000, :expirable=>true}, @system_mtime=2019-07-02 22:40:20 UTC, @id="b1db368f00330ea19be424f411ac1d7d86f51729f7dcef2b9f231406d0191b30">] D, [2019-07-02T22:44:19.586843 #4106] DEBUG -- : Thread-2018: Post-processed params: {:id=>3, :repo_id=>2} Jul 02, 2019 10:44:19 PM org.apache.solr.core.SolrCore execute INFO: [collection1] webapp= path=/select params={q=(id:("\/repositories\/2\/archival_objects\/498")+OR+id:("\/repositories\/2\/archival_objects\/499")+OR+id:("\/repositories\/2\/archival_objects\/500")+OR+id:("\/repositories\/2\/archival_objects\/501")+OR+id:("\/repositories\/2\/archival_objects\/502")+OR+id:("\/repositories\/2\/archival_objects\/503")+OR+id:("\/repositories\/2\/archival_objects\/504")+OR+id:("\/repositories\/2\/archival_objects\/505")+OR+id:("\/repositories\/2\/archival_objects\/506")+OR+id:("\/repositories\/2\/archival_objects\/507")+OR+id:("\/repositories\/2\/archival_objects\/508")+OR+id:("\/repositories\/2\/archival_objects\/509")+OR+id:("\/repositories\/2\/archival_objects\/510")+OR+id:("\/repositories\/2\/archival_objects\/511"))&csv.escape=\&csv.header=true&start=0&csv.encapsulator="&q.op=AND&fq=-exclude_by_default:true&rows=14&wt=json&facet=true} hits=14 status=0 QTime=1 E, [2019-07-02T22:44:19.816614 #4106] ERROR -- : Thread-2018: Unhandled exception! E, [2019-07-02T22:44:19.817082 #4106] ERROR -- : wrong number of arguments (1 for 2) /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/AS_fop.rb:16:in `initialize' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/export.rb:16:in `generate_pdf_from_ead' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/controllers/exports.rb:162:in `block in ArchivesSpaceService' org/jruby/RubyBasicObject.java:1691:in `instance_eval' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/rest.rb:347:in `block in returns' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/model/db.rb:111:in `block in open' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/model/db.rb:75:in `block in transaction' /home/vagrant/archivesspace/gems/gems/sequel-4.20.0/lib/sequel/database/transactions.rb:134:in `_transaction' /home/vagrant/archivesspace/gems/gems/sequel-4.20.0/lib/sequel/database/transactions.rb:108:in `block in transaction' /home/vagrant/archivesspace/gems/gems/sequel-4.20.0/lib/sequel/connection_pool/threaded.rb:98:in `hold' /home/vagrant/archivesspace/gems/gems/sequel-4.20.0/lib/sequel/database/connecting.rb:255:in `synchronize' /home/vagrant/archivesspace/gems/gems/sequel-4.20.0/lib/sequel/database/transactions.rb:97:in `transaction' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/model/db.rb:74:in `transaction' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/model/db.rb:110:in `block in open' org/jruby/RubyFixnum.java:305:in `times' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/model/db.rb:107:in `open' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/model/db.rb:432:in `block in DB' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/rest.rb:329:in `block in returns' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/request_context.rb:24:in `open' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/lib/rest.rb:297:in `block in returns' org/jruby/RubyMethod.java:111:in `call' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1611:in `block in compile!' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in `block in route!' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:994:in `route_eval' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in `block in route!' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1015:in `block in process_route' org/jruby/RubyKernel.java:1138:in `catch' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1013:in `process_route' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:973:in `block in route!' org/jruby/RubyArray.java:1735:in `each' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:972:in `route!' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1085:in `block in dispatch!' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `block in invoke' org/jruby/RubyKernel.java:1138:in `catch' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `invoke' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1082:in `dispatch!' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in `block in call!' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `block in invoke' org/jruby/RubyKernel.java:1138:in `catch' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `invoke' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in `call!' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:895:in `call' /home/vagrant/archivesspace/data/tmp/jetty-0.0.0.0-8089-backend.war-_-any-/webapp/WEB-INF/app/main.rb:291:in `call' /home/vagrant/archivesspace/gems/gems/rack-protection-1.5.5/lib/rack/protection/xss_header.rb:18:in `call' /home/vagrant/archivesspace/gems/gems/rack-protection-1.5.5/lib/rack/protection/path_traversal.rb:16:in `call' /home/vagrant/archivesspace/gems/gems/rack-protection-1.5.5/lib/rack/protection/json_csrf.rb:18:in `call' /home/vagrant/archivesspace/gems/gems/rack-protection-1.5.5/lib/rack/protection/base.rb:49:in `call' /home/vagrant/archivesspace/gems/gems/rack-protection-1.5.5/lib/rack/protection/base.rb:49:in `call' /home/vagrant/archivesspace/gems/gems/rack-protection-1.5.5/lib/rack/protection/frame_options.rb:31:in `call' uri:classloader:/vendor/rack-1.6.8/rack/nulllogger.rb:9:in `call' uri:classloader:/vendor/rack-1.6.8/rack/head.rb:13:in `call' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:182:in `call' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:2013:in `call' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1487:in `block in call' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1787:in `synchronize' /home/vagrant/archivesspace/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1487:in `call' uri:classloader:/vendor/rack-1.6.8/rack/urlmap.rb:66:in `block in call' org/jruby/RubyArray.java:1735:in `each' uri:classloader:/vendor/rack-1.6.8/rack/urlmap.rb:50:in `call' uri:classloader:/rack/handler/servlet.rb:22:in `call' D, [2019-07-02T22:44:19.817914 #4106] DEBUG -- : Thread-2018: Responded with [500, {"Content-Type"=>"application/json", "Cache-Control"=>"private, must-revalidate, max-age=0", "Content-Length"=>"48"}, ["{\"error\":\"wrong number of arguments (1 for 2)\"}\n"]]... in 235ms

Environment

ArchivesSpace 2.6.0 on Ubuntu 18 using MySQL 5.7.26. (Installed on 2018-07-02.)

Status

Assignee

Unassigned

Reporter

Seth Shaw

Labels

Priority

Major