cgspace-notes/public/tags/notes/index.xml

1385 lines
82 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Notes on CGSpace Notes</title>
<link>/cgspace-notes/tags/notes/</link>
<description>Recent content in Notes on CGSpace Notes</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Mon, 04 Apr 2016 11:06:00 +0300</lastBuildDate>
<atom:link href="/cgspace-notes/tags/notes/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>April, 2016</title>
<link>/cgspace-notes/2016-04/</link>
<pubDate>Mon, 04 Apr 2016 11:06:00 +0300</pubDate>
<guid>/cgspace-notes/2016-04/</guid>
<description>
&lt;h2 id=&#34;2016-04-04:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-04&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Looking at log file use on CGSpace and notice that we need to work on our cron setup a bit&lt;/li&gt;
&lt;li&gt;We are backing up all logs in the log folder, including useless stuff like solr, cocoon, handle-plugin, etc&lt;/li&gt;
&lt;li&gt;After running DSpace for over five years I&amp;rsquo;ve never needed to look in any other log file than dspace.log, leave alone one from last year!&lt;/li&gt;
&lt;li&gt;This will save us a few gigs of backup space we&amp;rsquo;re paying for on S3&lt;/li&gt;
&lt;li&gt;Also, I noticed the &lt;code&gt;checker&lt;/code&gt; log has some errors we should pay attention to:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Run start time: 03/06/2016 04:00:22
Error retrieving bitstream ID 71274 from asset store.
java.io.FileNotFoundException: /home/cgspace.cgiar.org/assetstore/64/29/06/64290601546459645925328536011917633626 (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.&amp;lt;init&amp;gt;(FileInputStream.java:146)
at edu.sdsc.grid.io.local.LocalFileInputStream.open(LocalFileInputStream.java:171)
at edu.sdsc.grid.io.GeneralFileInputStream.&amp;lt;init&amp;gt;(GeneralFileInputStream.java:145)
at edu.sdsc.grid.io.local.LocalFileInputStream.&amp;lt;init&amp;gt;(LocalFileInputStream.java:139)
at edu.sdsc.grid.io.FileFactory.newFileInputStream(FileFactory.java:630)
at org.dspace.storage.bitstore.BitstreamStorageManager.retrieve(BitstreamStorageManager.java:525)
at org.dspace.checker.BitstreamDAO.getBitstream(BitstreamDAO.java:60)
at org.dspace.checker.CheckerCommand.processBitstream(CheckerCommand.java:303)
at org.dspace.checker.CheckerCommand.checkBitstream(CheckerCommand.java:171)
at org.dspace.checker.CheckerCommand.process(CheckerCommand.java:120)
at org.dspace.app.checker.ChecksumChecker.main(ChecksumChecker.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:225)
at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:77)
******************************************************
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So this would be the &lt;code&gt;tomcat7&lt;/code&gt; Unix user, who seems to have a default limit of 1024 files in its shell&lt;/li&gt;
&lt;li&gt;For what it&amp;rsquo;s worth, we have been setting the actual Tomcat 7 process&amp;rsquo; limit to 16384 for a few years (in &lt;code&gt;/etc/default/tomcat7&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Looks like cron will read limits from &lt;code&gt;/etc/security/limits.*&lt;/code&gt; so we can do something for the tomcat7 user there&lt;/li&gt;
&lt;li&gt;Submit pull request for Tomcat 7 limits in Ansible dspace role (&lt;a href=&#34;https://github.com/ilri/rmg-ansible-public/pull/30&#34;&gt;#30&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-04-05:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-05&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Reduce Amazon S3 storage used for logs from 46 GB to 6GB by deleting a bunch of logs we don&amp;rsquo;t need!&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# s3cmd ls s3://cgspace.cgiar.org/log/ &amp;gt; /tmp/s3-logs.txt
# grep checker.log /tmp/s3-logs.txt | awk &#39;{print $4}&#39; | xargs s3cmd del
# grep cocoon.log /tmp/s3-logs.txt | awk &#39;{print $4}&#39; | xargs s3cmd del
# grep handle-plugin.log /tmp/s3-logs.txt | awk &#39;{print $4}&#39; | xargs s3cmd del
# grep solr.log /tmp/s3-logs.txt | awk &#39;{print $4}&#39; | xargs s3cmd del
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Also, adjust the cron jobs for backups so they only backup &lt;code&gt;dspace.log&lt;/code&gt; and some stats files (.dat)&lt;/li&gt;
2016-04-06 12:50:43 +02:00
&lt;li&gt;Try to do some metadata field migrations using the Atmire batch UI (&lt;code&gt;dc.Species&lt;/code&gt; → &lt;code&gt;cg.species&lt;/code&gt;) but it took several hours and even missed a few records&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-04-06:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-06&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A better way to move metadata on this scale is via SQL, for example &lt;code&gt;dc.type.output&lt;/code&gt; → &lt;code&gt;dc.type&lt;/code&gt; (their IDs in the metadatafieldregistry are 66 and 109, respectively):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspacetest=# update metadatavalue set metadata_field_id=109 where metadata_field_id=66;
UPDATE 40852
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After that an &lt;code&gt;index-discovery -bf&lt;/code&gt; is required&lt;/li&gt;
&lt;li&gt;Start working on metadata migrations, add 25 or so new metadata fields to CGSpace&lt;/li&gt;
&lt;/ul&gt;
2016-04-07 16:49:46 +02:00
&lt;h2 id=&#34;2016-04-07:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-07&lt;/h2&gt;
&lt;ul&gt;
2016-04-07 16:50:16 +02:00
&lt;li&gt;Write shell script to do the migration of fields: &lt;a href=&#34;https://gist.github.com/alanorth/72a70aca856d76f24c127a6e67b3342b&#34;&gt;https://gist.github.com/alanorth/72a70aca856d76f24c127a6e67b3342b&lt;/a&gt;&lt;/li&gt;
2016-04-07 16:49:46 +02:00
&lt;li&gt;Testing with a few fields it seems to work well:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ ./migrate-fields.sh
UPDATE metadatavalue SET metadata_field_id=109 WHERE metadata_field_id=66
UPDATE 40883
UPDATE metadatavalue SET metadata_field_id=202 WHERE metadata_field_id=72
UPDATE 21420
UPDATE metadatavalue SET metadata_field_id=203 WHERE metadata_field_id=76
UPDATE 51258
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;2016-04-08:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-08&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Discuss metadata renaming with Abenet, we decided it&amp;rsquo;s better to start with the center-specific subjects like ILRI, CIFOR, CCAFS, IWMI, and CPWF&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;ve e-mailed CCAFS and CPWF people to ask them how much time it will take for them to update their systems to cope with this change&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-04-10:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-10&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Looking at the DOI issue &lt;a href=&#34;https://www.yammer.com/dspacedevelopers/#/Threads/show?threadId=678507860&#34;&gt;reported by Leroy from CIAT a few weeks ago&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;It seems the &lt;code&gt;dx.doi.org&lt;/code&gt; URLs are much more proper in our repository!&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspacetest=# select count(*) from metadatavalue where metadata_field_id=74 and text_value like &#39;http://dx.doi.org%&#39;;
count
-------
5638
(1 row)
dspacetest=# select count(*) from metadatavalue where metadata_field_id=74 and text_value like &#39;http://doi.org%&#39;;
count
-------
3
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I will manually edit the &lt;code&gt;dc.identifier.doi&lt;/code&gt; in &lt;a href=&#34;https://cgspace.cgiar.org/handle/10568/72509?show=full&#34;&gt;&lt;sup&gt;10568&lt;/sup&gt;&amp;frasl;&lt;sub&gt;72509&lt;/sub&gt;&lt;/a&gt; and tweet the link, then check back in a week to see if the donut gets updated&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-04-11:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-11&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The donut is already updated and shows the correct number now&lt;/li&gt;
&lt;li&gt;CCAFS people say it will only take them an hour to update their code for the metadata renames, so I proposed we&amp;rsquo;d do it tentatively on Monday the 18th.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-04-12:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-12&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Looking at quality of WLE data (&lt;code&gt;cg.subject.iwmi&lt;/code&gt;) in SQL:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspacetest=# select text_value, count(*) from metadatavalue where metadata_field_id=217 group by text_value order by count(*) desc;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Listings and Reports is still not returning reliable data for &lt;code&gt;dc.type&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;I think we need to ask Atmire, as their documentation isn&amp;rsquo;t too clear on the format of the filter configs&lt;/li&gt;
&lt;li&gt;Alternatively, I want to see if I move all the data from &lt;code&gt;dc.type.output&lt;/code&gt; to &lt;code&gt;dc.type&lt;/code&gt; and then re-index, if it behaves better&lt;/li&gt;
2016-04-12 17:18:36 +02:00
&lt;li&gt;Looking at our &lt;code&gt;input-forms.xml&lt;/code&gt; I see we have two sets of ILRI subjects, but one has a few extra subjects&lt;/li&gt;
&lt;li&gt;Remove one set of ILRI subjects and remove duplicate &lt;code&gt;VALUE CHAINS&lt;/code&gt; from existing list (&lt;a href=&#34;https://github.com/ilri/DSpace/pull/216&#34;&gt;#216&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;I decided to keep the set of subjects that had &lt;code&gt;FMD&lt;/code&gt; and &lt;code&gt;RANGELANDS&lt;/code&gt; added, as it appears to have been requested to have been added, and might be the newer list&lt;/li&gt;
&lt;li&gt;I found 226 blank metadatavalues:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspacetest# select * from metadatavalue where resource_type_id=2 and text_value=&#39;&#39;;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I think we should delete them and do a full re-index:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspacetest=# delete from metadatavalue where resource_type_id=2 and text_value=&#39;&#39;;
DELETE 226
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
2016-04-14 11:20:22 +02:00
&lt;li&gt;I deleted them on CGSpace but I&amp;rsquo;ll wait to do the re-index as we&amp;rsquo;re going to be doing one in a few days for the metadata changes anyways&lt;/li&gt;
2016-04-12 17:18:36 +02:00
&lt;li&gt;In other news, moving the &lt;code&gt;dc.type.output&lt;/code&gt; to &lt;code&gt;dc.type&lt;/code&gt; and re-indexing seems to have fixed the Listings and Reports issue from above&lt;/li&gt;
&lt;li&gt;Unfortunately this isn&amp;rsquo;t a very good solution, because Listings and Reports config should allow us to filter on &lt;code&gt;dc.type.*&lt;/code&gt; but the documentation isn&amp;rsquo;t very clear and I couldn&amp;rsquo;t reach Atmire today&lt;/li&gt;
&lt;li&gt;We want to do the &lt;code&gt;dc.type.output&lt;/code&gt; move on CGSpace anyways, but we should wait as it might affect other external people!&lt;/li&gt;
&lt;/ul&gt;
2016-04-14 11:20:22 +02:00
&lt;h2 id=&#34;2016-04-14:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-14&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Communicate with Macaroni Bros again about &lt;code&gt;dc.type&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Help Sisay with some rsync and Linux stuff&lt;/li&gt;
&lt;li&gt;Notify CIAT people of metadata changes (I had forgotten them last week)&lt;/li&gt;
&lt;/ul&gt;
2016-04-15 16:30:18 +02:00
&lt;h2 id=&#34;2016-04-15:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-15&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;DSpace Test had crashed, so I ran all system updates, rebooted, and re-deployed DSpace code&lt;/li&gt;
&lt;/ul&gt;
2016-04-18 18:01:18 +02:00
&lt;h2 id=&#34;2016-04-18:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-18&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Talk to CIAT people about their portal again&lt;/li&gt;
&lt;li&gt;Start looking more at the fields we want to delete&lt;/li&gt;
&lt;li&gt;The following metadata fields have 0 items using them, so we can just remove them from the registry and any references in XMLUI, input forms, etc:
&lt;ul&gt;
&lt;li&gt;dc.description.abstractother&lt;/li&gt;
&lt;li&gt;dc.whatwasknown&lt;/li&gt;
&lt;li&gt;dc.whatisnew&lt;/li&gt;
&lt;li&gt;dc.description.nationalpartners&lt;/li&gt;
&lt;li&gt;dc.peerreviewprocess&lt;/li&gt;
&lt;li&gt;cg.species.animal&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
2016-04-18 19:17:29 +02:00
&lt;li&gt;Deleted!&lt;/li&gt;
&lt;li&gt;The following fields have some items using them and I have to decide what to do with them (delete or move):
&lt;ul&gt;
&lt;li&gt;dc.icsubject.icrafsubject: 6 items, mostly in CPWF collections&lt;/li&gt;
&lt;li&gt;dc.type.journal: 11 items, mostly in ILRI collections&lt;/li&gt;
&lt;li&gt;dc.publicationcategory: 1 item, in CPWF&lt;/li&gt;
&lt;li&gt;dc.GRP: 2 items, CPWF&lt;/li&gt;
&lt;li&gt;dc.Species.animal: 6 items, in ILRI and AnGR&lt;/li&gt;
&lt;li&gt;cg.livestock.agegroup: 9 items, in ILRI collections&lt;/li&gt;
&lt;li&gt;cg.livestock.function: 20 items, mostly in EADD&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
2016-04-18 22:47:58 +02:00
&lt;li&gt;Test metadata migration on local instance again:&lt;/li&gt;
2016-04-18 18:01:18 +02:00
&lt;/ul&gt;
2016-04-18 22:47:58 +02:00
&lt;pre&gt;&lt;code&gt;$ ./migrate-fields.sh
UPDATE metadatavalue SET metadata_field_id=109 WHERE metadata_field_id=66
UPDATE 40885
UPDATE metadatavalue SET metadata_field_id=203 WHERE metadata_field_id=76
UPDATE 51330
UPDATE metadatavalue SET metadata_field_id=208 WHERE metadata_field_id=82
UPDATE 5986
UPDATE metadatavalue SET metadata_field_id=210 WHERE metadata_field_id=88
UPDATE 2456
UPDATE metadatavalue SET metadata_field_id=215 WHERE metadata_field_id=106
UPDATE 3872
UPDATE metadatavalue SET metadata_field_id=217 WHERE metadata_field_id=108
UPDATE 46075
$ JAVA_OPTS=&amp;quot;-Xms512m -Xmx512m -Dfile.encoding=UTF-8&amp;quot; ~/dspace/bin/dspace index-discovery -bf
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;CGSpace was down but I&amp;rsquo;m not sure why, this was in &lt;code&gt;catalina.out&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Apr 18, 2016 7:32:26 PM com.sun.jersey.spi.container.ContainerResponse logException
SEVERE: Mapped exception to response: 500 (Internal Server Error)
javax.ws.rs.WebApplicationException
at org.dspace.rest.Resource.processFinally(Resource.java:163)
at org.dspace.rest.HandleResource.getObject(HandleResource.java:81)
at sun.reflect.GeneratedMethodAccessor198.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
...
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Everything else in the system looked normal (50GB disk space available, nothing weird in dmesg, etc)&lt;/li&gt;
&lt;li&gt;After restarting Tomcat a few more of these errors were logged but the application was up&lt;/li&gt;
&lt;/ul&gt;
2016-04-19 14:49:29 +02:00
&lt;h2 id=&#34;2016-04-19:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-19&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Get handles for items that are using a given metadata field, ie &lt;code&gt;dc.Species.animal&lt;/code&gt; (105):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# select handle from item, handle where handle.resource_id = item.item_id AND item.item_id in (select resource_id from metadatavalue where resource_type_id=2 and metadata_field_id=105);
handle
-------------
10568/10298
10568/16413
10568/16774
10568/34487
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Delete metadata values for &lt;code&gt;dc.GRP&lt;/code&gt; and &lt;code&gt;dc.icsubject.icrafsubject&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# delete from metadatavalue where resource_type_id=2 and metadata_field_id=96;
# delete from metadatavalue where resource_type_id=2 and metadata_field_id=83;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;They are old ICRAF fields and we haven&amp;rsquo;t used them since 2011 or so&lt;/li&gt;
&lt;li&gt;Also delete them from the metadata registry&lt;/li&gt;
2016-04-19 18:23:10 +02:00
&lt;li&gt;CGSpace went down again, &lt;code&gt;dspace.log&lt;/code&gt; had this:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;2016-04-19 15:02:17,025 ERROR org.dspace.storage.rdbms.DatabaseManager @ SQL connection Error -
org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I restarted Tomcat and PostgreSQL and now it&amp;rsquo;s back up&lt;/li&gt;
&lt;li&gt;I bet this is the same crash as yesterday, but I only saw the errors in &lt;code&gt;catalina.out&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Looks to be related to this, from &lt;code&gt;dspace.log&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;2016-04-19 15:16:34,670 ERROR org.dspace.rest.Resource @ Something get wrong. Aborting context in finally statement.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;We have 18,000 of these errors right now&amp;hellip;&lt;/li&gt;
&lt;li&gt;Delete a few more old metadata values: &lt;code&gt;dc.Species.animal&lt;/code&gt;, &lt;code&gt;dc.type.journal&lt;/code&gt;, and &lt;code&gt;dc.publicationcategory&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# delete from metadatavalue where resource_type_id=2 and metadata_field_id=105;
# delete from metadatavalue where resource_type_id=2 and metadata_field_id=85;
# delete from metadatavalue where resource_type_id=2 and metadata_field_id=95;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;And then remove them from the metadata registry&lt;/li&gt;
2016-04-19 14:49:29 +02:00
&lt;/ul&gt;
2016-04-20 18:21:18 +02:00
&lt;h2 id=&#34;2016-04-20:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-20&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Re-deploy DSpace Test with the new subject and type fields, run all system updates, and reboot the server&lt;/li&gt;
&lt;li&gt;Migrate fields and re-deploy CGSpace with the new subject and type fields, run all system updates, and reboot the server&lt;/li&gt;
&lt;li&gt;Field migration went well:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ ./migrate-fields.sh
UPDATE metadatavalue SET metadata_field_id=109 WHERE metadata_field_id=66
UPDATE 40909
UPDATE metadatavalue SET metadata_field_id=203 WHERE metadata_field_id=76
UPDATE 51419
UPDATE metadatavalue SET metadata_field_id=208 WHERE metadata_field_id=82
UPDATE 5986
UPDATE metadatavalue SET metadata_field_id=210 WHERE metadata_field_id=88
UPDATE 2458
UPDATE metadatavalue SET metadata_field_id=215 WHERE metadata_field_id=106
UPDATE 3872
UPDATE metadatavalue SET metadata_field_id=217 WHERE metadata_field_id=108
UPDATE 46075
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Also, I migrated CGSpace to using the PGDG PostgreSQL repo as the infrastructure playbooks had been using it for a while and it seemed to be working well&lt;/li&gt;
&lt;li&gt;Basically, this gives us the ability to use the latest upstream stable 9.3.x release (currently 9.3.12)&lt;/li&gt;
2016-04-20 20:09:33 +02:00
&lt;li&gt;Looking into the REST API errors again, it looks like these started appearing a few days ago in the tens of thousands:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ grep -c &amp;quot;Aborting context in finally statement&amp;quot; dspace.log.2016-04-20
21252
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I found a recent discussion on the DSpace mailing list and I&amp;rsquo;ve asked for advice there&lt;/li&gt;
&lt;li&gt;Looks like this issue was noted and fixed in DSpace 5.5 (we&amp;rsquo;re on 5.1): &lt;a href=&#34;https://jira.duraspace.org/browse/DS-2936&#34;&gt;https://jira.duraspace.org/browse/DS-2936&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;ve sent a message to Atmire asking about compatibility with DSpace 5.5&lt;/li&gt;
2016-04-20 18:21:18 +02:00
&lt;/ul&gt;
2016-04-21 15:56:44 +02:00
&lt;h2 id=&#34;2016-04-21:c88be15f5b2f07c85f7742556a955e47&#34;&gt;2016-04-21&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Fix a bunch of metadata consistency issues with IITA Journal Articles (Peer review, Formally published, messed up DOIs, etc)&lt;/li&gt;
2016-04-22 09:17:08 +02:00
&lt;li&gt;Atmire responded with DSpace 5.5 compatible versions for their modules, so I&amp;rsquo;ll start testing those in a few weeks&lt;/li&gt;
2016-04-21 15:56:44 +02:00
&lt;/ul&gt;
</description>
</item>
<item>
<title>March, 2016</title>
<link>/cgspace-notes/2016-03/</link>
<pubDate>Wed, 02 Mar 2016 16:50:00 +0300</pubDate>
<guid>/cgspace-notes/2016-03/</guid>
<description>
&lt;h2 id=&#34;2016-03-02:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-02&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Looking at issues with author authorities on CGSpace&lt;/li&gt;
&lt;li&gt;For some reason we still have the &lt;code&gt;index-lucene-update&lt;/code&gt; cron job active on CGSpace, but I&amp;rsquo;m pretty sure we don&amp;rsquo;t need it as of the latest few versions of Atmire&amp;rsquo;s Listings and Reports module&lt;/li&gt;
&lt;li&gt;Reinstall my local (Mac OS X) DSpace stack with Tomcat 7, PostgreSQL 9.3, and Java JDK 1.7 to match environment on CGSpace server&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-07:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-07&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Troubleshooting the issues with the slew of commits for Atmire modules in &lt;a href=&#34;https://github.com/ilri/DSpace/pull/182&#34;&gt;#182&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Their changes on &lt;code&gt;5_x-dev&lt;/code&gt; branch work, but it is messy as hell with merge commits and old branch base&lt;/li&gt;
&lt;li&gt;When I rebase their branch on the latest &lt;code&gt;5_x-prod&lt;/code&gt; I get blank white pages&lt;/li&gt;
&lt;li&gt;I identified one commit that causes the issue and let them know&lt;/li&gt;
&lt;li&gt;Restart DSpace Test, as it seems to have crashed after Sisay tried to import some CSV or zip or something:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Exception in thread &amp;quot;Lucene Merge Thread #19&amp;quot; org.apache.lucene.index.MergePolicy$MergeException: java.io.IOException: No space left on device
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;2016-03-08:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-08&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Add a few new filters to Atmire&amp;rsquo;s Listings and Reports module (&lt;a href=&#34;https://github.com/ilri/DSpace/issues/180&#34;&gt;#180&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;We had also wanted to add a few to the Content and Usage module but I have to ask the editors which ones they were&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-10:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-10&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Disable the lucene cron job on CGSpace as it shouldn&amp;rsquo;t be needed anymore&lt;/li&gt;
&lt;li&gt;Discuss ORCiD and duplicate authors on Yammer&lt;/li&gt;
&lt;li&gt;Request new documentation for Atmire CUA and L&amp;amp;R modules, as ours are from 2013&lt;/li&gt;
&lt;li&gt;Walk Sisay through some data cleaning workflows in OpenRefine&lt;/li&gt;
&lt;li&gt;Start cleaning up the configuration for Atmire&amp;rsquo;s CUA module (&lt;a href=&#34;https://github.com/ilri/DSpace/issues/185&#34;&gt;#184&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;It is very messed up because some labels are incorrect, fields are missing, etc&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../images/2016/03/cua-label-mixup.png&#34; alt=&#34;Mixed up label in Atmire CUA&#34; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Update documentation for Atmire modules&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-11:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-11&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;As I was looking at the CUA config I realized our Discovery config is all messed up and confusing&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;ve opened an issue to track some of that work (&lt;a href=&#34;https://github.com/ilri/DSpace/issues/186&#34;&gt;#186&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;I did some major cleanup work on Discovery and XMLUI stuff related to the &lt;code&gt;dc.type&lt;/code&gt; indexes (&lt;a href=&#34;https://github.com/ilri/DSpace/pull/187&#34;&gt;#187&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;We had been confusing &lt;code&gt;dc.type&lt;/code&gt; (a Dublin Core value) with &lt;code&gt;dc.type.output&lt;/code&gt; (a value we invented) for a few years and it had permeated all aspects of our data, indexes, item displays, etc.&lt;/li&gt;
&lt;li&gt;There is still some more work to be done to remove references to old &lt;code&gt;outputtype&lt;/code&gt; and &lt;code&gt;output&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-14:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-14&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Fix some items that had invalid dates (I noticed them in the log during a re-indexing)&lt;/li&gt;
&lt;li&gt;Reset &lt;code&gt;search.index.*&lt;/code&gt; to the default, as it is only used by Lucene (deprecated by Discovery in DSpace 5.x): &lt;a href=&#34;https://github.com/ilri/DSpace/pull/188&#34;&gt;#188&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Make titles in Discovery and Browse by more consistent (singular, sentence case, etc) (&lt;a href=&#34;https://github.com/ilri/DSpace/issues/186&#34;&gt;#186&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Also four or so center-specific subject strings were missing for Discovery&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../images/2016/03/missing-xmlui-string.png&#34; alt=&#34;Missing XMLUI string&#34; /&gt;&lt;/p&gt;
&lt;h2 id=&#34;2016-03-15:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-15&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Create simple theme for new AVCD community just for a unique Google Tracking ID (&lt;a href=&#34;https://github.com/ilri/DSpace/pull/191&#34;&gt;#191&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-16:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-16&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Still having problems deploying Atmire&amp;rsquo;s CUA updates and fixes from January!&lt;/li&gt;
&lt;li&gt;More discussion on the GitHub issue here: &lt;a href=&#34;https://github.com/ilri/DSpace/pull/182&#34;&gt;https://github.com/ilri/DSpace/pull/182&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Clean up Atmire CUA config (&lt;a href=&#34;https://github.com/ilri/DSpace/pull/193&#34;&gt;#193&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Help Sisay with some PostgreSQL queries to clean up the incorrect &lt;code&gt;dc.contributor.corporateauthor&lt;/code&gt; field&lt;/li&gt;
&lt;li&gt;I noticed that we have some weird values in &lt;code&gt;dc.language&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# select * from metadatavalue where metadata_field_id=37;
metadata_value_id | resource_id | metadata_field_id | text_value | text_lang | place | authority | confidence | resource_type_id
-------------------+-------------+-------------------+------------+-----------+-------+-----------+------------+------------------
1942571 | 35342 | 37 | hi | | 1 | | -1 | 2
1942468 | 35345 | 37 | hi | | 1 | | -1 | 2
1942479 | 35337 | 37 | hi | | 1 | | -1 | 2
1942505 | 35336 | 37 | hi | | 1 | | -1 | 2
1942519 | 35338 | 37 | hi | | 1 | | -1 | 2
1942535 | 35340 | 37 | hi | | 1 | | -1 | 2
1942555 | 35341 | 37 | hi | | 1 | | -1 | 2
1942588 | 35343 | 37 | hi | | 1 | | -1 | 2
1942610 | 35346 | 37 | hi | | 1 | | -1 | 2
1942624 | 35347 | 37 | hi | | 1 | | -1 | 2
1942639 | 35339 | 37 | hi | | 1 | | -1 | 2
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;It seems this &lt;code&gt;dc.language&lt;/code&gt; field isn&amp;rsquo;t really used, but we should delete these values&lt;/li&gt;
&lt;li&gt;Also, &lt;code&gt;dc.language.iso&lt;/code&gt; has some weird values, like &amp;ldquo;En&amp;rdquo; and &amp;ldquo;English&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-17:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-17&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;It turns out &lt;code&gt;hi&lt;/code&gt; is the ISO 639 language code for Hindi, but these should be in &lt;code&gt;dc.language.iso&lt;/code&gt; instead of &lt;code&gt;dc.language&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;I fixed the eleven items with &lt;code&gt;hi&lt;/code&gt; as well as some using the incorrect &lt;code&gt;vn&lt;/code&gt; for Vietnamese&lt;/li&gt;
&lt;li&gt;Start discussing CG core with Abenet and Sisay&lt;/li&gt;
&lt;li&gt;Re-sync CGSpace database to DSpace Test for Atmire to do some tests about the problematic CUA patches&lt;/li&gt;
&lt;li&gt;The patches work fine with a clean database, so the error was caused by some mismatch in CUA versions and the database during my testing&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-18:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-18&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Merge Atmire fixes into &lt;code&gt;5_x-prod&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Discuss thumbnails with Francesca from Bioversity&lt;/li&gt;
&lt;li&gt;Some of their items end up with thumbnails that have a big white border around them:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../images/2016/03/bioversity-thumbnail-bad.jpg&#34; alt=&#34;Excessive whitespace in thumbnail&#34; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Turns out we can add &lt;code&gt;-trim&lt;/code&gt; to the GraphicsMagick options to trim the whitespace&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../images/2016/03/bioversity-thumbnail-good.jpg&#34; alt=&#34;Trimmed thumbnail&#34; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Command used:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ gm convert -trim -quality 82 -thumbnail x300 -flatten Descriptor\ for\ Butia_EN-2015_2021.pdf\[0\] cover.jpg
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Also, it looks like adding &lt;code&gt;-sharpen 0x1.0&lt;/code&gt; really improves the quality of the image for only a few KB&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-21:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-21&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Fix 66 site errors in Google&amp;rsquo;s webmaster tools&lt;/li&gt;
&lt;li&gt;I looked at a bunch of them and they were old URLs, weird things linked from non-existent items, etc, so I just marked them all as fixed&lt;/li&gt;
&lt;li&gt;We also have 1,300 &amp;ldquo;soft 404&amp;rdquo; errors for URLs like: &lt;a href=&#34;https://cgspace.cgiar.org/handle/10568/440/browse?type=bioversity&#34;&gt;https://cgspace.cgiar.org/handle/10568/440/browse?type=bioversity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;ve marked them as fixed as well since the ones I tested were working fine&lt;/li&gt;
&lt;li&gt;This raises another question, as many of these pages are linked from Discovery search results and might create a duplicate content problem&amp;hellip;&lt;/li&gt;
&lt;li&gt;Results pages like this give items that Google already knows from the sitemap: &lt;a href=&#34;https://cgspace.cgiar.org/discover?filtertype=author&amp;amp;filter_relational_operator=equals&amp;amp;filter=Orth%2C+A&#34;&gt;https://cgspace.cgiar.org/discover?filtertype=author&amp;amp;filter_relational_operator=equals&amp;amp;filter=Orth%2C+A&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;There are some access denied errors on JSPUI links (of course! we forbid them!), but I&amp;rsquo;m not sure why Google is trying to index them&amp;hellip;&lt;/li&gt;
&lt;li&gt;For example:
&lt;ul&gt;
&lt;li&gt;This: &lt;a href=&#34;https://cgspace.cgiar.org/jspui/bitstream/10568/809/1/main-page.pdf&#34;&gt;https://cgspace.cgiar.org/jspui/bitstream/10568/809/1/main-page.pdf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Linked from: &lt;a href=&#34;https://cgspace.cgiar.org/jspui/handle/10568/809&#34;&gt;https://cgspace.cgiar.org/jspui/handle/10568/809&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;I will mark these errors as resolved because they are returning HTTP 403 on purpose, for a long time!&lt;/li&gt;
&lt;li&gt;Google says the first time it saw this particular error was September 29, 2015&amp;hellip; so maybe it accidentally saw it somehow&amp;hellip;&lt;/li&gt;
&lt;li&gt;On a related note, we have 51,000 items indexed from the sitemap, but 500,000 items in the Google index, so we DEFINITELY have a problem with duplicate content&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../images/2016/03/google-index.png&#34; alt=&#34;CGSpace pages in Google index&#34; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Turns out this is a problem with DSpace&amp;rsquo;s &lt;code&gt;robots.txt&lt;/code&gt;, and there&amp;rsquo;s a Jira ticket since December, 2015: &lt;a href=&#34;https://jira.duraspace.org/browse/DS-2962&#34;&gt;https://jira.duraspace.org/browse/DS-2962&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I am not sure if I want to apply it yet&lt;/li&gt;
&lt;li&gt;For now I&amp;rsquo;ve just set a bunch of these dynamic pages to not appear in search results by using the URL Parameters tool in Webmaster Tools&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../images/2016/03/url-parameters.png&#34; alt=&#34;URL parameters cause millions of dynamic pages&#34; /&gt;
&lt;img src=&#34;../images/2016/03/url-parameters2.png&#34; alt=&#34;Setting pages with the filter_0 param not to show in search results&#34; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Move AVCD collection to new community and update &lt;code&gt;move_collection.sh&lt;/code&gt; script: &lt;a href=&#34;https://gist.github.com/alanorth/392c4660e8b022d99dfa&#34;&gt;https://gist.github.com/alanorth/392c4660e8b022d99dfa&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;It seems Feedburner can do HTTPS now, so we might be able to update our feeds and simplify the nginx configs&lt;/li&gt;
&lt;li&gt;De-deploy CGSpace with latest &lt;code&gt;5_x-prod&lt;/code&gt; branch&lt;/li&gt;
&lt;li&gt;Run updates on CGSpace and reboot server (new kernel, &lt;code&gt;4.5.0&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Deploy Let&amp;rsquo;s Encrypt certificate for cgspace.cgiar.org, but still need to work it into the ansible playbooks&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-22:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-22&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Merge robots.txt patch and disallow indexing of browse pages as our sitemap is consumed correctly (&lt;a href=&#34;https://github.com/ilri/DSpace/issues/198&#34;&gt;#198&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-23:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-23&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Abenet is having problems saving group memberships, and she gets this error: &lt;a href=&#34;https://gist.github.com/alanorth/87281c061c2de57b773e&#34;&gt;https://gist.github.com/alanorth/87281c061c2de57b773e&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Can&#39;t find method org.dspace.app.xmlui.aspect.administrative.FlowGroupUtils.processSaveGroup(org.dspace.core.Context,number,string,[Ljava.lang.String;,[Ljava.lang.String;,org.apache.cocoon.environment.wrapper.RequestWrapper). (resource://aspects/Administrative/administrative.js#967)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I can reproduce the same error on DSpace Test and on my Mac&lt;/li&gt;
&lt;li&gt;Looks to be an issue with the Atmire modules, I&amp;rsquo;ve submitted a ticket to their tracker.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-24:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-24&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Atmire sent a patch for the group saving issue: &lt;a href=&#34;https://github.com/ilri/DSpace/pull/201&#34;&gt;https://github.com/ilri/DSpace/pull/201&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I tested it locally and it works, so I merged it to &lt;code&gt;5_x-prod&lt;/code&gt; and will deploy on CGSpace this week&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-25:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-25&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Having problems with Listings and Reports, seems to be caused by a rogue reference to &lt;code&gt;dc.type.output&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;This is the error we get when we proceed to the second page of Listings and Reports: &lt;a href=&#34;https://gist.github.com/alanorth/b2d7fb5b82f94898caaf&#34;&gt;https://gist.github.com/alanorth/b2d7fb5b82f94898caaf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Commenting out the line works, but I haven&amp;rsquo;t figured out the proper syntax for referring to &lt;code&gt;dc.type.*&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-28:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-28&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Look into enabling the embargo during item submission, see: &lt;a href=&#34;https://wiki.duraspace.org/display/DSDOC5x/Embargo#Embargo-SubmissionProcess&#34;&gt;https://wiki.duraspace.org/display/DSDOC5x/Embargo#Embargo-SubmissionProcess&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Seems we only want &lt;code&gt;AccessStep&lt;/code&gt; because &lt;code&gt;UploadWithEmbargoStep&lt;/code&gt; disables the ability to edit embargos at the item level&lt;/li&gt;
&lt;li&gt;This pull request enables the ability to set an item-level embargo during submission: &lt;a href=&#34;https://github.com/ilri/DSpace/pull/203&#34;&gt;https://github.com/ilri/DSpace/pull/203&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I figured out that the problem with Listings and Reports was because I disabled the &lt;code&gt;search.index.*&lt;/code&gt; last week, and they are still used by JSPUI apparently&lt;/li&gt;
&lt;li&gt;This pull request re-enables them: &lt;a href=&#34;https://github.com/ilri/DSpace/pull/202&#34;&gt;https://github.com/ilri/DSpace/pull/202&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Re-deploy DSpace Test, run all system updates, and restart the server&lt;/li&gt;
&lt;li&gt;Looks like the Listings and Reports fix was NOT due to the search indexes (which are actually not used), and rather due to the filter configuration in the Listings and Reports config&lt;/li&gt;
&lt;li&gt;This pull request simply updates the config for the dc.type.outputdc.type change that was made last week: &lt;a href=&#34;https://github.com/ilri/DSpace/pull/204&#34;&gt;https://github.com/ilri/DSpace/pull/204&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Deploy robots.txt fix, embargo for item submissions, and listings and reports fix on CGSpace&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-03-29:5a28ddf3ee658c043c064ccddb151717&#34;&gt;2016-03-29&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Skype meeting with Peter and Addis team to discuss metadata changes for Dublin Core, CGcore, and CGSpace-specific fields&lt;/li&gt;
&lt;li&gt;We decided to proceed with some deletes first, then identify CGSpace-specific fields to clean/move to &lt;code&gt;cg.*&lt;/code&gt;, and then worry about broader changes to DC&lt;/li&gt;
&lt;li&gt;Before we move or rename and fields we need to circulate a list of fields we intend to change to CCAFS, CWPF, etc who might be harvesting the fields&lt;/li&gt;
&lt;li&gt;After all of this we need to start implementing controlled vocabularies for fields, either with the Javascript lookup or like existing ILRI subjects&lt;/li&gt;
&lt;/ul&gt;
</description>
</item>
<item>
<title>February, 2016</title>
<link>/cgspace-notes/2016-02/</link>
<pubDate>Fri, 05 Feb 2016 13:18:00 +0300</pubDate>
<guid>/cgspace-notes/2016-02/</guid>
<description>
&lt;h2 id=&#34;2016-02-05:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-05&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Looking at some DAGRIS data for Abenet Yabowork&lt;/li&gt;
&lt;li&gt;Lots of issues with spaces, newlines, etc causing the import to fail&lt;/li&gt;
&lt;li&gt;I noticed we have a very &lt;em&gt;interesting&lt;/em&gt; list of countries on CGSpace:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../images/2016/02/cgspace-countries.png&#34; alt=&#34;CGSpace country list&#34; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Not only are there 49,000 countries, we have some blanks (25)&amp;hellip;&lt;/li&gt;
&lt;li&gt;Also, lots of things like &amp;ldquo;COTE D`LVOIRE&amp;rdquo; and &amp;ldquo;COTE D IVOIRE&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-02-06:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-06&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Found a way to get items with null/empty metadata values from SQL&lt;/li&gt;
&lt;li&gt;First, find the &lt;code&gt;metadata_field_id&lt;/code&gt; for the field you want from the &lt;code&gt;metadatafieldregistry&lt;/code&gt; table:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspacetest=# select * from metadatafieldregistry;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;In this case our country field is 78&lt;/li&gt;
&lt;li&gt;Now find all resources with type 2 (item) that have null/empty values for that field:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspacetest=# select resource_id from metadatavalue where resource_type_id=2 and metadata_field_id=78 and (text_value=&#39;&#39; OR text_value IS NULL);
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Then you can find the handle that owns it from its &lt;code&gt;resource_id&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspacetest=# select handle from item, handle where handle.resource_id = item.item_id AND item.item_id = &#39;22678&#39;;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;It&amp;rsquo;s 25 items so editing in the web UI is annoying, let&amp;rsquo;s try SQL!&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspacetest=# delete from metadatavalue where metadata_field_id=78 and text_value=&#39;&#39;;
DELETE 25
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After that perhaps a regular &lt;code&gt;dspace index-discovery&lt;/code&gt; (no -b) &lt;em&gt;should&lt;/em&gt; suffice&amp;hellip;&lt;/li&gt;
&lt;li&gt;Hmm, I indexed, cleared the Cocoon cache, and restarted Tomcat but the 25 &amp;ldquo;|||&amp;rdquo; countries are still there&lt;/li&gt;
&lt;li&gt;Maybe I need to do a full re-index&amp;hellip;&lt;/li&gt;
&lt;li&gt;Yep! The full re-index seems to work.&lt;/li&gt;
&lt;li&gt;Process the empty countries on CGSpace&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-02-07:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-07&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Working on cleaning up Abenet&amp;rsquo;s DAGRIS data with OpenRefine&lt;/li&gt;
&lt;li&gt;I discovered two really nice functions in OpenRefine: &lt;code&gt;value.trim()&lt;/code&gt; and &lt;code&gt;value.escape(&amp;quot;javascript&amp;quot;)&lt;/code&gt; which shows whitespace characters like &lt;code&gt;\r\n&lt;/code&gt;!&lt;/li&gt;
&lt;li&gt;For some reason when you import an Excel file into OpenRefine it exports dates like 1949 to 1949.0 in the CSV&lt;/li&gt;
&lt;li&gt;I re-import the resulting CSV and run a GREL on the date issued column: &lt;code&gt;value.replace(&amp;quot;\.0&amp;quot;, &amp;quot;&amp;quot;)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;I need to start running DSpace in Mac OS X instead of a Linux VM&lt;/li&gt;
&lt;li&gt;Install PostgreSQL from homebrew, then configure and import CGSpace database dump:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ postgres -D /opt/brew/var/postgres
$ createuser --superuser postgres
$ createuser --pwprompt dspacetest
$ createdb -O dspacetest --encoding=UNICODE dspacetest
$ psql postgres
postgres=# alter user dspacetest createuser;
postgres=# \q
$ pg_restore -O -U dspacetest -d dspacetest ~/Downloads/cgspace_2016-02-07.backup
$ psql postgres
postgres=# alter user dspacetest nocreateuser;
postgres=# \q
$ vacuumdb dspacetest
$ psql -U dspacetest -f ~/src/git/DSpace/dspace/etc/postgres/update-sequences.sql dspacetest -h localhost
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After building and running a &lt;code&gt;fresh_install&lt;/code&gt; I symlinked the webapps into Tomcat&amp;rsquo;s webapps folder:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ mv /opt/brew/Cellar/tomcat/8.0.30/libexec/webapps/ROOT /opt/brew/Cellar/tomcat/8.0.30/libexec/webapps/ROOT.orig
$ ln -sfv ~/dspace/webapps/xmlui /opt/brew/Cellar/tomcat/8.0.30/libexec/webapps/ROOT
$ ln -sfv ~/dspace/webapps/rest /opt/brew/Cellar/tomcat/8.0.30/libexec/webapps/rest
$ ln -sfv ~/dspace/webapps/jspui /opt/brew/Cellar/tomcat/8.0.30/libexec/webapps/jspui
$ ln -sfv ~/dspace/webapps/oai /opt/brew/Cellar/tomcat/8.0.30/libexec/webapps/oai
$ ln -sfv ~/dspace/webapps/solr /opt/brew/Cellar/tomcat/8.0.30/libexec/webapps/solr
$ /opt/brew/Cellar/tomcat/8.0.30/bin/catalina start
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Add CATALINA_OPTS in &lt;code&gt;/opt/brew/Cellar/tomcat/8.0.30/libexec/bin/setenv.sh&lt;/code&gt;, as this script is sourced by the &lt;code&gt;catalina&lt;/code&gt; startup script&lt;/li&gt;
&lt;li&gt;For example:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;CATALINA_OPTS=&amp;quot;-Djava.awt.headless=true -Xms2048m -Xmx2048m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -Dfile.encoding=UTF-8&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After verifying that the site is working, start a full index:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ ~/dspace/bin/dspace index-discovery -b
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;2016-02-08:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-08&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Finish cleaning up and importing ~400 DAGRIS items into CGSpace&lt;/li&gt;
&lt;li&gt;Whip up some quick CSS to make the button in the submission workflow use the XMLUI theme&amp;rsquo;s brand colors (&lt;a href=&#34;https://github.com/ilri/DSpace/issues/154&#34;&gt;#154&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../images/2016/02/submit-button-ilri.png&#34; alt=&#34;ILRI submission buttons&#34; /&gt;
&lt;img src=&#34;../images/2016/02/submit-button-drylands.png&#34; alt=&#34;Drylands submission buttons&#34; /&gt;&lt;/p&gt;
&lt;h2 id=&#34;2016-02-09:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-09&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Re-sync DSpace Test with CGSpace&lt;/li&gt;
&lt;li&gt;Help Sisay with OpenRefine&lt;/li&gt;
&lt;li&gt;Enable HTTPS on DSpace Test using Let&amp;rsquo;s Encrypt:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ cd ~/src/git
$ git clone https://github.com/letsencrypt/letsencrypt
$ cd letsencrypt
$ sudo service nginx stop
# add port 443 to firewall rules
$ ./letsencrypt-auto certonly --standalone -d dspacetest.cgiar.org
$ sudo service nginx start
$ ansible-playbook dspace.yml -l linode02 -t nginx,firewall -u aorth --ask-become-pass
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;We should install it in /opt/letsencrypt and then script the renewal script, but first we have to wire up some variables and template stuff based on the script here: &lt;a href=&#34;https://letsencrypt.org/howitworks/&#34;&gt;https://letsencrypt.org/howitworks/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I had to export some CIAT items that were being cleaned up on the test server and I noticed their &lt;code&gt;dc.contributor.author&lt;/code&gt; fields have DSpace 5 authority index UUIDs&amp;hellip;&lt;/li&gt;
&lt;li&gt;To clean those up in OpenRefine I used this GREL expression: &lt;code&gt;value.replace(/::\w{8}-\w{4}-\w{4}-\w{4}-\w{12}::600/,&amp;quot;&amp;quot;)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Getting more and more hangs on DSpace Test, seemingly random but also during CSV import&lt;/li&gt;
&lt;li&gt;Logs don&amp;rsquo;t always show anything right when it fails, but eventually one of these appears:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;org.dspace.discovery.SearchServiceException: Error while processing facet fields: java.lang.OutOfMemoryError: Java heap space
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;or&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Right now DSpace Test&amp;rsquo;s Tomcat heap is set to 1536m and we have quite a bit of free RAM:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# free -m
total used free shared buffers cached
Mem: 3950 3902 48 9 37 1311
-/+ buffers/cache: 2552 1397
Swap: 255 57 198
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So I&amp;rsquo;ll bump up the Tomcat heap to 2048 (CGSpace production server is using 3GB)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-02-11:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-11&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Massaging some CIAT data in OpenRefine&lt;/li&gt;
&lt;li&gt;There are 1200 records that have PDFs, and will need to be imported into CGSpace&lt;/li&gt;
&lt;li&gt;I created a &lt;code&gt;filename&lt;/code&gt; column based on the &lt;code&gt;dc.identifier.url&lt;/code&gt; column using the following transform:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;value.split(&#39;/&#39;)[-1]
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Then I wrote a tool called &lt;a href=&#34;https://gist.github.com/alanorth/2206f24483fe5f0454fc&#34;&gt;&lt;code&gt;generate-thumbnails.py&lt;/code&gt;&lt;/a&gt; to download the PDFs and generate thumbnails for them, for example:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ ./generate-thumbnails.py ciat-reports.csv
Processing 64661.pdf
&amp;gt; Downloading 64661.pdf
&amp;gt; Creating thumbnail for 64661.pdf
Processing 64195.pdf
&amp;gt; Downloading 64195.pdf
&amp;gt; Creating thumbnail for 64195.pdf
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;2016-02-12:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-12&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Looking at CIAT&amp;rsquo;s records again, there are some problems with a dozen or so files (out of 1200)&lt;/li&gt;
&lt;li&gt;A few items are using the same exact PDF&lt;/li&gt;
&lt;li&gt;A few items are using HTM or DOC files&lt;/li&gt;
&lt;li&gt;A few items link to PDFs on IFPRI&amp;rsquo;s e-Library or Research Gate&lt;/li&gt;
&lt;li&gt;A few items have no item&lt;/li&gt;
&lt;li&gt;Also, I&amp;rsquo;m not sure if we import these items, will be remove the &lt;code&gt;dc.identifier.url&lt;/code&gt; field from the records?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-02-12-1:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-12&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Looking at CIAT&amp;rsquo;s records again, there are some files linking to PDFs on Slide Share, Embrapa, UEA UK, and Condesan, so I&amp;rsquo;m not sure if we can use those&lt;/li&gt;
&lt;li&gt;265 items have dirty, URL-encoded filenames:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ ls | grep -c -E &amp;quot;%&amp;quot;
265
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I suggest that we import ~850 or so of the clean ones first, then do the rest after I can find a clean/reliable way to decode the filenames&lt;/li&gt;
&lt;li&gt;This python2 snippet seems to work in the CLI, but not so well in OpenRefine:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ python -c &amp;quot;import urllib, sys; print urllib.unquote(sys.argv[1])&amp;quot; CIAT_COLOMBIA_000169_T%C3%A9cnicas_para_el_aislamiento_y_cultivo_de_protoplastos_de_yuca.pdf
CIAT_COLOMBIA_000169_Técnicas_para_el_aislamiento_y_cultivo_de_protoplastos_de_yuca.pdf
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Merge pull requests for submission form theming (&lt;a href=&#34;https://github.com/ilri/DSpace/pull/178&#34;&gt;#178&lt;/a&gt;) and missing center subjects in XMLUI item views (&lt;a href=&#34;https://github.com/ilri/DSpace/pull/176&#34;&gt;#176&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;They will be deployed on CGSpace the next time I re-deploy&lt;/li&gt;
&lt;/ul&gt;
2016-02-17 22:17:11 +01:00
&lt;h2 id=&#34;2016-02-16:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-16&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Turns out OpenRefine has an unescape function!&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;value.unescape(&amp;quot;url&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This turns the URLs into human-readable versions that we can use as proper filenames&lt;/li&gt;
&lt;li&gt;Run web server and system updates on DSpace Test and reboot&lt;/li&gt;
&lt;li&gt;To merge &lt;code&gt;dc.identifier.url&lt;/code&gt; and &lt;code&gt;dc.identifier.url[]&lt;/code&gt;, rename the second column so it doesn&amp;rsquo;t have the brackets, like &lt;code&gt;dc.identifier.url2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Then you create a facet for blank values on each column, show the rows that have values for one and not the other, then transform each independently to have the contents of the other, with &amp;ldquo;||&amp;rdquo; in between&lt;/li&gt;
&lt;li&gt;Work on Python script for parsing and downloading PDF records from &lt;code&gt;dc.identifier.url&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;To turn &lt;code&gt;dc.identifier.url&lt;/code&gt; into filenames, create a new column based o&lt;/li&gt;
&lt;li&gt;To get filenames from &lt;code&gt;dc.identifier.url&lt;/code&gt;, create a new column based on this transform: &lt;code&gt;forEach(value.split(&#39;||&#39;), v, v.split(&#39;/&#39;)[-1]).join(&#39;||&#39;)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;This also works for records that have multiple URLs (separated by &amp;ldquo;||&amp;rdquo;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-02-17:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-17&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Re-deploy CGSpace, run all system updates, and reboot&lt;/li&gt;
&lt;li&gt;More work on CIAT data, cleaning and doing a last metadata-only import into DSpace Test&lt;/li&gt;
2016-02-20 17:53:36 +01:00
&lt;li&gt;SAFBuilder has a bug preventing it from processing filenames containing more than one underscore&lt;/li&gt;
&lt;li&gt;Need to re-process the filename column to replace multiple underscores with one: &lt;code&gt;value.replace(/_{2,}/, &amp;quot;_&amp;quot;)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-02-20:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-20&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Turns out the &amp;ldquo;bug&amp;rdquo; in SAFBuilder isn&amp;rsquo;t a bug, it&amp;rsquo;s a feature that allows you to encode extra information like the destintion bundle in the filename&lt;/li&gt;
&lt;li&gt;Also, it seems DSpace&amp;rsquo;s SAF import tool doesn&amp;rsquo;t like importing filenames that have accents in them:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;java.io.FileNotFoundException: /usr/share/tomcat7/SimpleArchiveFormat/item_1021/CIAT_COLOMBIA_000075_Medición_de_palatabilidad_en_forrajes.pdf (No such file or directory)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Need to rename files to have no accents or umlauts, etc&amp;hellip;&lt;/li&gt;
&lt;li&gt;Useful custom text facet for URLs ending with &amp;ldquo;.pdf&amp;rdquo;: &lt;code&gt;value.endsWith(&amp;quot;.pdf&amp;quot;)&lt;/code&gt;&lt;/li&gt;
2016-02-17 22:17:11 +01:00
&lt;/ul&gt;
&lt;h2 id=&#34;2016-02-22:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-22&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;To change Spanish accents to ASCII in OpenRefine:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;value.replace(&#39;ó&#39;,&#39;o&#39;).replace(&#39;í&#39;,&#39;i&#39;).replace(&#39;á&#39;,&#39;a&#39;).replace(&#39;é&#39;,&#39;e&#39;).replace(&#39;ñ&#39;,&#39;n&#39;)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;But actually, the accents might not be an issue, as I can successfully import files containing Spanish accents on my Mac&lt;/li&gt;
&lt;li&gt;On closer inspection, I can import files with the following names on Linux (DSpace Test):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Bitstream: tést.pdf
Bitstream: tést señora.pdf
Bitstream: tést señora alimentación.pdf
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Seems it could be something with the HFS+ filesystem actually, as it&amp;rsquo;s not UTF-8 (&lt;a href=&#34;http://www.cio.com/article/2868393/linus-torvalds-apples-hfs-is-probably-the-worst-file-system-ever.html&#34;&gt;it&amp;rsquo;s something like UCS-2&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;HFS+ stores filenames as a string, and filenames with accents get stored as &lt;a href=&#34;https://blog.vrypan.net/2012/11/13/hfsplus-unicode-and-accented-chars/&#34;&gt;character+accent&lt;/a&gt; whereas Linux&amp;rsquo;s ext4 stores them as an array of bytes&lt;/li&gt;
&lt;li&gt;Running the SAFBuilder on Mac OS X works if you&amp;rsquo;re going to import the resulting bundle on Mac OS X, but if your DSpace is running on Linux you need to run the SAFBuilder there where the filesystem&amp;rsquo;s encoding matches&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-02-29:124a59adbaa8ef13e1518d003fc03981&#34;&gt;2016-02-29&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Got notified by some CIFOR colleagues that the Google Scholar team had contacted them about CGSpace&amp;rsquo;s incorrect ordering of authors in Google Scholar metadata&lt;/li&gt;
&lt;li&gt;Turns out there is a patch, and it was merged in DSpace 5.4: &lt;a href=&#34;https://jira.duraspace.org/browse/DS-2679&#34;&gt;https://jira.duraspace.org/browse/DS-2679&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;ve merged it into our &lt;code&gt;5_x-prod&lt;/code&gt; branch that is currently based on DSpace 5.1&lt;/li&gt;
&lt;li&gt;We found a bug when a user searches from the homepage, sorts the results, and then tries to click &amp;ldquo;View More&amp;rdquo; in a sidebar facet&lt;/li&gt;
&lt;li&gt;I am not sure what causes it yet, but I opened an issue for it: &lt;a href=&#34;https://github.com/ilri/DSpace/issues/179&#34;&gt;https://github.com/ilri/DSpace/issues/179&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Have more problems with SAFBuilder on Mac OS X&lt;/li&gt;
&lt;li&gt;Now it doesn&amp;rsquo;t recognize description hints in the filename column, like: &lt;code&gt;test.pdf__description:Blah&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;But on Linux it works fine&lt;/li&gt;
&lt;li&gt;Trying to test Atmire&amp;rsquo;s series of stats and CUA fixes from January and February, but their branch history is really messy and it&amp;rsquo;s hard to see what&amp;rsquo;s going on&lt;/li&gt;
&lt;li&gt;Rebasing their branch on top of our production branch results in a broken Tomcat, so I&amp;rsquo;m going to tell them to fix their history and make a proper pull request&lt;/li&gt;
&lt;li&gt;Looking at the filenames for the CIAT Reports, some have some really ugly characters, like: &lt;code&gt;&#39;&lt;/code&gt; or &lt;code&gt;,&lt;/code&gt; or &lt;code&gt;=&lt;/code&gt; or &lt;code&gt;[&lt;/code&gt; or &lt;code&gt;]&lt;/code&gt; or &lt;code&gt;(&lt;/code&gt; or &lt;code&gt;)&lt;/code&gt; or &lt;code&gt;_.pdf&lt;/code&gt; or &lt;code&gt;._&lt;/code&gt; etc&lt;/li&gt;
&lt;li&gt;It&amp;rsquo;s tricky to parse those things in some programming languages so I&amp;rsquo;d rather just get rid of the weird stuff now in OpenRefine:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;value.replace(&amp;quot;&#39;&amp;quot;,&#39;&#39;).replace(&#39;_=_&#39;,&#39;_&#39;).replace(&#39;,&#39;,&#39;&#39;).replace(&#39;[&#39;,&#39;&#39;).replace(&#39;]&#39;,&#39;&#39;).replace(&#39;(&#39;,&#39;&#39;).replace(&#39;)&#39;,&#39;&#39;).replace(&#39;_.pdf&#39;,&#39;.pdf&#39;).replace(&#39;._&#39;,&#39;_&#39;)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Finally import the 1127 CIAT items into CGSpace: &lt;a href=&#34;https://cgspace.cgiar.org/handle/10568/35710&#34;&gt;https://cgspace.cgiar.org/handle/10568/35710&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Re-deploy CGSpace with the Google Scholar fix, but I&amp;rsquo;m waiting on the Atmire fixes for now, as the branch history is ugly&lt;/li&gt;
&lt;/ul&gt;
</description>
</item>
<item>
<title>January, 2016</title>
<link>/cgspace-notes/2016-01/</link>
<pubDate>Wed, 13 Jan 2016 13:18:00 +0300</pubDate>
<guid>/cgspace-notes/2016-01/</guid>
<description>
&lt;h2 id=&#34;2016-01-13:3846b7fcbca60cdedafd373cb39cd76d&#34;&gt;2016-01-13&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Move ILRI collection &lt;code&gt;10568/12503&lt;/code&gt; from &lt;code&gt;10568/27869&lt;/code&gt; to &lt;code&gt;10568/27629&lt;/code&gt; using the &lt;a href=&#34;https://gist.github.com/alanorth/392c4660e8b022d99dfa&#34;&gt;move_collections.sh&lt;/a&gt; script I wrote last year.&lt;/li&gt;
&lt;li&gt;I realized it is only necessary to clear the Cocoon cache after moving collections—rather than reindexing—as no metadata has changed, and therefore no search or browse indexes need to be updated.&lt;/li&gt;
&lt;li&gt;Update GitHub wiki for documentation of &lt;a href=&#34;https://github.com/ilri/DSpace/wiki/Maintenance-Tasks&#34;&gt;maintenance tasks&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-01-14:3846b7fcbca60cdedafd373cb39cd76d&#34;&gt;2016-01-14&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Update CCAFS project identifiers in input-forms.xml&lt;/li&gt;
&lt;li&gt;Run system updates and restart the server&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-01-18:3846b7fcbca60cdedafd373cb39cd76d&#34;&gt;2016-01-18&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Change &amp;ldquo;Extension material&amp;rdquo; to &amp;ldquo;Extension Material&amp;rdquo; in input-forms.xml (a mistake that fell through the cracks when we fixed the others in DSpace 4 era)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-01-19:3846b7fcbca60cdedafd373cb39cd76d&#34;&gt;2016-01-19&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Work on tweaks and updates for the social sharing icons on item pages: add Delicious and Mendeley (from Academicons), make links open in new windows, and set the icon color to the theme&amp;rsquo;s primary color (&lt;a href=&#34;https://github.com/ilri/DSpace/issues/157&#34;&gt;#157&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Tweak date-based facets to show more values in drill-down ranges (&lt;a href=&#34;https://github.com/ilri/DSpace/issues/162&#34;&gt;#162&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Need to remember to clear the Cocoon cache after deployment or else you don&amp;rsquo;t see the new ranges immediately&lt;/li&gt;
&lt;li&gt;Set up recipe on IFTTT to tweet new items from the CGSpace Atom feed to my twitter account&lt;/li&gt;
&lt;li&gt;Altmetrics&amp;rsquo; support for Handles is kinda weak, so they can&amp;rsquo;t associate our items with DOIs until they are tweeted or blogged, etc first.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-01-21:3846b7fcbca60cdedafd373cb39cd76d&#34;&gt;2016-01-21&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Still waiting for my IFTTT recipe to fire, two days later&lt;/li&gt;
&lt;li&gt;It looks like the Atom feed on CGSpace hasn&amp;rsquo;t changed in two days, but there have definitely been new items&lt;/li&gt;
&lt;li&gt;The RSS feed is nearly as old, but has different old items there&lt;/li&gt;
&lt;li&gt;On a hunch I cleared the Cocoon cache and now the feeds are fresh&lt;/li&gt;
&lt;li&gt;Looks like there is configuration option related to this, &lt;code&gt;webui.feed.cache.age&lt;/code&gt;, which defaults to 48 hours, though I&amp;rsquo;m not sure what relation it has to the Cocoon cache&lt;/li&gt;
&lt;li&gt;In any case, we should change this cache to be something more like 6 hours, as we publish new items several times per day.&lt;/li&gt;
&lt;li&gt;Work around a CSS issue with long URLs in the item view (&lt;a href=&#34;https://github.com/ilri/DSpace/issues/172&#34;&gt;#172&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-01-25:3846b7fcbca60cdedafd373cb39cd76d&#34;&gt;2016-01-25&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Re-deploy CGSpace and DSpace Test with latest &lt;code&gt;5_x-prod&lt;/code&gt; branch&lt;/li&gt;
&lt;li&gt;This included the social icon fixes/updates, date-based facet tweaks, reducing the feed cache age, and fixing a layout issue in XMLUI item view when an item had long URLs&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-01-26:3846b7fcbca60cdedafd373cb39cd76d&#34;&gt;2016-01-26&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Run nginx updates on CGSpace and DSpace Test (&lt;a href=&#34;http://mailman.nginx.org/pipermail/nginx/2016-January/049700.html&#34;&gt;1.8.1 and 1.9.10, respectively&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Run updates on DSpace Test and reboot for new Linode kernel &lt;code&gt;Linux 4.4.0-x86_64-linode63&lt;/code&gt; (first update in months)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-01-28:3846b7fcbca60cdedafd373cb39cd76d&#34;&gt;2016-01-28&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Start looking at importing some Bioversity data that had been prepared earlier this week&lt;/li&gt;
&lt;li&gt;&lt;p&gt;While checking the data I noticed something strange, there are 79 items but only 8 unique PDFs:&lt;/p&gt;
&lt;p&gt;$ ls SimpleArchiveForBio/ | wc -l
79
$ find SimpleArchiveForBio/ -iname &amp;ldquo;*.pdf&amp;rdquo; -exec basename {} \; | sort -u | wc -l
8&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2016-01-29:3846b7fcbca60cdedafd373cb39cd76d&#34;&gt;2016-01-29&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Add five missing center-specific subjects to XMLUI item view (&lt;a href=&#34;https://github.com/ilri/DSpace/issues/174&#34;&gt;#174&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;This &lt;a href=&#34;https://cgspace.cgiar.org/handle/10568/67062&#34;&gt;CCAFS item&lt;/a&gt; Before:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../images/2016/01/xmlui-subjects-before.png&#34; alt=&#34;XMLUI subjects before&#34; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../images/2016/01/xmlui-subjects-after.png&#34; alt=&#34;XMLUI subjects after&#34; /&gt;&lt;/p&gt;
</description>
</item>
<item>
<title>December, 2015</title>
<link>/cgspace-notes/2015-12/</link>
<pubDate>Wed, 02 Dec 2015 13:18:00 +0300</pubDate>
<guid>/cgspace-notes/2015-12/</guid>
<description>
&lt;h2 id=&#34;2015-12-02:012a628feed6d64ae1151cbd6151ccd6&#34;&gt;2015-12-02&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Replace &lt;code&gt;lzop&lt;/code&gt; with &lt;code&gt;xz&lt;/code&gt; in log compression cron jobs on DSpace Test—it uses less space:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# cd /home/dspacetest.cgiar.org/log
# ls -lh dspace.log.2015-11-18*
-rw-rw-r-- 1 tomcat7 tomcat7 2.0M Nov 18 23:59 dspace.log.2015-11-18
-rw-rw-r-- 1 tomcat7 tomcat7 387K Nov 18 23:59 dspace.log.2015-11-18.lzo
-rw-rw-r-- 1 tomcat7 tomcat7 169K Nov 18 23:59 dspace.log.2015-11-18.xz
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I had used lrzip once, but it needs more memory and is harder to use as it requires the lrztar wrapper&lt;/li&gt;
&lt;li&gt;Need to remember to go check if everything is ok in a few days and then change CGSpace&lt;/li&gt;
&lt;li&gt;CGSpace went down again (due to PostgreSQL idle connections of course)&lt;/li&gt;
&lt;li&gt;Current database settings for DSpace are &lt;code&gt;db.maxconnections = 30&lt;/code&gt; and &lt;code&gt;db.maxidle = 8&lt;/code&gt;, yet idle connections are exceeding this:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ psql -c &#39;SELECT * from pg_stat_activity;&#39; | grep cgspace | grep -c idle
39
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I restarted PostgreSQL and Tomcat and it&amp;rsquo;s back&lt;/li&gt;
&lt;li&gt;On a related note of why CGSpace is so slow, I decided to finally try the &lt;code&gt;pgtune&lt;/code&gt; script to tune the postgres settings:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# apt-get install pgtune
# pgtune -i /etc/postgresql/9.3/main/postgresql.conf -o postgresql.conf-pgtune
# mv /etc/postgresql/9.3/main/postgresql.conf /etc/postgresql/9.3/main/postgresql.conf.orig
# mv postgresql.conf-pgtune /etc/postgresql/9.3/main/postgresql.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;It introduced the following new settings:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;default_statistics_target = 50
maintenance_work_mem = 480MB
constraint_exclusion = on
checkpoint_completion_target = 0.9
effective_cache_size = 5632MB
work_mem = 48MB
wal_buffers = 8MB
checkpoint_segments = 16
shared_buffers = 1920MB
max_connections = 80
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now I need to go read PostgreSQL docs about these options, and watch memory settings in munin etc&lt;/li&gt;
&lt;li&gt;For what it&amp;rsquo;s worth, now the REST API should be faster (because of these PostgreSQL tweaks):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
1.474
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
2.141
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
1.685
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
1.995
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
1.786
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Last week it was an average of 8 seconds&amp;hellip; now this is &lt;sup&gt;1&lt;/sup&gt;&amp;frasl;&lt;sub&gt;4&lt;/sub&gt; of that&lt;/li&gt;
&lt;li&gt;CCAFS noticed that one of their items displays only the Atmire statlets: &lt;a href=&#34;https://cgspace.cgiar.org/handle/10568/42445&#34;&gt;https://cgspace.cgiar.org/handle/10568/42445&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../images/2015/12/ccafs-item-no-metadata.png&#34; alt=&#34;CCAFS item&#34; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The authorizations for the item are all public READ, and I don&amp;rsquo;t see any errors in dspace.log when browsing that item&lt;/li&gt;
&lt;li&gt;I filed a ticket on Atmire&amp;rsquo;s issue tracker&lt;/li&gt;
&lt;li&gt;I also filed a ticket on Atmire&amp;rsquo;s issue tracker for the PostgreSQL stuff&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2015-12-03:012a628feed6d64ae1151cbd6151ccd6&#34;&gt;2015-12-03&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;CGSpace very slow, and monitoring emailing me to say its down, even though I can load the page (very slowly)&lt;/li&gt;
&lt;li&gt;Idle postgres connections look like this (with no change in DSpace db settings lately):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ psql -c &#39;SELECT * from pg_stat_activity;&#39; | grep cgspace | grep -c idle
29
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I restarted Tomcat and postgres&amp;hellip;&lt;/li&gt;
&lt;li&gt;Atmire commented that we should raise the JVM heap size by ~500M, so it is now &lt;code&gt;-Xms3584m -Xmx3584m&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;We weren&amp;rsquo;t out of heap yet, but it&amp;rsquo;s probably fair enough that the DSpace 5 upgrade (and new Atmire modules) requires more memory so it&amp;rsquo;s ok&lt;/li&gt;
&lt;li&gt;A possible side effect is that I see that the REST API is twice as fast for the request above now:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
1.368
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
0.968
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
1.006
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
0.849
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
0.806
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
0.854
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;2015-12-05:012a628feed6d64ae1151cbd6151ccd6&#34;&gt;2015-12-05&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;CGSpace has been up and down all day and REST API is completely unresponsive&lt;/li&gt;
&lt;li&gt;PostgreSQL idle connections are currently:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;postgres@linode01:~$ psql -c &#39;SELECT * from pg_stat_activity;&#39; | grep cgspace | grep -c idle
28
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I have reverted all the pgtune tweaks from the other day, as they didn&amp;rsquo;t fix the stability issues, so I&amp;rsquo;d rather not have them introducing more variables into the equation&lt;/li&gt;
&lt;li&gt;The PostgreSQL stats from Munin all point to something database-related with the DSpace 5 upgrade around midlate November&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;../images/2015/12/postgres_bgwriter-year.png&#34; alt=&#34;PostgreSQL bgwriter (year)&#34; /&gt;
&lt;img src=&#34;../images/2015/12/postgres_cache_cgspace-year.png&#34; alt=&#34;PostgreSQL cache (year)&#34; /&gt;
&lt;img src=&#34;../images/2015/12/postgres_locks_cgspace-year.png&#34; alt=&#34;PostgreSQL locks (year)&#34; /&gt;
&lt;img src=&#34;../images/2015/12/postgres_scans_cgspace-year.png&#34; alt=&#34;PostgreSQL scans (year)&#34; /&gt;&lt;/p&gt;
&lt;h2 id=&#34;2015-12-07:012a628feed6d64ae1151cbd6151ccd6&#34;&gt;2015-12-07&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Atmire sent &lt;a href=&#34;https://github.com/ilri/DSpace/pull/161&#34;&gt;some fixes&lt;/a&gt; to DSpace&amp;rsquo;s REST API code that was leaving contexts open (causing the slow performance and database issues)&lt;/li&gt;
&lt;li&gt;After deploying the fix to CGSpace the REST API is consistently faster:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
0.675
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
0.599
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
0.588
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
0.566
$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
0.497
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;2015-12-08:012a628feed6d64ae1151cbd6151ccd6&#34;&gt;2015-12-08&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Switch CGSpace log compression cron jobs from using lzop to xz—the compression isn&amp;rsquo;t as good, but it&amp;rsquo;s much faster and causes less IO/CPU load&lt;/li&gt;
&lt;li&gt;Since we figured out (and fixed) the cause of the performance issue, I reverted Google Bot&amp;rsquo;s crawl rate to the &amp;ldquo;Let Google optimize&amp;rdquo; setting&lt;/li&gt;
&lt;/ul&gt;
</description>
</item>
<item>
<title>November, 2015</title>
<link>/cgspace-notes/2015-11/</link>
<pubDate>Mon, 23 Nov 2015 17:00:57 +0300</pubDate>
<guid>/cgspace-notes/2015-11/</guid>
<description>
&lt;h2 id=&#34;2015-11-22:3d03b850f8126f80d8144c2e17ea0ae7&#34;&gt;2015-11-22&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;CGSpace went down&lt;/li&gt;
&lt;li&gt;Looks like DSpace exhausted its PostgreSQL connection pool&lt;/li&gt;
&lt;li&gt;Last week I had increased the limit from 30 to 60, which seemed to help, but now there are many more idle connections:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ psql -c &#39;SELECT * from pg_stat_activity;&#39; | grep idle | grep -c cgspace
78
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;For now I have increased the limit from 60 to 90, run updates, and rebooted the server&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2015-11-24:3d03b850f8126f80d8144c2e17ea0ae7&#34;&gt;2015-11-24&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;CGSpace went down again&lt;/li&gt;
&lt;li&gt;Getting emails from uptimeRobot and uptimeButler that it&amp;rsquo;s down, and Google Webmaster Tools is sending emails that there is an increase in crawl errors&lt;/li&gt;
&lt;li&gt;Looks like there are still a bunch of idle PostgreSQL connections:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ psql -c &#39;SELECT * from pg_stat_activity;&#39; | grep idle | grep -c cgspace
96
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;For some reason the number of idle connections is very high since we upgraded to DSpace 5&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2015-11-25:3d03b850f8126f80d8144c2e17ea0ae7&#34;&gt;2015-11-25&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Troubleshoot the DSpace 5 OAI breakage caused by nginx routing config&lt;/li&gt;
&lt;li&gt;The OAI application requests stylesheets and javascript files with the path &lt;code&gt;/oai/static/css&lt;/code&gt;, which gets matched here:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# static assets we can load from the file system directly with nginx
location ~ /(themes|static|aspects/ReportingSuite) {
try_files $uri @tomcat;
...
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;The document root is relative to the xmlui app, so this gets a 404—I&amp;rsquo;m not sure why it doesn&amp;rsquo;t pass to &lt;code&gt;@tomcat&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Anyways, I can&amp;rsquo;t find any URIs with path &lt;code&gt;/static&lt;/code&gt;, and the more important point is to handle all the static theme assets, so we can just remove &lt;code&gt;static&lt;/code&gt; from the regex for now (who cares if we can&amp;rsquo;t use nginx to send Etags for OAI CSS!)&lt;/li&gt;
&lt;li&gt;Also, I noticed we aren&amp;rsquo;t setting CSP headers on the static assets, because in nginx headers are inherited in child blocks, but if you use &lt;code&gt;add_header&lt;/code&gt; in a child block it doesn&amp;rsquo;t inherit the others&lt;/li&gt;
&lt;li&gt;We simply need to add &lt;code&gt;include extra-security.conf;&lt;/code&gt; to the above location block (but research and test first)&lt;/li&gt;
&lt;li&gt;We should add WOFF assets to the list of things to set expires for:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;location ~* \.(?:ico|css|js|gif|jpe?g|png|woff)$ {
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;We should also add &lt;code&gt;aspects/Statistics&lt;/code&gt; to the location block for static assets (minus &lt;code&gt;static&lt;/code&gt; from above):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;location ~ /(themes|aspects/ReportingSuite|aspects/Statistics) {
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Need to check &lt;code&gt;/about&lt;/code&gt; on CGSpace, as it&amp;rsquo;s blank on my local test server and we might need to add something there&lt;/li&gt;
&lt;li&gt;CGSpace has been up and down all day due to PostgreSQL idle connections (current DSpace pool is 90):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ psql -c &#39;SELECT * from pg_stat_activity;&#39; | grep idle | grep -c cgspace
93
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I looked closer at the idle connections and saw that many have been idle for hours (current time on server is &lt;code&gt;2015-11-25T20:20:42+0000&lt;/code&gt;):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ psql -c &#39;SELECT * from pg_stat_activity;&#39; | less -S
datid | datname | pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | xact_start |
-------+----------+-------+----------+----------+------------------+-------------+-----------------+-------------+-------------------------------+-------------------------------+---
20951 | cgspace | 10966 | 18205 | cgspace | | 127.0.0.1 | | 37731 | 2015-11-25 13:13:02.837624+00 | | 20
20951 | cgspace | 10967 | 18205 | cgspace | | 127.0.0.1 | | 37737 | 2015-11-25 13:13:03.069421+00 | | 20
...
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;There is a relevant Jira issue about this: &lt;a href=&#34;https://jira.duraspace.org/browse/DS-1458&#34;&gt;https://jira.duraspace.org/browse/DS-1458&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;It seems there is some sense changing DSpace&amp;rsquo;s default &lt;code&gt;db.maxidle&lt;/code&gt; from unlimited (-1) to something like 8 (Tomcat default) or 10 (Confluence default)&lt;/li&gt;
&lt;li&gt;Change &lt;code&gt;db.maxidle&lt;/code&gt; from -1 to 10, reduce &lt;code&gt;db.maxconnections&lt;/code&gt; from 90 to 50, and restart postgres and tomcat7&lt;/li&gt;
&lt;li&gt;Also redeploy DSpace Test with a clean sync of CGSpace and mirror these database settings there as well&lt;/li&gt;
&lt;li&gt;Also deploy the nginx fixes for the &lt;code&gt;try_files&lt;/code&gt; location block as well as the expires block&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2015-11-26:3d03b850f8126f80d8144c2e17ea0ae7&#34;&gt;2015-11-26&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;CGSpace behaving much better since changing &lt;code&gt;db.maxidle&lt;/code&gt; yesterday, but still two up/down notices from monitoring this morning (better than 50!)&lt;/li&gt;
&lt;li&gt;CCAFS colleagues mentioned that the REST API is very slow, 24 seconds for one item&lt;/li&gt;
&lt;li&gt;Not as bad for me, but still unsustainable if you have to get many:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ curl -o /dev/null -s -w %{time_total}\\n https://cgspace.cgiar.org/rest/handle/10568/32802?expand=all
8.415
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Monitoring e-mailed in the evening to say CGSpace was down&lt;/li&gt;
&lt;li&gt;Idle connections in PostgreSQL again:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ psql -c &#39;SELECT * from pg_stat_activity;&#39; | grep cgspace | grep -c idle
66
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;At the time, the current DSpace pool size was 50&amp;hellip;&lt;/li&gt;
&lt;li&gt;I reduced the pool back to the default of 30, and reduced the &lt;code&gt;db.maxidle&lt;/code&gt; settings from 10 to 8&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;2015-11-29:3d03b850f8126f80d8144c2e17ea0ae7&#34;&gt;2015-11-29&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Still more alerts that CGSpace has been up and down all day&lt;/li&gt;
&lt;li&gt;Current database settings for DSpace:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;db.maxconnections = 30
db.maxwait = 5000
db.maxidle = 8
db.statementpool = true
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;And idle connections:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ psql -c &#39;SELECT * from pg_stat_activity;&#39; | grep cgspace | grep -c idle
49
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Perhaps I need to start drastically increasing the connection limits—like to 300—to see if DSpace&amp;rsquo;s thirst can ever be quenched&lt;/li&gt;
&lt;li&gt;On another note, SUNScholar&amp;rsquo;s notes suggest adjusting some other postgres variables: &lt;a href=&#34;http://wiki.lib.sun.ac.za/index.php/SUNScholar/Optimisations/Database&#34;&gt;http://wiki.lib.sun.ac.za/index.php/SUNScholar/Optimisations/Database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;This might help with REST API speed (which I mentioned above and still need to do real tests)&lt;/li&gt;
&lt;/ul&gt;
</description>
</item>
</channel>
</rss>