cgspace-notes/content/posts/2021-07.md

180 lines
6.3 KiB
Markdown
Raw Normal View History

2021-07-11 13:22:14 +02:00
---
title: "July, 2021"
date: 2021-06-01T08:53:07+03:00
author: "Alan Orth"
categories: ["Notes"]
---
## 2021-07-01
- Export another list of ALL subjects on CGSpace, including AGROVOC and non-AGROVOC for Enrico:
```console
localhost/dspace63= > \COPY (SELECT DISTINCT LOWER(text_value) AS subject, count(*) FROM metadatavalue WHERE dspace_object_id in (SELECT dspace_object_id FROM item) AND metadata_field_id IN (119, 120, 127, 122, 128, 125, 135, 203, 208, 210, 215, 123, 236, 242, 187) GROUP BY subject ORDER BY count DESC) to /tmp/2021-07-01-all-subjects.csv WITH CSV HEADER;
COPY 20994
```
<!--more-->
## 2021-07-04
- Update all Docker containers on the AReS server (linode20) and rebuild OpenRXV:
```console
$ cd OpenRXV
$ docker-compose -f docker/docker-compose.yml down
$ docker images | grep -v ^REPO | sed 's/ \+/:/g' | cut -d: -f1,2 | xargs -L1 docker pull
$ docker-compose -f docker/docker-compose.yml build
```
- Then run all system updates and reboot the server
- After the server came back up I cloned the `openrxv-items-final` index to `openrxv-items-temp` and started the plugins
- This will hopefully be faster than a full re-harvest...
- I opened a few GitHub issues for OpenRXV bugs:
- [Hide "metadata structure" section in repository setup](https://github.com/ilri/OpenRXV/issues/103)
- [Improve "start plugins" and "commit indexing" buttons](https://github.com/ilri/OpenRXV/issues/104)
- [Allow running plugins individually](https://github.com/ilri/OpenRXV/issues/105)
- [Hide the "DSpace add missing items"](https://github.com/ilri/OpenRXV/issues/106)
- Rebuild DSpace Test (linode26) from a fresh Ubuntu 20.04 image on Linode
- The start plugins on AReS had seventy-five errors from the `dspace_add_missing_items` plugin for some reason so I had to start a fresh indexing
- I noticed that the WorldFish data has dozens of incorrect countries so I should talk to Salem about that because they manage it
- Also I noticed that we weren't using the Country formatter in OpenRXV for the WorldFish country field, so some values don't get mapped properly
- I added some value mappings to fix some issues with WorldFish data and added a few more fields to the repository harvesting config and started a fresh re-indexing
## 2021-07-05
- The AReS harvesting last night succeeded and I started the plugins
- Margarita from CCAFS asked if we can create a new field for AICCRA publications
- I asked her to clarify what they want
- AICCRA is an initiative so it might be better to create new field for that, for example `cg.contributor.initiative`
## 2021-07-06
- Atmire merged my spider user agent changes from last month so I will update the `example` list we use in DSpace and remove the new ones from my `ilri` override file
- Also, I concatenated all our user agents into one file and purged all hits:
```console
$ ./ilri/check-spider-hits.sh -f /tmp/spiders -p
Purging 95 hits from Drupal in statistics
Purging 38 hits from DTS Agent in statistics
Purging 601 hits from Microsoft Office Existence Discovery in statistics
Purging 51 hits from Site24x7 in statistics
Purging 62 hits from Trello in statistics
Purging 13574 hits from WhatsApp in statistics
Purging 144 hits from FlipboardProxy in statistics
Purging 37 hits from LinkWalker in statistics
Purging 1 hits from [Ll]ink.?[Cc]heck.? in statistics
Purging 427 hits from WordPress in statistics
Total number of bot hits purged: 15030
```
- Meet with the CGIARAGROVOC task group to discuss how we want to do the workflow for submitting new terms to AGROVOC
- I extracted another list of all subjects to check against AGROVOC:
```console
\COPY (SELECT DISTINCT(LOWER(text_value)) AS subject, count(*) FROM metadatavalue WHERE dspace_object_id in (SELECT dspace_object_id FROM item) AND metadata_field_id IN (119, 120, 127, 122, 128, 125, 135, 203, 208, 210, 215, 123, 236, 242, 187) GROUP BY subject ORDER BY count DESC) to /tmp/2021-07-06-all-subjects.csv WITH CSV HEADER;
$ csvcut -c 1 /tmp/2021-07-06-all-subjects.csv | sed 1d > /tmp/2021-07-06-all-subjects.txt
$ ./ilri/agrovoc-lookup.py -i /tmp/2021-07-06-all-subjects.txt -o /tmp/2021-07-06-agrovoc-results-all-subjects.csv -d
```
- Test [Hrafn Malmquist's proposed DBCP2 changes](https://github.com/DSpace/DSpace/pull/3162) for DSpace 6.4 (DS-4574)
- His changes reminded me that we can perhaps switch back to using this pooling instead of Tomcat 7's JDBC pooling via JNDI
- Tomcat 8 has DBCP2 built in, but we are stuck on Tomcat 7 for now
- Looking into the database issues we had last month on 2021-06-23
- I think it might have been some kind of attack because the number of XMLUI sessions was through the roof at one point (10,000!) and the number of unique IPs accessing the server that day is much higher than any other day:
```console
# for num in {10..26}; do echo "2021-06-$num"; zcat /var/log/nginx/access.log.*.gz /var/log/nginx/library-access.log.*.gz | grep "$num/Jun/2021" | awk '{print $1}' | sort | uniq | wc -l; done
2021-06-10
10693
2021-06-11
10587
2021-06-12
7958
2021-06-13
7681
2021-06-14
12639
2021-06-15
15388
2021-06-16
12245
2021-06-17
11187
2021-06-18
9684
2021-06-19
7835
2021-06-20
7198
2021-06-21
10380
2021-06-22
10255
2021-06-23
15878
2021-06-24
9963
2021-06-25
9439
2021-06-26
7930
```
- Similarly, the number of connections to the REST API was around the average for the recent weeks before:
```console
# for num in {10..26}; do echo "2021-06-$num"; zcat /var/log/nginx/rest.*.gz | grep "$num/Jun/2021" | awk '{print $1}' | sort | uniq | wc -l; done
2021-06-10
1183
2021-06-11
1074
2021-06-12
911
2021-06-13
892
2021-06-14
1320
2021-06-15
1257
2021-06-16
1208
2021-06-17
1119
2021-06-18
965
2021-06-19
985
2021-06-20
854
2021-06-21
1098
2021-06-22
1028
2021-06-23
1375
2021-06-24
1135
2021-06-25
969
2021-06-26
904
```
- According to goaccess, the traffic spike started at 2AM (remember that the first "Pool empty" error in dspace.log was at 4:01AM):
```console
# zcat /var/log/nginx/access.log.1[45].gz /var/log/nginx/library-access.log.1[45].gz | grep -E '23/Jun/2021' | goaccess --log-format=COMBINED -
```
- Moayad sent a fix for the add missing items plugins issue ([#107](https://github.com/ilri/OpenRXV/pull/107))
- It works MUCH faster because it correctly identifies the missing handles in each repository
- Also it adds better debug messages to the api logs
2021-07-11 14:56:57 +02:00
## 2021-07-11
- Start an indexing on AReS
2021-07-11 13:22:14 +02:00
<!-- vim: set sw=2 ts=2: -->