Skip to content

Instantly share code, notes, and snippets.

View awead's full-sized avatar
🏠
Working from home

Adam Wead awead

🏠
Working from home
View GitHub Profile
@awead
awead / gist:20b7f6634aa677e2994a
Created April 11, 2015 19:55
Staging versus Production
Here's a sample of the data transfered from Fedora 3 to Fedora 4. The staging set represents week-old production data, with batches, the prod. example is the most up-to-date production Fedora 3 data but without empty batches:
SSstagingRails:
select count(id), f3_model from migrate_audits group by f3_model
+-----------+---------------------------------+
| count(id) | f3_model |
+-----------+---------------------------------+
| 2072 | info:fedora/afmodel:Batch |
| 101 | info:fedora/afmodel:Collection |
| 3972 | info:fedora/afmodel:GenericFile |
@awead
awead / gist:2abdeae5e54e37abb101
Last active October 6, 2017 08:11
Relationship problems
FIXED: scholarsphere_5712m9310.json: "could not migrate relationship info:fedora/fedora-system:def/relations-external#hasCollectionMember because info:fedora/scholarsphere:x346dm27k doesn't exist in Fedora 4",
None of the objects liste in "info:fedora" existed in F3, so the originating object is just reporting that it couldn't find it
scholarsphere_5712md645.json: "could not migrate relationship info:fedora/fedora-system:def/relations-external#hasCollectionMember because info:fedora/scholarsphere:5712md424 doesn't exist in Fedora 4",
scholarsphere_8623j0886.json: "could not migrate relationship info:fedora/fedora-system:def/relations-external#hasCollectionMember because info:fedora/scholarsphere:p8418n21v doesn't exist in Fedora 4"
scholarsphere_sf268c193.json: "could not migrate relationship info:fedora/fedora-system:def/relations-external#hasCollectionMember because info:fedora/scholarsphere:x346d6761 doesn't exist in Fedora 4",
scholarsphere_x346d683f.json: "could not migrate relationship
NoMemoryError: failed to allocate memory
/opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.1.0/gems/rest-client-1.8.0/lib/restclient/request.rb:479:in `fetch_body'
/opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.1.0/gems/rest-client-1.8.0/lib/restclient/request.rb:419:in `block (2 levels) in transmit'
/opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.1.0/gems/newrelic_rpm-3.11.1.284/lib/new_relic/agent/instrumentation/net.rb:27:in `block (2 levels) in request_with_newrelic_trace'
/opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.1.0/gems/newrelic_rpm-3.11.1.284/lib/new_relic/agent.rb:461:in `disable_all_tracing'
/opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.1.0/gems/newrelic_rpm-3.11.1.284/lib/new_relic/agent/instrumentation/net.rb:26:in `block in request_with_newrelic_trace'
/opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.1.0/gems/newrelic_rpm-3.11.1.284/lib/new_relic/agent/cross_app_tracing.rb:48:in `tl_trace_http_request'
/opt/heracles/deploy/scholarsphere/shared
@awead
awead / gist:221c878bcee98c3959d6
Created April 7, 2015 14:41
Curl versus FedoraMigrate
when I do
$ curl http://xxxxxx:[email protected]:8080/SSqaFedora/objects/scholarsphere:x346d6982/datastreams/characterization/content
Tomcat logs show:
ss1stage.dlt.psu.edu - - [07/Apr/2015:10:37:23 -0400] "GET /SSqaFedora/objects/scholarsphere:x346d6982/datastreams/characterization/content HTTP/1.1" 200 3417
When I do:
> FedoraMigrate.find("scholarsphere:x346d6982").datastreams["characterization"].content
@awead
awead / gist:e322fec1be5d8375dff0
Created April 4, 2015 15:04
QA deploy issues
~/Projects/Github/psu-stewardship/scholarsphere (fm-master=)$ bundle exec cap qa deploy BRANCH_NAME=fm-master
** Invoke qa (first_time)
** Execute qa
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rbenv:validate (first_time)
** Invoke rbenv:install (first_time)
** Execute rbenv:install
** Invoke rbenv:install_rbenv (first_time)
** Execute rbenv:install_rbenv
fcrepo.activemq.dir fcrepo.binary-store-path fcrepo.ispn.repo.CacheDirPath
[root@ssrepo1stage SSstagingFedora4]# service tomcat stop
Stopping tomcat: [ OK ]
[root@ssrepo1stage SSstagingFedora4]# rm -Rf *
rm: cannot remove `fcrepo.ispn.repo.CacheDirPath/expiredFedoraRepository': Directory not empty
rm: cannot remove `fcrepo.ispn.repo.CacheDirPath/dataFedoraRepository': Directory not empty
[root@ssrepo1stage SSstagingFedora4]# ls
fcrepo.activemq.dir fcrepo.ispn.repo.CacheDirPath
[root@ssrepo1stage SSstagingFedora4]# find .
.
@awead
awead / gist:356e5eb1d2b10ed22183
Created March 28, 2015 17:33
Capistrano problems
INFO [f0e12e5c] Running /usr/bin/env sudo /sbin/service resque_pool restart as [email protected]
DEBUG [f0e12e5c] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.5 /usr/bin/env sudo /sbin/service resque_pool restart )
DEBUG [f0e12e5c] Shutting down resque services:
DEBUG [f0e12e5c] -bash: wait: pid 4681 is not a child of this shell
DEBUG [f0e12e5c] Starting resque services:
INFO [f0e12e5c] Finished in 6.403 seconds with exit status 0 (successful).
** Invoke deploy:sitemapxml (first_time)
** Execute deploy:sitemapxml
DEBUG [b22efa7c] Running /usr/bin/env if test ! -d /opt/heracles/deploy/scholarsphere/releases/20150328164249; then echo "Directory does not exist '/opt/heracles/deploy/scholarsphere/releases/20150328164249'" 1>&2; false; fi as [email protected]
DEBUG [b22efa7c] Command: if test ! -d /opt/heracles/deploy/scholarsphere/releases/20150328164249; then echo "Directory does not exist '/opt/heracles/deploy/scholarsphere/releases/20150328164249'" 1>&2; false; fi
[root@ss1qa httpd]# RBENV_VERSION=2.1.5 ~deploy/.rbenv/shims/passenger-status
ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it is running, then the causes of this problem could be:
1. You customized the instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument. If so, please set the environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory and run passenger-status again.
2. The instance directory has been removed by an operating system background service. Please set a different instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument.
EPRECATION WARNING: solr_search_params_logic is deprecated and will be removed from blacklight 6.0 (use search_params_logic instead). (called from block in <module:ParseBasicQ> at /Users/awead/.gem/ruby/2.1.5/gems/blacklight_advanced_search-5.1.2/lib/blacklight_advanced_search/parse_basic_q.rb:18)
DEPRECATION WARNING: solr_search_params_logic= is deprecated and will be removed from blacklight 6.0 (use search_params_logic= instead). (called from block in <module:ParseBasicQ> at /Users/awead/.gem/ruby/2.1.5/gems/blacklight_advanced_search-5.1.2/lib/blacklight_advanced_search/parse_basic_q.rb:18)
DEPRECATION WARNING: solr_search_params_logic is deprecated and will be removed from blacklight 6.0 (use search_params_logic instead). (called from block in <module:Catalog> at /Users/awead/Projects/Github/projecthydra/sufia/app/controllers/concerns/sufia/catalog.rb:5)
DEPRECATION WARNING: solr_search_params_logic= is deprecated and will be removed from blacklight 6.0 (use search_params_logic= instead). (called from blo
@awead
awead / gist:26d6f990aa0df6eeef2c
Last active August 29, 2015 14:16
RDF parsing
First example: rspec spec/integration/rdf_migration_spec.rb:39
This is currenly passing.
Encoding detection: {"encoding"=>"utf-8", "confidence"=>0.99}
Original description content:
"Objectives:\\r\\n• Explain the role of a new genomic assay (Target Now™) in guiding oncology treatment plans."
Gets altered via ::updated_datastream_content
"Objectives:\\r\\n• Explain the role of a new genomic assay (Target Now™) in guiding oncology treatment plans."