2018-11-01 15:43:37 +01:00
<!DOCTYPE html>
2019-10-11 10:19:42 +02:00
< html lang = "en" >
2018-11-01 15:43:37 +01:00
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width, initial-scale=1, shrink-to-fit=no" >
2020-12-06 15:53:29 +01:00
2018-11-01 15:43:37 +01:00
< meta property = "og:title" content = "November, 2018" / >
< meta property = "og:description" content = "2018-11-01
Finalize AReS Phase I and Phase II ToRs
Send a note about my dspace-statistics-api to the dspace-tech mailing list
2018-11-03 17:13:49 +01:00
2018-11-03
Linode has been sending mails a few times a day recently that CGSpace (linode18) has had high CPU usage
Today these are the top 10 IPs:
2018-11-01 15:43:37 +01:00
" />
< meta property = "og:type" content = "article" / >
2019-02-02 13:12:57 +01:00
< meta property = "og:url" content = "https://alanorth.github.io/cgspace-notes/2018-11/" / >
2019-08-08 17:10:44 +02:00
< meta property = "article:published_time" content = "2018-11-01T16:41:30+02:00" / >
2019-10-28 12:43:25 +01:00
< meta property = "article:modified_time" content = "2019-10-28T13:39:25+02:00" / >
2018-11-01 15:43:37 +01:00
2020-12-06 15:53:29 +01:00
2018-11-01 15:43:37 +01:00
< meta name = "twitter:card" content = "summary" / >
< meta name = "twitter:title" content = "November, 2018" / >
< meta name = "twitter:description" content = "2018-11-01
Finalize AReS Phase I and Phase II ToRs
Send a note about my dspace-statistics-api to the dspace-tech mailing list
2018-11-03 17:13:49 +01:00
2018-11-03
Linode has been sending mails a few times a day recently that CGSpace (linode18) has had high CPU usage
Today these are the top 10 IPs:
2018-11-01 15:43:37 +01:00
"/>
2022-06-23 07:40:53 +02:00
< meta name = "generator" content = "Hugo 0.101.0" / >
2018-11-01 15:43:37 +01:00
< script type = "application/ld+json" >
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"headline": "November, 2018",
2020-04-02 09:55:42 +02:00
"url": "https://alanorth.github.io/cgspace-notes/2018-11/",
2018-12-04 09:02:51 +01:00
"wordCount": "2823",
2019-10-11 10:19:42 +02:00
"datePublished": "2018-11-01T16:41:30+02:00",
2019-10-28 12:43:25 +01:00
"dateModified": "2019-10-28T13:39:25+02:00",
2018-11-01 15:43:37 +01:00
"author": {
"@type": "Person",
"name": "Alan Orth"
},
"keywords": "Notes"
}
< / script >
< link rel = "canonical" href = "https://alanorth.github.io/cgspace-notes/2018-11/" >
< title > November, 2018 | CGSpace Notes< / title >
2019-10-11 10:19:42 +02:00
2018-11-01 15:43:37 +01:00
<!-- combined, minified CSS -->
2020-01-23 19:19:38 +01:00
2022-08-01 15:36:13 +02:00
< link href = "https://alanorth.github.io/cgspace-notes/css/style.c6ba80bc50669557645abe05f86b73cc5af84408ed20f1551a267bc19ece8228.css" rel = "stylesheet" integrity = "sha256-xrqAvFBmlVdkWr4F+GtzzFr4RAjtIPFVGiZ7wZ7Ogig=" crossorigin = "anonymous" >
2019-10-11 10:19:42 +02:00
2018-11-01 15:43:37 +01:00
2020-01-28 11:01:42 +01:00
<!-- minified Font Awesome for SVG icons -->
2021-09-28 09:32:32 +02:00
< script defer src = "https://alanorth.github.io/cgspace-notes/js/fontawesome.min.f5072c55a0721857184db93a50561d7dc13975b4de2e19db7f81eb5f3fa57270.js" integrity = "sha256-9QcsVaByGFcYTbk6UFYdfcE5dbTeLhnbf4HrXz+lcnA=" crossorigin = "anonymous" > < / script >
2020-01-28 11:01:42 +01:00
2019-04-14 15:59:47 +02:00
<!-- RSS 2.0 feed -->
2018-11-01 15:43:37 +01:00
< / head >
< body >
< div class = "blog-masthead" >
< div class = "container" >
< nav class = "nav blog-nav" >
< a class = "nav-link " href = "https://alanorth.github.io/cgspace-notes/" > Home< / a >
< / nav >
< / div >
< / div >
2018-12-19 12:20:39 +01:00
2018-11-01 15:43:37 +01:00
< header class = "blog-header" >
< div class = "container" >
2019-10-11 10:19:42 +02:00
< h1 class = "blog-title" dir = "auto" > < a href = "https://alanorth.github.io/cgspace-notes/" rel = "home" > CGSpace Notes< / a > < / h1 >
< p class = "lead blog-description" dir = "auto" > Documenting day-to-day work on the < a href = "https://cgspace.cgiar.org" > CGSpace< / a > repository.< / p >
2018-11-01 15:43:37 +01:00
< / div >
< / header >
2018-12-19 12:20:39 +01:00
2018-11-01 15:43:37 +01:00
< div class = "container" >
< div class = "row" >
< div class = "col-sm-8 blog-main" >
< article class = "blog-post" >
< header >
2019-10-11 10:19:42 +02:00
< h2 class = "blog-post-title" dir = "auto" > < a href = "https://alanorth.github.io/cgspace-notes/2018-11/" > November, 2018< / a > < / h2 >
2020-11-16 09:54:00 +01:00
< p class = "blog-post-meta" >
< time datetime = "2018-11-01T16:41:30+02:00" > Thu Nov 01, 2018< / time >
in
2022-06-23 07:40:53 +02:00
< span class = "fas fa-folder" aria-hidden = "true" > < / span > < a href = "/categories/notes/" rel = "category tag" > Notes< / a >
2018-11-01 15:43:37 +01:00
< / p >
< / header >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-01" > 2018-11-01< / h2 >
2018-11-01 15:43:37 +01:00
< ul >
< li > Finalize AReS Phase I and Phase II ToRs< / li >
< li > Send a note about my < a href = "https://github.com/ilri/dspace-statistics-api" > dspace-statistics-api< / a > to the dspace-tech mailing list< / li >
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-03" > 2018-11-03< / h2 >
2018-11-03 17:13:49 +01:00
< ul >
< li > Linode has been sending mails a few times a day recently that CGSpace (linode18) has had high CPU usage< / li >
< li > Today these are the top 10 IPs:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > # zcat --force /var/log/nginx/*.log /var/log/nginx/*.log.1 | grep -E " 03/Nov/2018" | awk ' {print $1}' | sort | uniq -c | sort -n | tail -n 10
2018-11-03 17:13:49 +01:00
1300 66.249.64.63
1384 35.237.175.180
1430 138.201.52.218
1455 207.46.13.156
1500 40.77.167.175
1979 50.116.102.77
2790 66.249.64.61
3367 84.38.130.177
4537 70.32.83.92
22508 66.249.64.59
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
2018-11-03 17:13:49 +01:00
< li > The < code > 66.249.64.x< / code > are definitely Google< / li >
2020-01-27 15:20:44 +01:00
< li > < code > 70.32.83.92< / code > is well known, probably CCAFS or something, as it’ s only a few thousand requests and always to REST API< / li >
2019-11-28 16:30:45 +01:00
< li > < code > 84.38.130.177< / code > is some new IP in Latvia that is only hitting the XMLUI, using the following user agent:< / li >
< / ul >
2021-09-13 15:21:16 +02:00
< pre tabindex = "0" > < code > Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.792.0 Safari/535.1
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > They at least seem to be re-using their Tomcat sessions:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > $ grep -c -E ' session_id=[A-Z0-9]{32}:ip_addr=84.38.130.177' dspace.log.2018-11-03
2018-11-03 17:13:49 +01:00
342
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > < code > 50.116.102.77< / code > is also a regular REST API user< / li >
< li > < code > 40.77.167.175< / code > and < code > 207.46.13.156< / code > seem to be Bing< / li >
< li > < code > 138.201.52.218< / code > seems to be on Hetzner in Germany, but is using this user agent:< / li >
< / ul >
2021-09-13 15:21:16 +02:00
< pre tabindex = "0" > < code > Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:62.0) Gecko/20100101 Firefox/62.0
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
2020-01-27 15:20:44 +01:00
< li > And it doesn’ t seem they are re-using their Tomcat sessions:< / li >
2019-11-28 16:30:45 +01:00
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > $ grep -c -E ' session_id=[A-Z0-9]{32}:ip_addr=138.201.52.218' dspace.log.2018-11-03
2018-11-03 17:13:49 +01:00
1243
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
2020-01-27 15:20:44 +01:00
< li > Ah, we’ ve apparently seen this server exactly a year ago in 2017-11, making 40,000 requests in one day… < / li >
< li > I wonder if it’ s worth adding them to the list of bots in the nginx config?< / li >
2019-11-28 16:30:45 +01:00
< li > Linode sent a mail that CGSpace (linode18) is using high outgoing bandwidth< / li >
< li > Looking at the nginx logs again I see the following top ten IPs:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > # zcat --force /var/log/nginx/*.log /var/log/nginx/*.log.1 | grep -E " 03/Nov/2018" | awk ' {print $1}' | sort | uniq -c | sort -n | tail -n 10
2019-11-28 16:30:45 +01:00
1979 50.116.102.77
1980 35.237.175.180
2186 207.46.13.156
2208 40.77.167.175
2843 66.249.64.63
4220 84.38.130.177
4537 70.32.83.92
5593 66.249.64.61
12557 78.46.89.18
32152 66.249.64.59
< / code > < / pre > < ul >
2020-01-27 15:20:44 +01:00
< li > < code > 78.46.89.18< / code > is new since I last checked a few hours ago, and it’ s from Hetzner with the following user agent:< / li >
2019-11-28 16:30:45 +01:00
< / ul >
2021-09-13 15:21:16 +02:00
< pre tabindex = "0" > < code > Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:62.0) Gecko/20100101 Firefox/62.0
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
2020-01-27 15:20:44 +01:00
< li > It’ s making lots of requests, though actually it does seem to be re-using its Tomcat sessions:< / li >
2019-11-28 16:30:45 +01:00
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > $ grep -c -E ' session_id=[A-Z0-9]{32}:ip_addr=78.46.89.18' dspace.log.2018-11-03
2018-11-04 00:02:29 +01:00
8449
2022-03-04 13:30:06 +01:00
$ grep -o -E ' session_id=[A-Z0-9]{32}:ip_addr=78.46.89.18' dspace.log.2018-11-03 | sort | uniq | wc -l
2018-12-04 09:02:51 +01:00
1
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > < em > Updated on 2018-12-04 to correct the grep command above, as it was inaccurate and it seems the bot was actually already re-using its Tomcat sessions< / em > < / li >
< li > I could add this IP to the list of bot IPs in nginx, but it seems like a futile effort when some new IP could come along and do the same thing< / li >
< li > Perhaps I should think about adding rate limits to dynamic pages like < code > /discover< / code > and < code > /browse< / code > < / li >
2020-01-27 15:20:44 +01:00
< li > I think it’ s reasonable for a human to click one of those links five or ten times a minute… < / li >
2019-11-28 16:30:45 +01:00
< li > To contrast, < code > 78.46.89.18< / code > made about 300 requests per minute for a few hours today:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > # grep 78.46.89.18 /var/log/nginx/access.log | grep -o -E ' 03/Nov/2018:[0-9][0-9]:[0-9][0-9]' | sort | uniq -c | sort -n | tail -n 20
2019-11-28 16:30:45 +01:00
286 03/Nov/2018:18:02
287 03/Nov/2018:18:21
289 03/Nov/2018:18:23
291 03/Nov/2018:18:27
293 03/Nov/2018:18:34
300 03/Nov/2018:17:58
300 03/Nov/2018:18:22
300 03/Nov/2018:18:32
304 03/Nov/2018:18:12
305 03/Nov/2018:18:13
305 03/Nov/2018:18:24
312 03/Nov/2018:18:39
322 03/Nov/2018:18:17
326 03/Nov/2018:18:38
327 03/Nov/2018:18:16
330 03/Nov/2018:17:57
332 03/Nov/2018:18:19
336 03/Nov/2018:17:56
340 03/Nov/2018:18:14
341 03/Nov/2018:18:18
< / code > < / pre > < ul >
< li > If they want to download all our metadata and PDFs they should use an API rather than scraping the XMLUI< / li >
< li > I will add them to the list of bot IPs in nginx for now and think about enforcing rate limits in XMLUI later< / li >
< li > Also, this is the third (?) time a mysterious IP on Hetzner has done this… who is this?< / li >
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-04" > 2018-11-04< / h2 >
2018-11-04 11:18:52 +01:00
< ul >
2020-01-27 15:20:44 +01:00
< li > Forward Peter’ s information about CGSpace financials to Modi from ICRISAT< / li >
2018-11-04 11:18:52 +01:00
< li > Linode emailed about the CPU load and outgoing bandwidth on CGSpace (linode18) again< / li >
2019-11-28 16:30:45 +01:00
< li > Here are the top ten IPs active so far this morning:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > # zcat --force /var/log/nginx/*.log /var/log/nginx/*.log.1 | grep -E " 04/Nov/2018" | awk ' {print $1}' | sort | uniq -c | sort -n | tail -n 10
2019-11-28 16:30:45 +01:00
1083 2a03:2880:11ff:2::face:b00c
1105 2a03:2880:11ff:d::face:b00c
1111 2a03:2880:11ff:f::face:b00c
1134 84.38.130.177
1893 50.116.102.77
2040 66.249.64.63
4210 66.249.64.61
4534 70.32.83.92
13036 78.46.89.18
20407 66.249.64.59
< / code > < / pre > < ul >
< li > < code > 78.46.89.18< / code > is back… and it is still actually re-using its Tomcat sessions:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > $ grep -c -E ' session_id=[A-Z0-9]{32}:ip_addr=78.46.89.18' dspace.log.2018-11-04
2018-11-04 11:18:52 +01:00
8765
2022-03-04 13:30:06 +01:00
$ grep -o -E ' session_id=[A-Z0-9]{32}:ip_addr=78.46.89.18' dspace.log.2018-11-04 | sort | uniq | wc -l
2018-12-04 09:02:51 +01:00
1
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > < em > Updated on 2018-12-04 to correct the grep command and point out that the bot was actually re-using its Tomcat sessions properly< / em > < / li >
< li > Also, now we have a ton of Facebook crawlers:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > # zcat --force /var/log/nginx/*.log /var/log/nginx/*.log.1 | grep -E " 04/Nov/2018" | grep " 2a03:2880:11ff:" | awk ' {print $1}' | sort | uniq -c | sort -n
2019-11-28 16:30:45 +01:00
905 2a03:2880:11ff:b::face:b00c
955 2a03:2880:11ff:5::face:b00c
965 2a03:2880:11ff:e::face:b00c
984 2a03:2880:11ff:8::face:b00c
993 2a03:2880:11ff:3::face:b00c
994 2a03:2880:11ff:7::face:b00c
1006 2a03:2880:11ff:10::face:b00c
1011 2a03:2880:11ff:4::face:b00c
1023 2a03:2880:11ff:6::face:b00c
1026 2a03:2880:11ff:9::face:b00c
1039 2a03:2880:11ff:1::face:b00c
1043 2a03:2880:11ff:c::face:b00c
1070 2a03:2880:11ff::face:b00c
1075 2a03:2880:11ff:a::face:b00c
1093 2a03:2880:11ff:2::face:b00c
1107 2a03:2880:11ff:d::face:b00c
1116 2a03:2880:11ff:f::face:b00c
< / code > < / pre > < ul >
< li > They are really making shit tons of requests:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > $ grep -c -E ' session_id=[A-Z0-9]{32}:ip_addr=2a03:2880:11ff' dspace.log.2018-11-04
2018-12-04 09:02:51 +01:00
37721
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > < em > Updated on 2018-12-04 to correct the grep command to accurately show the number of requests< / em > < / li >
< li > Their user agent is:< / li >
< / ul >
2021-09-13 15:21:16 +02:00
< pre tabindex = "0" > < code > facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > I will add it to the Tomcat Crawler Session Manager valve< / li >
< li > Later in the evening… ok, this Facebook bot is getting super annoying:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > # zcat --force /var/log/nginx/*.log /var/log/nginx/*.log.1 | grep -E " 04/Nov/2018" | grep " 2a03:2880:11ff:" | awk ' {print $1}' | sort | uniq -c | sort -n
2019-11-28 16:30:45 +01:00
1871 2a03:2880:11ff:3::face:b00c
1885 2a03:2880:11ff:b::face:b00c
1941 2a03:2880:11ff:8::face:b00c
1942 2a03:2880:11ff:e::face:b00c
1987 2a03:2880:11ff:1::face:b00c
2023 2a03:2880:11ff:2::face:b00c
2027 2a03:2880:11ff:4::face:b00c
2032 2a03:2880:11ff:9::face:b00c
2034 2a03:2880:11ff:10::face:b00c
2050 2a03:2880:11ff:5::face:b00c
2061 2a03:2880:11ff:c::face:b00c
2076 2a03:2880:11ff:6::face:b00c
2093 2a03:2880:11ff:7::face:b00c
2107 2a03:2880:11ff::face:b00c
2118 2a03:2880:11ff:d::face:b00c
2164 2a03:2880:11ff:a::face:b00c
2178 2a03:2880:11ff:f::face:b00c
< / code > < / pre > < ul >
< li > Now at least the Tomcat Crawler Session Manager Valve seems to be forcing it to re-use some Tomcat sessions:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > $ grep -c -E ' session_id=[A-Z0-9]{32}:ip_addr=2a03:2880:11ff' dspace.log.2018-11-04
2018-12-04 09:02:51 +01:00
37721
2022-03-04 13:30:06 +01:00
$ grep -o -E ' session_id=[A-Z0-9]{32}:ip_addr=2a03:2880:11ff' dspace.log.2018-11-04 | sort | uniq | wc -l
2018-12-04 09:02:51 +01:00
15206
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > I think we still need to limit more of the dynamic pages, like the “ most popular” country, item, and author pages< / li >
< li > It seems these are popular too, and there is no fucking way Facebook needs that information, yet they are requesting thousands of them!< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > # grep ' face:b00c' /var/log/nginx/access.log /var/log/nginx/access.log.1 | grep -c ' most-popular/'
2018-11-04 21:45:00 +01:00
7033
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > I added the “ most-popular” pages to the list that return < code > X-Robots-Tag: none< / code > to try to inform bots not to index or follow those pages< / li >
< li > Also, I implemented an nginx rate limit of twelve requests per minute on all dynamic pages… I figure a human user might legitimately request one every five seconds< / li >
2018-11-06 10:36:04 +01:00
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-05" > 2018-11-05< / h2 >
2018-11-06 10:36:04 +01:00
< ul >
2019-11-28 16:30:45 +01:00
< li > I wrote a small Python script < a href = "https://gist.github.com/alanorth/4ff81d5f65613814a66cb6f84fdf1fc5" > add-dc-rights.py< / a > to add usage rights (< code > dc.rights< / code > ) to CGSpace items based on the CSV Hector gave me from MARLO:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > $ ./add-dc-rights.py -i /tmp/marlo.csv -db dspace -u dspace -p ' fuuu'
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > The file < code > marlo.csv< / code > was cleaned up and formatted in Open Refine< / li >
< li > 165 of the items in their 2017 data are from CGSpace!< / li >
< li > I will add the data to CGSpace this week (done!)< / li >
< li > Jesus, is Facebook < em > trying< / em > to be annoying? At least the Tomcat Crawler Session Manager Valve is working to force the bot to re-use its Tomcat sessions:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > # zcat --force /var/log/nginx/*.log /var/log/nginx/*.log.1 | grep -E " 05/Nov/2018" | grep -c " 2a03:2880:11ff:"
2018-11-05 23:04:18 +01:00
29889
2022-03-04 13:30:06 +01:00
# grep -c -E ' session_id=[A-Z0-9]{32}:ip_addr=2a03:2880:11ff' dspace.log.2018-11-05
2018-12-04 09:02:51 +01:00
29763
2022-03-04 13:30:06 +01:00
# grep -o -E ' session_id=[A-Z0-9]{32}:ip_addr=2a03:2880:11ff' dspace.log.2018-11-05 | sort | uniq | wc -l
2018-12-04 09:02:51 +01:00
1057
2022-03-04 13:30:06 +01:00
# zcat --force /var/log/nginx/*.log /var/log/nginx/*.log.1 | grep -E " 05/Nov/2018" | grep " 2a03:2880:11ff:" | grep -c -E " (handle|bitstream)"
2018-11-05 23:04:18 +01:00
29896
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > 29,000 requests from Facebook and none of the requests are to the dynamic pages I rate limited yesterday!< / li >
< li > At least the Tomcat Crawler Session Manager Valve is working now… < / li >
2018-11-04 00:02:29 +01:00
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-06" > 2018-11-06< / h2 >
2018-11-06 10:36:04 +01:00
< ul >
< li > I updated all the < a href = "https://github.com/ilri/DSpace/wiki/Scripts" > DSpace helper Python scripts< / a > to validate against PEP 8 using Flake8< / li >
2018-11-06 17:03:44 +01:00
< li > While I was updating the < a href = "https://gist.github.com/alanorth/ddd7f555f0e487fe0e9d3eb4ff26ce50" > rest-find-collections.py< / a > script I noticed it was using < code > expand=all< / code > to get the collection and community IDs< / li >
2019-11-28 16:30:45 +01:00
< li > I realized I actually only need < code > expand=collections,subCommunities< / code > , and I wanted to see how much overhead the extra expands created so I did three runs of each:< / li >
< / ul >
2021-09-13 15:21:16 +02:00
< pre tabindex = "0" > < code > $ time ./rest-find-collections.py 10568/27629 --rest-url https://dspacetest.cgiar.org/rest
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > Average time with all expands was 14.3 seconds, and 12.8 seconds with < code > collections,subCommunities< / code > , so < strong > 1.5 seconds difference< / strong > !< / li >
2018-11-06 10:36:04 +01:00
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-07" > 2018-11-07< / h2 >
2018-11-07 18:20:25 +01:00
< ul >
< li > Update my < a href = "https://github.com/ilri/dspace-statistics-api" > dspace-statistics-api< / a > to use a database management class with Python contexts so that connections and cursors are automatically opened and closed< / li >
< li > Tag version 0.7.0 of the dspace-statistics-api< / li >
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-08" > 2018-11-08< / h2 >
2018-11-08 08:02:20 +01:00
< ul >
< li > I deployed verison 0.7.0 of the dspace-statistics-api on DSpace Test (linode19) so I can test it for a few days (and check the Munin stats to see the change in database connections) before deploying on CGSpace< / li >
2020-01-27 15:20:44 +01:00
< li > I also enabled systemd’ s persistent journal by setting < a href = "https://www.freedesktop.org/software/systemd/man/journald.conf.html" > < code > Storage=persistent< / code > in < em > journald.conf< / em > < / a > < / li >
2018-11-08 08:02:20 +01:00
< li > Apparently < a href = "https://www.freedesktop.org/software/systemd/man/journald.conf.html" > Ubuntu 16.04 defaulted to using rsyslog for boot records until early 2018< / a > , so I removed < code > rsyslog< / code > too< / li >
2018-11-08 16:13:55 +01:00
< li > Proof 277 IITA records on DSpace Test: < a href = "https://dspacetest.cgiar.org/handle/10568/107871" > IITA_ ALIZZY1802-csv_oct23< / a >
< ul >
< li > There were a few issues with countries, a few language erorrs, a few whitespace errors, and then a handful of ISSNs in the ISBN field< / li >
2018-11-08 08:02:20 +01:00
< / ul >
2019-11-28 16:30:45 +01:00
< / li >
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-11" > 2018-11-11< / h2 >
2018-11-11 16:15:54 +01:00
< ul >
< li > I added tests to the < a href = "https://github.com/ilri/dspace-statistics-api" > dspace-statistics-api< / a > !< / li >
< li > It runs with Python 3.5, 3.6, and 3.7 using pytest, including automatically on Travis CI!< / li >
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-13" > 2018-11-13< / h2 >
2018-11-13 11:20:42 +01:00
< ul >
2018-11-27 09:47:02 +01:00
< li > Help troubleshoot an issue with Judy Kimani submitting to the < a href = "https://cgspace.cgiar.org/handle/10568/78" > ILRI project reports, papers and documents< / a > collection on CGSpace< / li >
2020-01-27 15:20:44 +01:00
< li > For some reason there is an existing group for the “ Accept/Reject” workflow step, but it’ s empty< / li >
2018-11-13 11:20:42 +01:00
< li > I added Judy to the group and told her to try again< / li >
2019-02-07 10:03:09 +01:00
< li > Sisay changed his leave to be full days until December so I need to finish the IITA records that he was working on (< a href = "https://dspacetest.cgiar.org/handle/10568/107871" > IITA_ ALIZZY1802-csv_oct23< / a > )< / li >
2018-11-13 16:42:55 +01:00
< li > Sisay had said there were a few PDFs missing and Bosede sent them this week, so I had to find those items on DSpace Test and add the bitstreams to the items manually< / li >
< li > As for the collection mappings I think I need to export the CSV from DSpace Test, add mappings for each type (ie Books go to IITA books collection, etc), then re-import to DSpace Test, then export from DSpace command line in “ migrate” mode… < / li >
< li > From there I should be able to script the removal of the old DSpace Test collection so they just go to the correct IITA collections on import into CGSpace< / li >
2018-11-13 11:20:42 +01:00
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-14" > 2018-11-14< / h2 >
2018-11-14 09:00:25 +01:00
< ul >
< li > Finally import the 277 IITA (ALIZZY1802) records to CGSpace< / li >
2020-01-27 15:20:44 +01:00
< li > I had to export them from DSpace Test and import them into a temporary collection on CGSpace first, then export the collection as CSV to map them to new owning collections (IITA books, IITA posters, etc) with OpenRefine because DSpace’ s < code > dspace export< / code > command doesn’ t include the collections for the items!< / li >
2018-11-14 09:00:25 +01:00
< li > Delete all old IITA collections on DSpace Test and run < code > dspace cleanup< / code > to get rid of all the bitstreams< / li >
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-15" > 2018-11-15< / h2 >
2018-11-15 08:09:39 +01:00
< ul >
< li > Deploy version 0.8.1 of the < a href = "https://github.com/ilri/dspace-statistics-api" > dspace-statistics-api< / a > to CGSpace (linode18)< / li >
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-18" > 2018-11-18< / h2 >
2018-11-18 16:35:32 +01:00
< ul >
< li > Request invoice from Wild Jordan for their meeting venue in January< / li >
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-19" > 2018-11-19< / h2 >
2018-11-19 16:17:04 +01:00
< ul >
2019-11-28 16:30:45 +01:00
< li > Testing corrections and deletions for AGROVOC (< code > dc.subject< / code > ) that Sisay and Peter were working on earlier this month:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > $ ./fix-metadata-values.py -i 2018-11-19-correct-agrovoc.csv -f dc.subject -t correct -m 57 -db dspace -u dspace -p ' fuu' -d
$ ./delete-metadata-values.py -i 2018-11-19-delete-agrovoc.csv -f dc.subject -m 57 -db dspace -u dspace -p ' fuu' -d
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > Then I ran them on both CGSpace and DSpace Test, and started a full Discovery re-index on CGSpace:< / li >
< / ul >
2021-09-13 15:21:16 +02:00
< pre tabindex = "0" > < code > $ time schedtool -D -e ionice -c2 -n7 nice -n19 dspace index-discovery -b
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > Generate a new list of the top 1500 AGROVOC subjects on CGSpace to send to Peter and Sisay:< / li >
2019-05-05 15:45:12 +02:00
< / ul >
2021-09-13 15:21:16 +02:00
< pre tabindex = "0" > < code > dspace=# \COPY (SELECT DISTINCT text_value, count(*) FROM metadatavalue WHERE metadata_field_id = 57 AND resource_type_id = 2 GROUP BY text_value ORDER BY count DESC LIMIT 1500) to /tmp/2018-11-19-top-1500-subject.csv WITH CSV HEADER;
2019-12-17 13:49:24 +01:00
< / code > < / pre > < h2 id = "2018-11-20" > 2018-11-20< / h2 >
2018-11-20 11:25:12 +01:00
< ul >
< li > The Discovery re-indexing on CGSpace never finished yesterday… the command died after six minutes< / li >
2019-11-28 16:30:45 +01:00
< li > The < code > dspace.log.2018-11-19< / code > shows this at the time:< / li >
< / ul >
2021-09-13 15:21:16 +02:00
< pre tabindex = "0" > < code > 2018-11-19 15:23:04,221 ERROR com.atmire.dspace.discovery.AtmireSolrService @ DSpace kernel cannot be null
2018-11-20 11:25:12 +01:00
java.lang.IllegalStateException: DSpace kernel cannot be null
2019-11-28 16:30:45 +01:00
at org.dspace.utils.DSpace.getServiceManager(DSpace.java:63)
at org.dspace.utils.DSpace.getSingletonService(DSpace.java:87)
at com.atmire.dspace.discovery.AtmireSolrService.buildDocument(AtmireSolrService.java:102)
at com.atmire.dspace.discovery.AtmireSolrService.indexContent(AtmireSolrService.java:815)
at com.atmire.dspace.discovery.AtmireSolrService.updateIndex(AtmireSolrService.java:884)
at org.dspace.discovery.SolrServiceImpl.createIndex(SolrServiceImpl.java:370)
at org.dspace.discovery.IndexClient.main(IndexClient.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:226)
at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:78)
2018-11-20 11:25:12 +01:00
2018-11-19 15:23:04,223 INFO com.atmire.dspace.discovery.AtmireSolrService @ Processing (4629 of 76007): 72731
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
2020-01-27 15:20:44 +01:00
< li > I looked in the Solr log around that time and I don’ t see anything… < / li >
< li > Working on Udana’ s WLE records from last month, first the sixteen records in < a href = "https://dspacetest.cgiar.org/handle/10568/108254" > 2018-11-20 RDL Temp< / a >
2018-11-20 11:25:12 +01:00
< ul >
< li > these items will go to the < a href = "https://dspacetest.cgiar.org/handle/10568/81592" > Restoring Degraded Landscapes collection< / a > < / li >
< li > a few items missing DOIs, but they are easily available on the publication page< / li >
2020-01-27 15:20:44 +01:00
< li > clean up DOIs to use “ < a href = "https://doi.org" > https://doi.org< / a > ” format< / li >
2018-11-20 11:25:12 +01:00
< li > clean up some cg.identifier.url to remove unneccessary query strings< / li >
< li > remove columns with no metadata (river basin, place, target audience, isbn, uri, publisher, ispartofseries, subject)< / li >
< li > fix column with invalid spaces in metadata field name (cg. subject. wle)< / li >
< li > trim and collapse whitespace in all fields< / li >
< li > remove some weird Unicode characters (0xfffd) from abstracts, citations, and titles using Open Refine: < code > value.replace('<27> ','')< / code > < / li >
< li > add dc.rights to some fields that I noticed while checking DOIs< / li >
2019-11-28 16:30:45 +01:00
< / ul >
< / li >
< li > Then the 24 records in < a href = "https://dspacetest.cgiar.org/handle/10568/108271" > 2018-11-20 VRC Temp< / a >
2018-11-20 11:25:12 +01:00
< ul >
< li > these items will go to the < a href = "https://dspacetest.cgiar.org/handle/10568/81589" > Variability, Risks and Competing Uses collection< / a > < / li >
< li > trim and collapse whitespace in all fields (lots in WLE subject!)< / li >
< li > clean up some cg.identifier.url fields that had unneccessary anchors in their links< / li >
2020-01-27 15:20:44 +01:00
< li > clean up DOIs to use “ < a href = "https://doi.org" > https://doi.org< / a > ” format< / li >
2018-11-20 11:25:12 +01:00
< li > fix column with invalid spaces in metadata field name (cg. subject. wle)< / li >
< li > remove columns with no metadata (place, target audience, isbn, uri, publisher, ispartofseries, subject)< / li >
< li > remove some weird Unicode characters (0xfffd) from abstracts, citations, and titles using Open Refine: < code > value.replace('<27> ','')< / code > < / li >
2021-11-09 05:29:52 +01:00
< li > I notice a few items using DOIs pointing at ICARDA’ s DSpace like: < a href = "https://doi.org/20.500.11766/8178" > https://doi.org/20.500.11766/8178< / a > , which then points at the “ real” DOI on the publisher’ s site… these should be using the real DOI instead of ICARDA’ s “ fake” Handle DOI< / li >
2020-01-27 15:20:44 +01:00
< li > Some items missing DOIs, but they clearly have them if you look at the publisher’ s site< / li >
2018-11-20 11:25:12 +01:00
< / ul >
2019-11-28 16:30:45 +01:00
< / li >
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-22" > 2018-11-22< / h2 >
2018-11-22 07:51:33 +01:00
< ul >
< li > Tezira is having problems submitting to the < a href = "https://cgspace.cgiar.org/handle/10568/24452" > ILRI brochures< / a > collection for some reason
< ul >
2018-11-22 08:39:09 +01:00
< li > Judy Kimani was having issues resuming submissions in another ILRI collection recently, and the issue there was due to an empty group defined for the “ accept/reject” step (aka workflow step 1)< / li >
2018-11-22 07:51:33 +01:00
< li > The error then was “ authorization denied for workflow step 1” where “ workflow step 1” was the “ accept/reject” step, which had a group defined, but was empty< / li >
< li > Adding her to this group solved her issues< / li >
2020-01-27 15:20:44 +01:00
< li > Tezira says she’ s also getting the same “ authorization denied” error for workflow step 1 when resuming submissions, so I told Abenet to delete the empty group< / li >
2018-11-22 07:51:33 +01:00
< / ul >
2019-11-28 16:30:45 +01:00
< / li >
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-26" > 2018-11-26< / h2 >
2018-11-26 10:50:54 +01:00
< ul >
< li > < a href = "https://cgspace.cgiar.org/handle/10568/97709" > This WLE item< / a > is issued on 2018-10 and accessioned on 2018-10-22 but does not show up in the < a href = "https://cgspace.cgiar.org/handle/10568/41888" > WLE R4D Learning Series< / a > collection on CGSpace for some reason, and therefore does not show up on the WLE publication website< / li >
2019-11-28 16:30:45 +01:00
< li > I tried to remove that collection from Discovery and do a simple re-index:< / li >
< / ul >
2021-09-13 15:21:16 +02:00
< pre tabindex = "0" > < code > $ dspace index-discovery -r 10568/41888
2018-11-26 10:50:54 +01:00
$ time schedtool -D -e ionice -c2 -n7 nice -n19 dspace index-discovery
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
2020-01-27 15:20:44 +01:00
< li > … but the item still doesn’ t appear in the collection< / li >
2019-11-28 16:30:45 +01:00
< li > Now I will try a full Discovery re-index:< / li >
< / ul >
2021-09-13 15:21:16 +02:00
< pre tabindex = "0" > < code > $ time schedtool -D -e ionice -c2 -n7 nice -n19 dspace index-discovery -b
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > Ah, Marianne had set the item as private when she uploaded it, so it was still private< / li >
< li > I made it public and now it shows up in the collection list< / li >
< li > More work on the AReS terms of reference for CodeObia< / li >
< li > Erica from AgriKnowledge emailed me to say that they have implemented the changes in their item page UI so that they include the permanent identifier on items harvested from CGSpace, for example: < a href = "https://www.agriknowledge.org/concern/generics/wd375w33s" > https://www.agriknowledge.org/concern/generics/wd375w33s< / a > < / li >
2018-11-26 10:50:54 +01:00
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-27" > 2018-11-27< / h2 >
2018-11-27 07:01:10 +01:00
< ul >
< li > Linode alerted me that the outbound traffic rate on CGSpace (linode19) was very high< / li >
2019-11-28 16:30:45 +01:00
< li > The top users this morning are:< / li >
< / ul >
2022-03-04 13:30:06 +01:00
< pre tabindex = "0" > < code > # zcat --force /var/log/nginx/*.log /var/log/nginx/*.log.1 | grep -E " 27/Nov/2018" | awk ' {print $1}' | sort | uniq -c | sort -n | tail -n 10
2019-11-28 16:30:45 +01:00
229 46.101.86.248
261 66.249.64.61
447 66.249.64.59
541 207.46.13.77
548 40.77.167.97
564 35.237.175.180
595 40.77.167.135
611 157.55.39.91
4564 205.186.128.185
4564 70.32.83.92
< / code > < / pre > < ul >
< li > We know 70.32.83.92 is CCAFS harvester on MediaTemple, but 205.186.128.185 is new appears to be a new CCAFS harvester< / li >
2020-01-27 15:20:44 +01:00
< li > I think we might want to prune some old accounts from CGSpace, perhaps users who haven’ t logged in in the last two years would be a conservative bunch:< / li >
2019-11-28 16:30:45 +01:00
< / ul >
2021-09-13 15:21:16 +02:00
< pre tabindex = "0" > < code > $ dspace dsrun org.dspace.eperson.Groomer -a -b 11/27/2016 | wc -l
2018-11-27 09:47:02 +01:00
409
$ dspace dsrun org.dspace.eperson.Groomer -a -b 11/27/2016 -d
2019-11-28 16:30:45 +01:00
< / code > < / pre > < ul >
< li > This deleted about 380 users, skipping those who have submissions in the repository< / li >
< li > Judy Kimani was having problems taking tasks in the < a href = "https://cgspace.cgiar.org/handle/10568/78" > ILRI project reports, papers and documents< / a > collection again
2018-11-27 09:47:02 +01:00
< ul >
< li > The workflow step 1 (accept/reject) is now undefined for some reason< / li >
< li > Last week the group was defined, but empty, so we added her to the group and she was able to take the tasks< / li >
2020-01-27 15:20:44 +01:00
< li > Since then it looks like the group was deleted, so now she didn’ t have permission to take or leave the tasks in her pool< / li >
< li > We added her back to the group, then she was able to take the tasks, and then we removed the group again, as we generally don’ t use this step in CGSpace< / li >
2018-11-27 07:01:10 +01:00
< / ul >
2019-11-28 16:30:45 +01:00
< / li >
< li > Help Marianne troubleshoot some issue with items in their WLE collections and the WLE publicatons website< / li >
< / ul >
2019-12-17 13:49:24 +01:00
< h2 id = "2018-11-28" > 2018-11-28< / h2 >
2018-11-28 08:11:39 +01:00
< ul >
2020-01-27 15:20:44 +01:00
< li > Change the usage rights text a bit based on Maria Garruccio’ s feedback on “ all rights reserved” (< a href = "https://github.com/ilri/DSpace/pull/404" > #404< / a > )< / li >
2018-11-28 08:32:04 +01:00
< li > Run all system updates on DSpace Test (linode19) and reboot the server< / li >
2018-11-28 08:11:39 +01:00
< / ul >
2019-11-28 16:30:45 +01:00
<!-- raw HTML omitted -->
2018-11-01 15:43:37 +01:00
< / article >
< / div > <!-- /.blog - main -->
< aside class = "col-sm-3 ml-auto blog-sidebar" >
< section class = "sidebar-module" >
< h4 > Recent Posts< / h4 >
< ol class = "list-unstyled" >
2022-08-01 15:36:13 +02:00
< li > < a href = "/cgspace-notes/2022-08/" > August, 2022< / a > < / li >
2022-07-04 08:25:14 +02:00
< li > < a href = "/cgspace-notes/2022-07/" > July, 2022< / a > < / li >
2022-06-06 08:45:43 +02:00
< li > < a href = "/cgspace-notes/2022-06/" > June, 2022< / a > < / li >
2022-05-04 10:09:45 +02:00
< li > < a href = "/cgspace-notes/2022-05/" > May, 2022< / a > < / li >
2022-04-27 08:58:45 +02:00
< li > < a href = "/cgspace-notes/2022-04/" > April, 2022< / a > < / li >
2022-03-01 15:48:40 +01:00
2018-11-01 15:43:37 +01:00
< / ol >
< / section >
< section class = "sidebar-module" >
< h4 > Links< / h4 >
< ol class = "list-unstyled" >
< li > < a href = "https://cgspace.cgiar.org" > CGSpace< / a > < / li >
< li > < a href = "https://dspacetest.cgiar.org" > DSpace Test< / a > < / li >
< li > < a href = "https://github.com/ilri/DSpace" > CGSpace @ GitHub< / a > < / li >
< / ol >
< / section >
< / aside >
< / div > <!-- /.row -->
< / div > <!-- /.container -->
< footer class = "blog-footer" >
2019-10-11 10:19:42 +02:00
< p dir = "auto" >
2018-11-01 15:43:37 +01:00
Blog template created by < a href = "https://twitter.com/mdo" > @mdo< / a > , ported to Hugo by < a href = 'https://twitter.com/mralanorth' > @mralanorth< / a > .
< / p >
< p >
< a href = "#" > Back to top< / a >
< / p >
< / footer >
< / body >
< / html >