2021年12月6日月曜日

【96】iRODSのVirtualization失敗

本日は、BEGINNER TRAINING WITH iRODS 4.2のChapter 6 Virtualization(p. 24〜)から開始です。

storageResc1とstorageResc2というresourceを作成するところ(p. 28)ですが、

$ iadmin mkresc storageResc1 unixfilesystem  hostname :/var/lib/irods/storageVault1

$ iadmin mkresc storageResc2 unixfilesystem  hostname :/var/lib/irods/storageVault2

hostnameはipアドレスにしました。

$ iadmin addchildtoresc replResc newResc

$ iadmin addchildtoresc replResc storageResc1

$ iadmin addchildtoresc replResc storageResc2

のところで、newResc、storageResc1とstorageResc2をreplRescの子供にします。

$ ilsresc --ascii

で親子関係を示せます。


ところが、

$ iadmin modresc replResc rebalance

でエラーが発生。これで、すべての子供のresourceに同じファイルのコピーを持たせることができるようですが、エラーです。

実は前回、virtual machineのゲストのipアドレスが変化してしまったため、変化前のipアドレスであったnewRescにアクセスできなくなってしまい、代わりにwonRescというresourceを作ったことを思い出しました。

そこで、やりなおしです。

$ iadmin addchildtoresc replResc wonResc

ところがエラーが継続です。


エラーログは次の場所にあることが判明。

/var/lib/irods/iRODS/server/log/rodsLog

確認すると次のようなメッセージが出ました。



なるほどわかった!ということにもならず、ipアドレスが変更されてしまったのが原因と考え、次回までにipアドレス固定の上、ここまでやり直したiRODSを使い、再開します。

次回は、

12/17(金)

で今年最後の道場です。半分は忘年会ですかね。

また次次回は、

1/7(金)です。半分は新年会かも。よろしくお願いいたします。


2021年11月19日金曜日

【95】iRODSのUsing iCommands

BEGINNER TRAINING WITH iRODS 4.2

Chapter 5  
Using iCommands (pp. 14–23)まで完了。

次回は、
12/3(金)
です。 

2021年11月6日土曜日

【94】iRODSのiCommandを実行し、ユーザを作ってみます

前回まで「Chapter 4 Installing iRODS」 が終わりました。

BEGINNER TRAINING WITH iRODS 4.2https://github.com/irods/irods_training/raw/master/beginner/irods_beginner_training_2019.pdf)の

BTマニュアル14~15ページです。

5.1 Administrative Operations

Ubuntuが起動されたら、iRodsの管理者=admin=rodsadmin=ユーザも作れるし、resourceのセットアップなどができる「rods」のアカウントを利用して、iRodsサーバーにつなげます。

iRodsをインストールしたら、homeディレクトリの下位に/home/ubuntu/.irods/フォルダが作られています。

$ iinit

One or more fields in your iRODS environment file (irods_environment.json) are missing; please enter them.

Enter the host name (DNS) of the server to connect to: (自分のサーバのIPアドレス)

Enter the port number:1247

Enter your irods user name:rods

Enter your irods zone:tempZone

Those values will be added to your environment file (for use by

other iCommands) if the login succeeds.

Enter your current iRODS password:rods


そうしたら、/home/ubuntu/.irods/フォルダの中に、入力したユーザの情報などが書かれた環境設定ファイル「irods environment.json」ができます。
(前回はなぜか、この情報を聞かれることがなかったので、錯綜しましたが、今回は問題なくすすむことができました。)

次は、マニュアル通り、aliceとbobbyという、新しいユーザ(普通のユーザ)を作ってみます。

$ iadmin mkuser alice rodsuser

$ iadmin moduser alice password passWORD

$ iadmin mkuser bobby rodsuser

$ iadmin moduser bobby password passWORD

これで、問題なく、aliceとbobbyができます。

次は、iadminを使用して、ローカルホスト上にunixfilesystemタイプの2つ目のリソース「newResc」を作成し、/var/lib/irods/new vaultにマウントしてみます。下記の画像のように、新しいresourceができます。

BT mアニュアル P. 15

新しいresourceができたかは、以下のiコマンドで確認します。
$ ilsresc


できていました!

iRodsにAliceとしてログインするためには、いったんログインしていたrods(admin)がiRodsからログアウトして、rods用の環境ファイルを削除する必要があるとのことです。

$ iexit full
$ rm ~/.irods/irods_environment.json

$ ils は(のちに)データ・オブジェクトやサブコレクションをリストアップするiCommandですが、ログインしているユーザのディレクトリを調べるために打ってみました)

5.2 Logging In with Alice

では、アリスとしてログインしてみます。
(上記のiRodsのログアウトを行っているのが前提です)

$ iinit
One or more fields in your iRODS environment file (irods_environment.json) are missing; please enter them.
Enter the host name (DNS) of the server to connect to: (自分のサーバのIPアドレス)
Enter the port number:1247
Enter your irods user name:alice
Enter your irods zone:tempZone
Those values will be added to your environment file (for use by
other iCommands) if the login succeeds.
Enter your current iRODS password:passWORD


ログインもでき、現在Aliceとしてログインしていることも確認できました。
Aliceのログインパスワードを変更してみます(ほかのユーザも同様です)。

$ ipasswd
Enter your current iRODS password:passWORD
Enter your new iRODS password:alicepass
Reenter your new iRODS password:alicepass

aliceのパスワードが変更されました。

今日はここまでできました!
iRodsがどのように実行されているか、誰がログインしているかがすぐにわからず、エラーの時はどのようにすればいいか、といった説明もまだ足りなくて、道場メンバーで手探りしながらここまでやりましたので、結構時間がかかりました。

次回は、BTマニュアルのp. 17、5.3 Basic Navigationから続きます!宜しくお願いします。

※iRodsインストール時のエラーについてメモ

ちなみに、iRodsインストールの際(BTマニュアル10~11ページ)に、irodsパッケージ(https://packages.irods.org/)をダウンロードするところでエラーになりました(2021/11/05現在)。

$ wget -qO - https://packages.irods.org/irods-signing-key.asc | sudo apt-key add -

$ echo "deb [arch=amd64] https://packages.irods.org/apt/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/renci-irods.list

$ sudo apt-get update  (←ここで実はエラーが出ていた!)

$ sudo apt-get -y install irods-server irods-database-plugin-postgres  ←ここでレポジトリにファイルがない、みたいなエラーが出た!のでインストールができず、時間がかかった。

そして上記のirods-serverとirods-database-plugin-postgresをレポジトリからダウンロードできないというエラーがでた際に、エラーメッセージをよく読んでみると、

(キャプチャがないですが「Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate.  Could not handshake: Error in the certificate verification.」みたいなメッセージがでましたので、調べて、以下の「ca-certificates」をインストールすることでiRodsのインストールすることができました)

$ sudo apt install ca-certificates

こんなエラーが出ない方もおられました。特定の人のみ呪われてるのかと悩む夜でした...

蛇足のつぶやき:今回のブログ、内容があまり充実しておらず、失礼しました。実は、なぜこんなに進まなかったかというと...エラーが解決できなかったり、操作ミスでパスワードが変更されたのに覚えられなかったり、新しくサーバーに新しくiRodsをインストールしたりしたメンバーもいて(私です(-_-;))、あれこれ進まないことがありました。エラーメッセージが出た後、いろいろ調べているうちに、エラーメッセージが出なかったりもしているようで、まだ問題と解決策が明確ではないものもありますね。初心者にはむずかい!と思いつつも、「あ~できた、できてる!次、進もう!」という気分にもなるものでした。では、次回もよろしくお願いします!

 

 





2021年10月23日土曜日

【93】iRODSのインストール

今回からiRODSを見ていきます。

概要については次のサイトを参照。

それでは、インストール開始。

BEGINNER TRAINING WITH iRODS 4.2という初心者用の資料 https://github.com/irods/irods_training/blob/master/beginner/irods_beginner_training_2019.pdf を発見。長いので勝手にBTと略称します。BTにしたがって作業を進めます。インストールについては、Chapter 4 Installing iRODS(p. 9〜)を参照。OSはUbuntu 18.04(VirtualBox上)です。

データベースを入れます。

$ sudo apt-get update

$ sudo apt-get -y install postgresql

$ sudo su - postgres

$ psql

> CREATE DATABASE "ICAT";

> CREATE USER irods WITH PASSWORD 'testpassword';

> GRANT ALL PRIVILEGES ON DATABASE "ICAT" to irods;

> \q

$ exit

iRODSのソフトウェアパッケージを入れます。

$ wget -qO - https://packages.irods.org/irods-signing-key.asc | \

sudo apt-key add -

$ echo "deb [arch=amd64] https://packages.irods.org/apt/ \

$(lsb_release -sc) main" | sudo tee \

/etc/apt/sources.list.d/renci-irods.list

$ sudo apt-get update

$ sudo apt-get -y install irods-server irods-database-plugin-postgres

成功したら次のメッセージ。

iRODS Postgres Database Plugin installation was successful.

To configure this plugin, the following prerequisites need to be met:

- an existing database user (to be used by the iRODS server)

- an existing database (to be used as the iRODS Catalog)

- permissions for existing user on existing database

Then run the following setup script:

sudo python /var/lib/irods/scripts/setup_irods.py

今回、Postgresが起動しないエラーが起こりました。

10 main 5432 down postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log

と表示。リブート。

同様のエラーは、https://qiita.com/Dexctersu/items/3d6bc50bf1d4a294980b に記載。

$ pg_lsclusters

で確認したら、起動できていました。

最後のステップ。

$ sudo python /var/lib/irods/scripts/setup_irods.py < /var/lib/irods/packaging/localhost_setup_postgres.input

BTのp. 12の表と同じような設定値が表示されるなか、次のような不穏なメッセージが我々を不安に陥れました。4つのWarningが次のように出ています。


それでも構わず、セットアップを終えます。

$ echo $?

0と出て問題なし。

サーバー起動します。

$ sudo su irods -c "/var/lib/irods/irodsctl start"


iCommandsの章

BTのChapter 5(p. 14〜)です。iinitというコマンドで、サーバーのホストネーム、ポート番号などを設定していきます。

$ iinit

Enter your current iRODS passwordと出ましたが、何とこれがわからん。

BTのユーザーネームと表記されるrods(p. 15)かと思いきや、うまくいかず。

ひょっとして、上記のWarningが関わっているのか?と思ったのですが、わかりませんでした。

デモ動画 https://www.youtube.com/watch?v=s-RnMII6A3Q や https://pgale.web.unc.edu/2015/04/20/irods-training-install/ などを見て、もう一度インストール過程を検討して、次回に備えようという話になって、本日は終了です。

次回は11/5(金)です。ご参加ください。

2021年10月8日金曜日

【92】ArchivematicaのArchival Storageについて考える

 始まりました。人数も少ないですし、地震もきましたし、サッカーも相手へのナイス・パスで負けたので、まったりいきます。

本日のテーマは!それは!!なんと!!まさかの!!!

これから考えます!

という会になりました。

ずーっとああでもない、こうでもないっていう話を。
頭のなかが… Storage 管理に関するサードパーティーのアプリケーションを入れ込んで欲しいのですが、お金がかかるものが多くワレワレのような貧乏人には無料じゃないと…(涙

ん~・・・ってことで、1.5h話し合ったところで決まりましたよ!
ドラムロールスタート!drdrdrdrdrdrdrdrdrdr....daaaaan!

LOKKS!!

に決まりました!!!
詳細は、GitHub(https://github.com/lockss/lockss-daemon)をご確認ください。
みんなで見てると、いろいろと意見が…ここで決めてくれ!!(祈

ん。。。だめ。。。なのか。。。また。。。なのか。。。…

LOKKSつかってOAIS参照モデルって…
ネットワーク入れば簡単にできるんじゃね?…
本来はe-Journalを管理できるように作られたんですよね?
そうそう、そんで他にも使うことができるから派生シテ…
etc. など、

あれれ。。。

それはそうと、こんなんのもあるよ!(file:///C:/Users/hori6/Downloads/iprespaper-finaledit.pdf)
おお~!!OAISの図がカックイイ!!

とか。

ペーパーに文脈関係ないのに、自分の写真出しちゃうやつって。。。←これはH(私)

とか。。。これは、LOKKSは止めるのか。。。
ここで急浮上!

iRODS!!

もう。。。追えないよ。。。
ってなか、みーーーーんな、勝手にiRODSのことをバンバン調べだし、笑うくらい五月雨式に話だすっていうリモートの"マナー”に違反しまくり…

ってことで、

First! iRODS

Second! LOKKS

に。

ってことで、次回までに読むものリストです。
https://arodes.hes-so.ch/record/1907/files/makhlouf_research_data_management_switzerland_2017.pdf

https://docs.irods.org/4.2.10/

https://sciencenode.org/feature/isgtw-technology-taming-data-deluge-new-open-source-irods-data-grid-system.php

さーーがんばりましょう!!

次回は、恐らく22日です!!



2021年9月24日金曜日

【91】Archivmaticaで日本語のOCR認識(Tesseract利用)

今日は前回の続きのTesseractのテストです。
Archivemimaticaは、デフォルトでOCR認識用としてTesseractを使っています。基本は英語認識になっているので、日本語を認識できるようにしてみましょう!

Tesseractのファイルは、/usr/share/tesseract-ocr/ の下に実行ファイルがあります。まずは、そこをみてましょう。

学習した言語ファイルがあるところは、tessdataの中です。先週日本語版Tesseractを入れているので、下記には日本語認識に関わるファイルが存在している状態です。


各ファイルは以下のように関係しています。

jpn.traineddata:日本語
jpn_vert.traineddata:日本語(縦書き)
Japanese.traineddata:日本語
eng.traineddata:英語
osd.traineddata:文字の方向の判定

ここで日本語と英語のファイルをちょっといじってみます。Archivematicaでは英語だけを処理するように設定されているので、こっそりeng.traineddataの中身をjpn.traineddataにすり替えてテストしてみます。とりあえず、元のデータがなくなるとまずいので、eng.traineddata.originalにしておきます。


次に、eng.traineddataの中身をjpn.traineddataに入れ替えます。


このあと、Archivematicaに日本語文書のJPGファイルを入れてingestしてみます。
以下の画像をingestしました。
ingestしたJPGファイル

Transcriptionのマイクロサービスでは、Yesを選んでください。
結果は〜〜〜以下のように日本語を認識してくれました!

OCR認識で出力された結果

師匠ありがとうございます!これでTesseractの仕組みが少し理解できました!

今度は、ArchivematicaのPreservation planning からcommandを変更してみましょう。どちらかというとこちらが正式な方法です。先いじったファイルは元の状態に戻してから試してください。

Preservation planningでは、コマンドやルールの変更・追加ができます。マイクロサービスで行われる処理の中で正規化(Normalization)のようにルールが必要なタスクについては、行う処理内容をコマンドで書いて、実行する対象と結びつけます。これが、ルールというわけですね。

OCRの処理はTranscriptionのマイクロサービスで行われますので、TranscriptionのCommandを変更してみます。


以下が、Transcriptionのコマンドを変更する画面です。


上記のCommandの最後に -l jpn を追記しました。languageをjpnにしてくださいというコマンドです。試した結果……成功しました!(^^)/

では、次は縦書きも試してみます。
今度は以下のコマンドを最後に入れてみます。

-l jpn +Japanese_vert

これも成功しましたが、縦書きの認識率は少し低いです。でも7割程度は認識しているように見えます。

日本語関係の学習ファイルが2つあったので、以下でも試してみます。

-l Japanese +Japanese_vert

そうすると、以下のように結果が少し異なりました。


左:jpn  右:Japanese

Japanese.traineddataの場合は日本語と英語の学習用テキストを混在した状態で学習させた代物ということらしいです。また、出力結果に余計な空白が含まれる問題があるとのことです。(それで右のJapaneseで試した結果がああなったわけね…)

参考サイト

今日はここまでです!
今日は意外と順調に進みました。いつもこうだといいですね〜〜

================================
10月8日(金)19:00〜
やることは後日連絡です。ではまたね〜



2021年9月22日水曜日

【90】Tesseractの日本語版を使い、Archivematicaで日本語をOCRする。

ほとんどやる気のないHが担当で、更新が遅れに遅れました。すみません。

Archivematicaには、画像(JPGやTIFFファイル)のOCR機能があります。オープンソースのTesseract (テッセラクト)を使っています。

https://www.archivematica.org/en/docs/archivematica-1.13/user-manual/ingest/ingest/#transcribe-contents

Tesseractのウィキペディア、https://ja.wikipedia.org/wiki/Tesseract_(ソフトウェア)

こちらhttps://www.kkaneko.jp/tools/ubuntu/tesseract.htmlを参照し、日本語読み取り可能なものを入れます。

$ sudo apt -y update

$ sudo apt -y install tesseract-ocr tesseract-ocr-jpn tesseract-ocr-jpn-vert libtesseract-dev libleptonica-dev tesseract-ocr-script-jpan tesseract-ocr-script-jpan-vert  

vertは縦書き、scriptは手書きに対応しています。

使用できる言語の確認

$ tesseract --list-langs


コマンドの確認

$ tesseract --help


画像を使ってテスト。次のコマンドで実行。

$ tesseract <対象とする画像ファイル名> <出力ファイル名(.txtは自動付与される)> -l jpn

最後の-l jpnで日本語対応。つけないと英語の認識になります。

読み取れたかどうか確認します。

$ less ファイル名.txt 

印刷の字体は、結構読めました。一方で、手書きの文章は、あまり認識できませんでした。

続いて、-l jpnと-l Japaneseの違いを検証しました。Japaneseの方が認識している量が多いことが判明。

Archivematicaで実際にテストしました。Archivematicaのマニュアル該当箇所は次のページ。

https://www.archivematica.org/en/docs/archivematica-1.13/user-manual/administer/dashboard-admin/#processing-configuration

Micro-servicesを進めて作成されたAIPを確認。AIP内に、Objects>Metadata>OCRというディレクトリーあり。

確認すると英語しか認識していないことが判明。

Archivematicaのコマンド上の標準設定が英語になっていると推測。

設定ファイルを確認する。https://blog.machine-powers.net/2018/08/02/learning-tesseract-command-utility/ により、/usr/share/tesseract-ocrにあることをわかる。

見てもよくわからず。

TesseractのGUIツールであるgImageReaderで環境設定できないかを検討。https://websetnet.net/ja/use-gimagereader-to-extract-text-from-images-and-pdfs-on-linux/

$ sudo apt -y install gimagereader

日本語にはできませんでした。

わからなくなったので解散です。

後日談

師匠がArchivematicaでの日本語読み取りに成功。

Tesseractにデータが渡った時点でeng.traineddataを使って文字認識すると仮定。

元のeng.traineddataを名前の変更してjpn.traineddataにして文字認識させたら、英文も日本語も文字認識しました。

ちなみに、eng.traineddataとjpn.traineddataは

/usr/share/tesseract-ocr/4.00/tessdata/にあり。

2021年8月27日金曜日

【89】archivematica1.13.0へのアップデート:from 1.12.0 upgrade to 1.13.0

人が少ないながら今日もスタート。
前回出てないので「なんとも・・・」のなかなので、不適格なことがあったらすみません。

結論からいうと、最期の<正解>から見ていただければアップグレードはうまくいきます。

Ver. 1.12.0から最新Ver. 1.13.0へアップグレードです。
同じような問題を抱えている方がいたらしく、それに対するコメントにしたがって進めます。

ちなみに、参考にしたのは
https://groups.google.com/g/archivematica/c/QcRQobqdnU4?pli=1
https://docs.djangoproject.com/en/1.11/ref/django-admin/#showmigrations

です。

1.13のドキュメンテーション:Upgradeの手順を確認していきます。
https://www.archivematica.org/en/docs/archivematica-1.13/admin-manual/installation-setup/upgrading/upgrading/#upgrade

ここでは<2.Update packages sources>のコマンドに
"sudo -sh" を冒頭に入れます。すなわち、

 'echo "deb [arch=amd64] http://packages.archivematica.org/1.13.x/ubuntu bionic main" >> /etc/apt/sources.list'
sudo sh -c 'echo "deb [arch=amd64] http://packages.archivematica.org/1.13.x/ubuntu-externals bionic main" >> /etc/apt/sources.list'

としました。
結果は…
見事にエラーです。前回の復習的作業でした。

こっからです。
エラーの詳細を確認します。
sudo journalctl -u archivematica-mcp-server -xe
大量なエラーログの結果、
django.db.utils.OperationalError: (1054, "Unknown colum 'Transfers.status' in 'where clause'")
を確認しました。
ここから、mysqlでDBを確認。
sudo mysql -u root -p
Pass:
>mysql> show databases;

DB"MCP”をセレクトします。
mysql> use MCP;
ここで、次のTransfersを選択。
mysql> select * from Transfers;
と、カラだとのこと。が、並行に作業していたW氏のPCでは、


と、artefactuals社の返答の通りの表示に。ですので、ここからはW氏のPCに替えます。
次に、
https://www.archivematica.org/en/docs/archivematica-1.13/admin-manual/installation-setup/upgrading/upgrading/#upgrade-centos
のうち、"4"のコマンドを実行します。

実行すると、質問者と同じエラー表示が出ます。
ImportError: bad magic number in 'components.administration.management': b'\x03\xf3\r\n
そこで、指示通りに"*.pyc"ファイルをすべて削除するコマンドを実行します。
sudo find . -name "*.pyc" -exec rm -f {} \;
結果は。。。うまくいかず。。。これでうまくいったって言ってたじゃ無いOlixxx!!
ここで、mysqlにログイン
mysql> use MCP;
mysql> select * from django_migrations;
から、"81"が入ってないとならないので確認しましたが、ありません。。。
そこで、またまた質問に戻ります。再度、
sudo find . -name "*.pyc" -exec rm -f {} \;
から、”4”のコマンドを再実行します。
すると、いっぱい"OK"の文字が!!←W氏のオペレートは早すぎてキャプチャーできず。
ここで、再起動。
結果は。。。。うまくつながりました!!!!

<正解>
振り返りますと、
"Upgrad on Ubuntu packages"の手順"4"と"5"の間に下記のコマンドを実行します。
まず、Dashboardにcdします。
cd /usr/share /archivematica/dashboard/
次に、
sudo find . -name "*.pyc" -exec rm -f {} \;
を実行。
をし、ストレージサービス等のRestartをするとうまくいくということになります。
めでたしめでたし!!




2021年8月16日月曜日

【88】archivematica1.13.0へのアップデート

本日は参加者も少なく短時間で終わりました。お盆ですしね。その分、内容も短いです。

前回、1.12から1.13にアップデートしたところ、ダッシュボードの右上に、"Error trying to connect to MCP server. Trying again..."と表示されてしまいました。

どのようなエラーが起こっているかを確認します(日付は別の日となっていますが、道場当日に起こっていたものと同じです)。

ダッシュボードのエラー。

$ sudo journalctl -u archivematica-dashboard

 7月 02 19:47:52 matica-vm systemd[1]: Started Archivematica Dashboard.

 7月 02 19:47:52 matica-vm gunicorn[28503]: [2021-07-02 19:47:52 +0000] [28503] [INFO] Starting gunicorn 19.9.0

 7月 02 19:47:52 matica-vm gunicorn[28503]: [2021-07-02 19:47:52 +0000] [28503] [INFO] Listening at: http://127.0.0.1:8002 (28503)

 7月 02 19:47:52 matica-vm gunicorn[28503]: [2021-07-02 19:47:52 +0000] [28503] [INFO] Using worker: gevent

 7月 02 19:47:52 matica-vm gunicorn[28503]: [2021-07-02 19:47:52 +0000] [28646] [INFO] Booting worker with pid: 28646

 7月 02 19:47:52 matica-vm gunicorn[28503]: [2021-07-02 19:47:52 +0000] [28656] [INFO] Booting worker with pid: 28656

 7月 02 19:47:52 matica-vm gunicorn[28503]: [2021-07-02 19:47:52 +0000] [28697] [INFO] Booting worker with pid: 28697

 7月 02 19:47:53 matica-vm gunicorn[28503]: /usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/cryptography/__init__.py:39: CryptographyDepreca

 7月 02 19:47:53 matica-vm gunicorn[28503]:   CryptographyDeprecationWarning,

 7月 02 19:47:53 matica-vm gunicorn[28503]: /usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/cryptography/__init__.py:39: CryptographyDepreca

 7月 02 19:47:53 matica-vm gunicorn[28503]:   CryptographyDeprecationWarning,

 7月 02 19:47:53 matica-vm gunicorn[28503]: /usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/cryptography/__init__.py:39: CryptographyDepreca

 7月 02 19:47:53 matica-vm gunicorn[28503]:   CryptographyDeprecationWarning,

 7月 02 19:48:06 matica-vm gunicorn[28503]: [2021-07-02 10:48:06 +0000] [28646] [ERROR] Exception in worker process

 7月 02 19:48:06 matica-vm gunicorn[28503]: Traceback (most recent call last):

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn

 7月 02 19:48:06 matica-vm gunicorn[28503]:     worker.init_process()

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/gunicorn/workers/ggevent.py", line 203,

 7月 02 19:48:06 matica-vm gunicorn[28503]:     super(GeventWorker, self).init_process()

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in

 7月 02 19:48:06 matica-vm gunicorn[28503]:     self.load_wsgi()

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in

 7月 02 19:48:06 matica-vm gunicorn[28503]:     self.wsgi = self.app.wsgi()

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi

 7月 02 19:48:06 matica-vm gunicorn[28503]:     self.callable = self.load()

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in lo

 7月 02 19:48:06 matica-vm gunicorn[28503]:     return self.load_wsgiapp()

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in lo

 7月 02 19:48:06 matica-vm gunicorn[28503]:     return util.import_app(self.app_uri)

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_a

 7月 02 19:48:06 matica-vm gunicorn[28503]:     __import__(module)

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/gevent/builtins.py", line 96, in __impor

 7月 02 19:48:06 matica-vm gunicorn[28503]:     result = _import(*args, **kwargs)

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/dashboard/wsgi.py", line 15, in <module>

 7月 02 19:48:06 matica-vm gunicorn[28503]:     elasticSearchFunctions.setup_reading_from_conf(settings)

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/lib/archivematica/archivematicaCommon/elasticSearchFunctions.py", line 148, in setup_reading_from_conf

 7月 02 19:48:06 matica-vm gunicorn[28503]:     settings.SEARCH_ENABLED,

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/lib/archivematica/archivematicaCommon/elasticSearchFunctions.py", line 137, in setup

 7月 02 19:48:06 matica-vm gunicorn[28503]:     create_indexes_if_needed(_es_client, indexes)

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/lib/archivematica/archivematicaCommon/elasticSearchFunctions.py", line 214, in create_indexes_if_needed

 7月 02 19:48:06 matica-vm gunicorn[28503]:     if client.indices.exists(index=",".join(indexes)):

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/elasticsearch/client/utils.py", line 84,

 7月 02 19:48:06 matica-vm gunicorn[28503]:     return func(*args, params=params, **kwargs)

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/elasticsearch/client/indices.py", line 2

 7月 02 19:48:06 matica-vm gunicorn[28503]:     return self.transport.perform_request("HEAD", _make_path(index), params=params)

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/elasticsearch/transport.py", line 358, i

 7月 02 19:48:06 matica-vm gunicorn[28503]:     timeout=timeout,

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/elasticsearch/connection/http_urllib3.py

 7月 02 19:48:06 matica-vm gunicorn[28503]:     raise ConnectionError("N/A", str(e), e)

 7月 02 19:48:06 matica-vm gunicorn[28503]: ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x7f586f44cbd0>: Failed to establish a new connection: [Errno 111

 7月 02 19:48:06 matica-vm gunicorn[28503]: [2021-07-02 10:48:06 +0000] [28646] [INFO] Worker exiting (pid: 28646)

 7月 02 19:48:06 matica-vm gunicorn[28503]: [2021-07-02 10:48:06 +0000] [28697] [ERROR] Exception in worker process

 7月 02 19:48:06 matica-vm gunicorn[28503]: Traceback (most recent call last):

 7月 02 19:48:06 matica-vm gunicorn[28503]:   File "/usr/share/archivematica/virtualenvs/archivematica-dashboard/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn

 7月 02 19:48:06 matica-vm gunicorn[28503]:     worker.init_process()


次に、MCP Serverのエラー。

$ sudo journalctl -u archivematica-mcp-server

-- Logs begin at Fri 2021-07-02 17:33:32 JST, end at Fri 2021-08-13 22:21:03 JST. --

 7月 02 19:44:47 matica-vm systemd[1]: Started Archivematica MCP Server Service.

 7月 02 19:44:47 matica-vm python[24961]: Traceback (most recent call last):

 7月 02 19:44:47 matica-vm python[24961]:   File "/usr/lib/archivematica/MCPServer/archivematicaMCP.py", line 2, in <module>

 7月 02 19:44:47 matica-vm python[24961]:     from server.mcp import main

 7月 02 19:44:47 matica-vm python[24961]:   File "/usr/lib/archivematica/MCPServer/server/mcp.py", line 36, in <module>

 7月 02 19:44:47 matica-vm python[24961]:     django.setup()

 7月 02 19:44:47 matica-vm python[24961]:   File "/usr/share/archivematica/virtualenvs/archivematica-mcp-server/local/lib/python2.7/site-packages/django

 7月 02 19:44:47 matica-vm python[24961]:     apps.populate(settings.INSTALLED_APPS)

 7月 02 19:44:47 matica-vm python[24961]:   File "/usr/share/archivematica/virtualenvs/archivematica-mcp-server/local/lib/python2.7/site-packages/django

 7月 02 19:44:47 matica-vm python[24961]:     app_config = AppConfig.create(entry)

 7月 02 19:44:47 matica-vm python[24961]:   File "/usr/share/archivematica/virtualenvs/archivematica-mcp-server/local/lib/python2.7/site-packages/django

 7月 02 19:44:47 matica-vm python[24961]:     module = import_module(entry)

 7月 02 19:44:47 matica-vm python[24961]:   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module

 7月 02 19:44:47 matica-vm python[24961]:     __import__(name)

 7月 02 19:44:47 matica-vm python[24961]: ImportError: No module named main

 7月 02 19:44:47 matica-vm systemd[1]: archivematica-mcp-server.service: Main process exited, code=exited, status=1/FAILURE

 7月 02 19:44:47 matica-vm systemd[1]: archivematica-mcp-server.service: Failed with result 'exit-code'.

 7月 02 20:00:34 matica-vm systemd[1]: Started Archivematica MCP Server Service.

 7月 02 20:00:35 matica-vm python[6838]: /usr/share/archivematica/virtualenvs/archivematica-mcp-server/local/lib/python2.7/site-packages/cryptography/__

 7月 02 20:00:35 matica-vm python[6838]:   CryptographyDeprecationWarning,

 7月 02 21:39:34 matica-vm systemd[1]: Stopping Archivematica MCP Server Service...

 7月 02 21:39:35 matica-vm systemd[1]: Stopped Archivematica MCP Server Service.


Nginxのログ(/var/log/nginx/error.log)やダッシュボードのログ(/var/log/archivematica/dashboard/dashboard.debug.log)を確認しましたが、よくわからず。再度、同じアップグレードの処理を繰り返しましたが、効果なし。それで解散となりました。

次回の予定

8/20(金)です。

<後日>

次の日、個人的にもう一度確認してみました。上記のエラーが、/usr/share/archivematica/virtualenvs/archivematica-mcp-server/local/lib/python2.7/site-packagesに関係しているので、調べたところ、/usr/share/archivematica/virtualenvs/archivematica-mcp-server/local以下がごっそりありませんでした。

そこで、https://github.com/archivematica/Issues/issues/903を参照し、次のコマンドを遂行。

$ sudo apt install virtualenv

すると、archivematica-mcp-server/local以下が入りました。

ところが、またも"Error trying to connect to MCP server. Trying again..."です。一応、エラーを確認します。

Mcp Server

$ sudo journalctl -u archivematica-mcp-server

8月 14 17:57:32 matica-vm systemd[1]: Started Archivematica MCPServer.

 8月 14 17:57:32 matica-vm python[28671]: Traceback (most recent call last):

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/db/back

 8月 14 17:57:32 matica-vm python[28671]:     return self.cursor.execute(sql, params)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/db/back

 8月 14 17:57:32 matica-vm python[28671]:     return self.cursor.execute(query, args)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/MySQLdb/cursor

 8月 14 17:57:32 matica-vm python[28671]:     res = self._query(query)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/MySQLdb/cursor

 8月 14 17:57:32 matica-vm python[28671]:     db.query(q)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/MySQLdb/connec

 8月 14 17:57:32 matica-vm python[28671]:     _mysql.connection.query(self, query)

 8月 14 17:57:32 matica-vm python[28671]: MySQLdb._exceptions.OperationalError: (1054, "Unknown column 'Transfers.status' in 'where clause'")

 8月 14 17:57:32 matica-vm python[28671]: The above exception was the direct cause of the following exception:

 8月 14 17:57:32 matica-vm python[28671]: Traceback (most recent call last):

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/lib/archivematica/MCPServer/archivematicaMCP.py", line 5, in <module>

 8月 14 17:57:32 matica-vm python[28671]:     main()

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/lib/archivematica/MCPServer/server/mcp.py", line 106, in main

 8月 14 17:57:32 matica-vm python[28671]:     Package.cleanup_old_db_entries()

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/lib/python3.6/contextlib.py", line 52, in inner

 8月 14 17:57:32 matica-vm python[28671]:     return func(*args, **kwds)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/lib/archivematica/MCPServer/server/packages.py", line 574, in cleanup_old_db_entries

 8月 14 17:57:32 matica-vm python[28671]:     completed_at=completed_at,

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/db/mode

 8月 14 17:57:32 matica-vm python[28671]:     rows = query.get_compiler(self.db).execute_sql(CURSOR)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/db/mode

 8月 14 17:57:32 matica-vm python[28671]:     cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/db/mode

 8月 14 17:57:32 matica-vm python[28671]:     raise original_exception

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/db/mode

 8月 14 17:57:32 matica-vm python[28671]:     cursor.execute(sql, params)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/db/back

 8月 14 17:57:32 matica-vm python[28671]:     return self.cursor.execute(sql, params)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/db/util

 8月 14 17:57:32 matica-vm python[28671]:     six.reraise(dj_exc_type, dj_exc_value, traceback)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/utils/s

 8月 14 17:57:32 matica-vm python[28671]:     raise value.with_traceback(tb)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/db/back

 8月 14 17:57:32 matica-vm python[28671]:     return self.cursor.execute(sql, params)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/db/back

 8月 14 17:57:32 matica-vm python[28671]:     return self.cursor.execute(query, args)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/MySQLdb/cursor

 8月 14 17:57:32 matica-vm python[28671]:     res = self._query(query)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/MySQLdb/cursor

 8月 14 17:57:32 matica-vm python[28671]:     db.query(q)

 8月 14 17:57:32 matica-vm python[28671]:   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/MySQLdb/connec

 8月 14 17:57:32 matica-vm python[28671]:     _mysql.connection.query(self, query)

 8月 14 17:57:32 matica-vm python[28671]: django.db.utils.OperationalError: (1054, "Unknown column 'Transfers.status' in 'where clause'")

 8月 14 17:57:33 matica-vm systemd[1]: archivematica-mcp-server.service: Main process exited, code=exited, status=1/FAILURE

 8月 14 17:57:33 matica-vm systemd[1]: archivematica-mcp-server.service: Failed with result 'exit-code'.


ダッシュボード

$ sudo journalctl -u archivematica-dashboard

8月 14 17:42:04 matica-vm systemd[1]: Stopping Archivematica Dashboard...
 8月 14 17:42:04 matica-vm gunicorn[17544]: [2021-08-14 17:42:04 +0900] [17544] [INFO] Handling signal: term
 8月 14 17:42:34 matica-vm gunicorn[17544]: [2021-08-14 17:42:34 +0900] [17544] [INFO] Shutting down: Master
 8月 14 17:42:34 matica-vm systemd[1]: Stopped Archivematica Dashboard.
 8月 14 17:42:34 matica-vm systemd[1]: Started Archivematica Dashboard.
 8月 14 17:42:34 matica-vm gunicorn[28072]: [2021-08-14 17:42:34 +0900] [28072] [INFO] Starting gunicorn 19.9.0
 8月 14 17:42:34 matica-vm gunicorn[28072]: [2021-08-14 17:42:34 +0900] [28072] [INFO] Listening at: http://127.0.0.1:8002 (28072)
 8月 14 17:42:34 matica-vm gunicorn[28072]: [2021-08-14 17:42:34 +0900] [28072] [INFO] Using worker: gevent
 8月 14 17:42:34 matica-vm gunicorn[28072]: [2021-08-14 17:42:34 +0900] [28076] [INFO] Booting worker with pid: 28076
 8月 14 17:42:34 matica-vm gunicorn[28072]: [2021-08-14 17:42:34 +0900] [28077] [INFO] Booting worker with pid: 28077
 8月 14 17:42:34 matica-vm gunicorn[28072]: [2021-08-14 17:42:34 +0900] [28078] [INFO] Booting worker with pid: 28078
 8月 14 17:57:46 matica-vm systemd[1]: Stopping Archivematica Dashboard...
 8月 14 17:57:46 matica-vm gunicorn[28072]: [2021-08-14 17:57:46 +0900] [28072] [INFO] Handling signal: term
 8月 14 17:57:47 matica-vm gunicorn[28072]: [2021-08-14 08:57:47 +0000] [28078] [INFO] Worker exiting (pid: 28078)
 8月 14 17:58:06 matica-vm gunicorn[28072]: [2021-08-14 08:58:06 +0000] [28077] [INFO] Worker exiting (pid: 28077)
 8月 14 17:58:16 matica-vm gunicorn[28072]: [2021-08-14 17:58:16 +0900] [28072] [INFO] Shutting down: Master
 8月 14 17:58:16 matica-vm systemd[1]: Stopped Archivematica Dashboard.
 8月 14 17:58:16 matica-vm systemd[1]: Started Archivematica Dashboard.
 8月 14 17:58:16 matica-vm gunicorn[28698]: [2021-08-14 17:58:16 +0900] [28698] [INFO] Starting gunicorn 19.9.0
 8月 14 17:58:16 matica-vm gunicorn[28698]: [2021-08-14 17:58:16 +0900] [28698] [INFO] Listening at: http://127.0.0.1:8002 (28698)
 8月 14 17:58:16 matica-vm gunicorn[28698]: [2021-08-14 17:58:16 +0900] [28698] [INFO] Using worker: gevent
 8月 14 17:58:16 matica-vm gunicorn[28698]: [2021-08-14 17:58:16 +0900] [28701] [INFO] Booting worker with pid: 28701
 8月 14 17:58:17 matica-vm gunicorn[28698]: [2021-08-14 17:58:17 +0900] [28703] [INFO] Booting worker with pid: 28703
 8月 14 17:58:17 matica-vm gunicorn[28698]: [2021-08-14 17:58:17 +0900] [28705] [INFO] Booting worker with pid: 28705

続いて、ダッシュボードのログ(/var/log/archivematica/dashboard/dashboard.debug.log)を確認。

4873 ERROR     2021-08-13 10:45:56  django.request:exception:handle_uncaught_exception:135:  Internal Server Error: /status/

4874 Traceback (most recent call last):

4875   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner

4876     response = get_response(request)

4877   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response

4878     response = self.process_exception_by_middleware(e, request)

4879   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response

4880     response = wrapped_callback(request, *callback_args, **callback_kwargs)

4881   File "/usr/share/archivematica/dashboard/main/views.py", line 80, in status

4882     xml = etree.XML(client.list())

4883   File "/usr/share/archivematica/dashboard/contrib/mcp/client.py", line 162, in list

4884     b"getJobsAwaitingApproval", six.moves.cPickle.dumps({}, protocol=0)

4885   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/gearman/client.py", line 49, in submit_job

4886     jobs_to_submit=[job_info], **kwargs

4887   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/gearman/client.py", line 70, in submit_multiple_jobs

4888     return self.submit_multiple_requests(requests_to_submit, **kwargs)

4889   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/gearman/client.py", line 90, in submit_multiple_requests

4890     processed_requests = self.wait_until_jobs_completed(processed_requests, poll_timeout=time_remaining)

4891   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/gearman/client.py", line 134, in wait_until_jobs_completed

4892     self.poll_connections_until_stopped(self.connection_list, continue_while_jobs_incomplete, timeout=poll_timeout)

4893   File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/gearman/connection_manager.py", line 248, in poll_connections_until_stopped

4894     raise ServerUnavailable('Found no valid connections in list: %r' % self.connection_list)

4895 gearman.errors.ServerUnavailable: Found no valid connections in list: [GearmanConnection(host='127.0.0.1', port=4730, keyfile=None, certfile=None, ca_certs=None)]

続いて、Nginxのログ(/var/log/nginx/error.log)

1  2021/08/13 16:23:17 [error] 933#933: *474 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.56.1, server: _, request: "GET /transfer/status/?1628839396328 HTTP/1.1", upstream: "http://127.0.0.1:8002/transfer/status/?1628839396328", host: "192.168.56.3", referrer: "http://192.168.56.3/transfer/"

2 2021/08/13 16:23:28 [error] 933#933: *474 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.56.1, server: _, request: "GET /transfer/status/?1628839406336 HTTP/1.1", upstream: "http://127.0.0.1:8002/transfer/status/?1628839406336", host: "192.168.56.3", referrer: "http://192.168.56.3/transfer/"

3 2021/08/13 16:23:35 [error] 933#933: *463 upstream prematurely closed connection while reading response header from upstream, client: 192.168.56.1, server: _, request: "GET /status/?1628839311270 HTTP/1.1", upstream: "http://127.0.0.1:8002/status/?1628839311270", host: "192.168.56.3", referrer: "http://192.168.56.3/transfer/"

4 2021/08/13 19:46:46 [error] 933#933: *877 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.56.1, server: _, request: "GET /transfer/status/?1628851605901 HTTP/1.1", upstream: "http://127.0.0.1:8002/transfer/status/?1628851605901", host: "192.168.56.3", referrer: "http://192.168.56.3/transfer/"

5 2021/08/13 19:46:53 [error] 933#933: *811 upstream prematurely closed connection while reading response header from upstream, client: 192.168.56.1, server: _, request: "GET /status/?1628851560793 HTTP/1.1", upstream: "http://127.0.0.1:8002/status/?1628851560793", host: "192.168.56.3", referrer: "http://192.168.56.3/transfer/"


ここで、よくわからなくなったので諦めました。Archivematicaの掲示板にError connecting to MCP serverがあがっています。

ところが、エラーの種類が異なるようですので、どうしていいかわかりません。


2021年7月30日金曜日

【87】archivematica1.13.0へのアップデートと新機能:Audit logを中心に

 前回は、難しいお話。その前はarchivematicaのインストールとAtoMへのDipアップロードをしましたが、マニュアル通りのために割愛しました。結果、1ヶ月ぶりの更新となります。ご容赦を。

1.13へのアップデート
さて、本日ですが、maticaがVer.1.12から1.13になりましたので、アップグレードからはじめます。maticaのドキュメンテーションを参照します。

https://www.archivematica.org/en/docs/archivematica-1.13/admin-manual/installation-setup/upgrading/upgrading/#upgrade

内容を見ていただければわかるのですが、インストールとほぼマニュアル通りです。それでは作業をすすめます。が、ここで躓きます。<echo>コマンドが権限の問題で通りません。以下のコマンドで、スーパーユーザーになった上で進めてください。

sudo su

進めて行くと、データを残すかどうか聞かれます。今回、データを入れていないで、残さない<Y>を選択しましたが、皆さんはご自分の環境を確認してください。

無事に終わり、ダッシュボード<maticaのIPアドレス:80>にログインします。ダッシュボードは無事見えましたが、MCP Server connectionエラーが出ました。ダッシュボードの右上には、接続状況が小さい文字で表示されるので、エラーもそこを確認してください。

結局1.12から1.13へのアップデートは失敗しました。まぁ、この問題は後日解決することにし、今日は他のマシーンのArchivematciaに変更することにします。「橋号」から「堀号」へ移動です。笑

ダッシュボードからBrowsができない場合
「堀号」にも早速問題が発生しました。ダッシュボードからbrowseしても、/homeが見えません。これが見えないと転送するファイルの選択ができません。しかし、最初の設定でよく出る問題なので、覚えておきましょう。ダッシュボードとStorage Serviceが会話するために同一APIキーが必要ですが、それが合わないことが原因である場合が多いようです。

APIキーがあるところは以下2ヶ所。

1.ストレージサービス>PipelineのAPI key
2.Dashboard>Administration>GeneralのAPI key

1がインストール時のAPIキーなので、2も同じAPIキーを持つ必要があります。

※Dashboard>Administration>Users>EditにもAPIキーがあるが、再生成できるようになっており、現在のものは見えない状態。これが他のAPIキーとどんな関係があるかは今のところ分からない。これでこんがらがって、再発行したもので一致させたりして混乱したことがあります。

これでbrowseもできるようになったので、Archivematcia1.13に追加された新しいメニューや機能を確認します。

Auditmaticaをインストールしてみる
Arivhimaitca1.13の新しくなった情報は、以下のサイトで確認できます。

中でも、監査ログを取る機能として、Auditmaticaというものがが追加されたみたいなので、それを確認することにします。以下のGithubで公開されているマニュアル通りインストールを試みます。
https://github.com/artefactual-labs/auditmatica

短いマニュアルですが、なめたらあかん〜でした。
まず問題となったのは、pythonのバージョンが合わないことでした。auditmaitcaはpython3.6+で動きますが、「堀号」のArchivematciaはpython2??でした。しかし、調べると「堀号」にはpython3.6もありました。

そこで、インストールコマンドの pip install auditmatica を pip3 install auditmatica にしてインストールしたら、エラーなく無事インストールされました。

その後、マニュアル通り auditmatica write-cef /path/to/nginx/access.log を実行。しかしここでそのようなコマンドはないという問題が発生しました。

もしかしてと思い、マニュアルでのインストール方法も試しました。
git clone https://github.com/artefactual-labs/auditmatica.git
cd auditmatica/ 
pip install .
上記を実行したら、今度はエラーが一つ出ました。↓

ここから「堀号」の冒険がはじまります。ネット上のあらゆる情報を頼りに、あれこれ試していたら時間切れで「堀号」のArchivematciaは出番無しで終わってしまいました。いつも思いますが、正直Githubのマニュアルは初心者には不親切で、使い方がよくわからないのです。それに、2つのインストール結果が異なるので、無事インストールされのか、エラーが出たのでダメだったのかもわかりません。どっちかひとつにして〜〜【T__T】

仕方がなにので、参考にしたサイトや試したあれこれを記録として残しておきます。

pythonのリンクを変更してみる
python -> python2.7 をpython3.6へ変更
水色のコマンドを入れると、緑色のコマンドが実行される

同じく、python-configもpython3.6-configが実行されるようにリンクを変更


エラー参考サイト
pip でインストールエラー: Command “python setup.py egg_info” failed

「"python setup.py egg_info" failed with error code 1 」

マニュアル参考サイト
archivematica/hack/etc/nginx/nginx.conf のGithubサイト

auditmaticaマニュアルサイト(Tessa Walshさん)

その他参考サイト
pipでインストールしたパッケージの場所を調べる

するとここにあることを確認(なのになぜ動かないのよ〜〜〜)
どれもうまくいかず、問題解決は失敗です。ということで、今日はここまでです。この問題は次回に続けますが、果たしてどうやることやら。

========================
次回は8月13日(金)19時頃からです。
この問題の続きを試します〜

最近の投稿

【108】Archives in the Digital Age: The use of AI and machine learning in the Swedish archival sectorを読む

 Gijs Aangenendt氏の修士論文、Archives in the Digital Age: The use of AI and machine learning in the Swedish archival sectorを半分読みました。 前半は、AIを扱ったアーカ...

人気の投稿