Armadilloフォーラム

VSCodeから[Generate development swu]が実行できない

shun

2024年7月12日 16時53分

ATDE9からABOS搭載のArmadillo-610にプログラムを書き込もうとしているのですが、[Generate development swu]実行しようとすると、

コンテナイメージを ./swu/test1.tar に保存しました。
./swu/app.desc のバージョンを 2 から 3 に変更しました。
Enter pass phrase for /home/atmark/mkswu/swupdate.key:
xargs: シングルクオートが一致しません。デフォルトでは -O オプションを指定しない限り xargs でクォートは特別な意味を持ちます
 
 *  The terminal process "/usr/bin/bash '-c', './scripts/generate_swu.sh development'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

とinitial_setup.swuで設定した証明書のPWを入力すると以上のようなエラー文が出力されました。
原因を教えていただけると幸いです。

コメント

at_dominique.m…

2024年7月12日 18時18分

shunさん

お世話になっています、
マルティネです。

> xargs: シングルクオートが一致しません。デフォルトでは -O オプションを指定しない限り xargs でクォートは特別な意味を持ちます

申し訳ございません、mkswu の最後の不要になったファイルを削除処理が甘くてもうイメージができた時にエラーが発生してしまったようです。

原因としては、おそらく vscode のプロジェクトまでのパスのどこかにシングルクオート(「'」文字) が入ってると思いますが、あっていますでしょうか?

そのクオートが入らないようにディレクトリをリネームしていただければエラーがなくなりますが、難しい場合は mkswu も修正しましたので、お手数ですが更新していただければ成功するようになると思います。
パッケージの更新は今月末に正式リリースしますが、ひとまずは手動にファイルを更新できます:

atmark@atde9:~$ git clone https://github.com/atmark-techno/mkswu mkswu-repo
atmark@atde9:~$ cd mkswu-repo
atmark@atde9:~/mkswu-repo$ sudo make install_mkswu
atmark@atde9:~/mkswu-repo$ mkswu --version
mkswu バージョン 6.2.1.3.g0b540d4

そのバージョン(かそれ以上)が表示されたらこの不具合が修正されているはずですので、もう一度 generate development swu を実行してみていただければ幸いです。

よろしくお願いします。

shun

2024年7月16日 11時04分

> shunさん
>
> お世話になっています、
> マルティネです。
>
> > xargs: シングルクオートが一致しません。デフォルトでは -O オプションを指定しない限り xargs でクォートは特別な意味を持ちます
>
> 申し訳ございません、mkswu の最後の不要になったファイルを削除処理が甘くてもうイメージができた時にエラーが発生してしまったようです。
>
> 原因としては、おそらく vscode のプロジェクトまでのパスのどこかにシングルクオート(「'」文字) が入ってると思いますが、あっていますでしょうか?
>
> そのクオートが入らないようにディレクトリをリネームしていただければエラーがなくなりますが、難しい場合は mkswu も修正しましたので、お手数ですが更新していただければ成功するようになると思います。
> パッケージの更新は今月末に正式リリースしますが、ひとまずは手動にファイルを更新できます:
>

> atmark@atde9:~$ git clone https://github.com/atmark-techno/mkswu mkswu-repo
> atmark@atde9:~$ cd mkswu-repo
> atmark@atde9:~/mkswu-repo$ sudo make install_mkswu
> atmark@atde9:~/mkswu-repo$ mkswu --version
> mkswu バージョン 6.2.1.3.g0b540d4
> 

>
> そのバージョン(かそれ以上)が表示されたらこの不具合が修正されているはずですので、もう一度 generate development swu を実行してみていただければ幸いです。
>
> よろしくお願いします。

お世話になっております。
手動ファイル更新にて[Generate development swu]が成功しました。

次に[App run on Armadillo]で実行しようとしたのですが、

ign_and_send_pubkey: signing failed for ED25519 "/home/atmark/.ssh/id_ed25519_vscode" from agent: agent refused operation
root@192.168.11.72's password: 
Permission denied, please try again.
root@192.168.11.72's password: 
Permission denied, please try again.
root@192.168.11.72's password: 
 *  Terminal will be reused by tasks, press any key to close it.

となり、rootユーザーのPW、証明書PWなど試しましたが権限の許可がないようです。
解決方法をお教え願いたいです。よろしくお願いします。

at_makoto.sato

2024年7月16日 12時48分

佐藤です。

作成された development.swu を、armadilloにインストールしましたでしょうか。
していない場合は、インストールしてから [App run on Armadillo] を試してみてもらえますでしょうか。

shun

2024年7月16日 13時39分

> 佐藤です。
>
> 作成された development.swu を、armadilloにインストールしましたでしょうか。
> していない場合は、インストールしてから [App run on Armadillo] を試してみてもらえますでしょうか。

お世話になっております。mkswuディレクトリ内にある[development.swu]をABOS Webからインストールした状態で[App run on Armadillo]を実行しています。

 *  Executing task: ./scripts/run_armadillo.sh 
 
make: Entering directory '/vol_app/src'
make: Nothing to be done for 'all'.
make: Leaving directory '/vol_app/src'
sign_and_send_pubkey: signing failed for ED25519 "/home/atmark/.ssh/id_ed25519_vscode" from agent: agent refused operation
root@XXX.XXX.XXX.XXX's password: 
Permission denied, please try again.
root@XXX.XXX.XXX.XXX's password: 
Permission denied, please try again.
root@XXX.XXX.XXX.XXX's password: 
root@XXX.XXX.XXX.XXX: Permission denied (publickey,password,keyboard-interactive).
lost connection
sign_and_send_pubkey: signing failed for ED25519 "/home/atmark/.ssh/id_ed25519_vscode" from agent: agent refused operation
root@XXX.XXX.XXX.XXX's password: 
Permission denied, please try again.
root@XXX.XXX.XXX.XXX's password:

実行すると以上のような状態です。
よろしくお願いします。

at_makoto.sato

2024年7月16日 14時47分

佐藤です。

development.swuはインストール済みであること承知しました。
調査のために以下のATDE9内のファイルを添付していただくことはできますでしょうか。
・プロジェクトディレクトリ下の config/ssh_config ファイル
・/etc/ssh/ssh_config ファイル

加えて、プロジェクトディレクトリ直下で以下のコマンドの実行結果もいただけますでしょうか。

[ATDE9]$ cd <プロジェクトディレクトリ直下へ移動>
[ATDE9]$ ssh -v -F config/ssh_config Armadillo

shun

2024年7月16日 15時06分

> 佐藤です。
>
> development.swuはインストール済みであること承知しました。
> 調査のために以下のATDE9内のファイルを添付していただくことはできますでしょうか。
> ・プロジェクトディレクトリ下の config/ssh_config ファイル
> ・/etc/ssh/ssh_config ファイル
>
> 加えて、プロジェクトディレクトリ直下で以下のコマンドの実行結果もいただけますでしょうか。
>

> [ATDE9]$ cd <プロジェクトディレクトリ直下へ移動>
> [ATDE9]$ ssh -v -F config/ssh_config Armadillo
> 

お世話になっております。
以下に情報を示します。

1. プロジェクトディレクトリ下の config/ssh_configファイル

Host Armadillo
    Hostname 192.168.11.72
    User root
    IdentityFile ${HOME}/.ssh/id_ed25519_vscode
    UserKnownHostsFile config/ssh_known_hosts
    StrictHostKeyChecking accept-new

2. /etc/ssh/ssh_config ファイル

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
 
# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.
 
# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.
 
Include /etc/ssh/ssh_config.d/*.conf
 
Host *
#   ForwardAgent no
#   ForwardX11 no
#   ForwardX11Trusted yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   IdentityFile ~/.ssh/id_ecdsa
#   IdentityFile ~/.ssh/id_ed25519
#   Port 22
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h
#   UserKnownHostsFile ~/.ssh/known_hosts.d/%k
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes

3. [ssh -v -F config/ssh_config Armadillo]の実行結果

atmark@atde9:~/MU-DM3'/test1$ ls
app  config  container  development.swu  info.json  scripts  swu
atmark@atde9:~/MU-DM3'/test1$ ssh -v -F config/ssh_config Armadillo
OpenSSH_8.4p1 Debian-5+deb11u3, OpenSSL 1.1.1w  11 Sep 2023
debug1: Reading configuration data config/ssh_config
debug1: config/ssh_config line 1: Applying options for Armadillo
debug1: Connecting to 192.168.11.72 [192.168.11.72] port 22.
debug1: Connection established.
debug1: identity file /home/atmark/.ssh/id_ed25519_vscode type 3
debug1: identity file /home/atmark/.ssh/id_ed25519_vscode-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.4p1 Debian-5+deb11u3
debug1: Remote protocol version 2.0, remote software version OpenSSH_9.6
debug1: match: OpenSSH_9.6 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.11.72:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:mvMemv+Oog49N15/PwlWZugbjdonhtpvAthSqiJXlGg
debug1: Host '192.168.11.72' is known and matches the ECDSA host key.
debug1: Found key in config/ssh_known_hosts:1
debug1: ssh_packet_send2_wrapped: resetting send seqnr 3
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: ssh_packet_read_poll2: resetting read seqnr 3
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /home/atmark/.ssh/id_ed25519_vscode ED25519 SHA256:HXWJEGmHVKdH54bPYhmVFGrfBCtx/ZzO2YLQ4UWYDgo explicit agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256>
debug1: kex_input_ext_info: publickey-hostbound@openssh.com (unrecognised)
debug1: kex_input_ext_info: ping@openssh.com (unrecognised)
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /home/atmark/.ssh/id_ed25519_vscode ED25519 SHA256:HXWJEGmHVKdH54bPYhmVFGrfBCtx/ZzO2YLQ4UWYDgo explicit agent
debug1: Server accepts key: /home/atmark/.ssh/id_ed25519_vscode ED25519 SHA256:HXWJEGmHVKdH54bPYhmVFGrfBCtx/ZzO2YLQ4UWYDgo explicit agent
sign_and_send_pubkey: signing failed for ED25519 "/home/atmark/.ssh/id_ed25519_vscode" from agent: agent refused operation
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
root@192.168.11.72's password: 
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
root@192.168.11.72's password: 
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
root@192.168.11.72's password: 
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: No more authentication methods to try.
root@192.168.11.72: Permission denied (publickey,password,keyboard-interactive).

以上です。よろしくお願いいたします。

at_makoto.sato

2024年7月16日 16時08分

佐藤です。

ログありがとうございます。

"ssh-add -c .ssh/id_ed25519_vscode" コマンドを実行したのではないかと推察します。
この場合 ATDE に必要なソフトウェアが入っていないため、 ssh-agent との連携が取れずエラーとなってしまいます。
以下のコマンドを実行後、再度試してもらえますでしょうか。

[ATDE9]$ sudo apt install ssh-askpass-gnome

shun

2024年7月16日 17時03分

> 佐藤です。
>
> ログありがとうございます。
>
> "ssh-add -c .ssh/id_ed25519_vscode" コマンドを実行したのではないかと推察します。
> この場合 ATDE に必要なソフトウェアが入っていないため、 ssh-agent との連携が取れずエラーとなってしまいます。
> 以下のコマンドを実行後、再度試してもらえますでしょうか。
>

> [ATDE9]$ sudo apt install ssh-askpass-gnome
> 

お世話になっております。
[sudo apt install ssh-askpass-gnome]を実行してライブラリを取得したのですが、
依然としてssh認証ができません。sshの設定を再度生成し直した方がよろしいでしょうか。
よろしくお願いいたします。

 *  Executing task: ./scripts/run_armadillo.sh 
 
make: Entering directory '/vol_app/src'
make: Nothing to be done for 'all'.
make: Leaving directory '/vol_app/src'
sign_and_send_pubkey: signing failed for ED25519 "/home/atmark/.ssh/id_ed25519_vscode" from agent: agent refused operation
root@192.168.11.72's password: 
Connection closed by 192.168.11.72 port 22
lost connection
sign_and_send_pubkey: signing failed for ED25519 "/home/atmark/.ssh/id_ed25519_vscode" from agent: agent refused operation

at_makoto.sato

2024年7月16日 17時13分

佐藤です。

何度もすいません。
以下のようにvscodeを起動するとどうでしょうか。

[ATDE9]$ cd <プロジェクトディレクトリの直下へ移動>
[ATDE9]$ unset SSH_AUTH_SOCK; code ./

shun

2024年7月16日 18時16分

> 佐藤です。
>
> 何度もすいません。
> 以下のようにvscodeを起動するとどうでしょうか。
>

> [ATDE9]$ cd <プロジェクトディレクトリの直下へ移動>
> [ATDE9]$ unset SSH_AUTH_SOCK; code ./
> 

お世話になっております。
code起動時のディレクトリをプロジェクトディレクトリに変更したところ起動できました。ありがとうございます。

[App run on Armadillo]を実行したところ、ssh認証のPWを要求されたので入力して実行したのですが、計4回入力しないと実行ができないようなのですがこれはプロジェクト内のソースコードの数分実行しないといけないものなのでしょうか?
ご回答の程よろしくお願いいたします。

at_makoto.sato

2024年7月16日 18時56分

佐藤です。

また何点か確認させてください。
"unset SSH_AUTH_SOCK" をせずに、以下のように普通にvscodeを起動し
[App run on Armadillo] を実行した時に、添付した画像のようなパスワード入力画面が表示されたことはありますでしょうか?

[ATDE9]$ cd <プロジェクトディレクトリの直下へ移動>
[ATDE9]$ code ./

表示されたことがある場合、ここに [Setup environment] を実行した時に設定したパスワードと同じものを入力しましたでしょうか。

ファイル ファイルの説明
password_dialog.png

shun

2024年7月17日 9時54分

> 佐藤です。
>
> また何点か確認させてください。
> "unset SSH_AUTH_SOCK" をせずに、以下のように普通にvscodeを起動し
> [App run on Armadillo] を実行した時に、添付した画像のようなパスワード入力画面が表示されたことはありますでしょうか?
>

> [ATDE9]$ cd <プロジェクトディレクトリの直下へ移動>
> [ATDE9]$ code ./
> 

>
> 表示されたことがある場合、ここに [Setup environment] を実行した時に設定したパスワードと同じものを入力しましたでしょうか。

お世話になっております。
unset SSH_AUTH_SOCK無しでも問題なくVS Codeは起動しました。

頂いた画像は1度表示したことがあり、下の[ログイン中はいつでもこの鍵のロックを自動的に解除]にチェックを入れて以降表示されることが無くなりました。

[App run on Armadillo]を実行した現在の状況を下記に示します。

 *  Executing task: ./scripts/run_armadillo.sh 
 
make: Entering directory '/vol_app/src'
make: Nothing to be done for 'all'.
make: Leaving directory '/vol_app/src'
Enter passphrase for key '/home/atmark/.ssh/id_ed25519_vscode': [ssh接続のPW入力]
test2.conf                                                        100%  566   118.7KB/s   00:00    
Enter passphrase for key '/home/atmark/.ssh/id_ed25519_vscode': [ssh接続のPW入力]
Enter passphrase for key '/home/atmark/.ssh/id_ed25519_vscode': [ssh接続のPW入力]
Enter passphrase for key '/home/atmark/.ssh/id_ed25519_vscode': [ssh接続のPW入力]
Starting 'test2'
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Error: you can only attach to running containers
 
 *  The terminal process "/usr/bin/bash '-c', './scripts/run_armadillo.sh'" terminated with exit code: 125. 
 *  Terminal will be reused by tasks, press any key to close it.

よろしくお願いいたします。

at_makoto.sato

2024年7月17日 10時03分

佐藤です。

> 頂いた画像は1度表示したことがあり、下の[ログイン中はいつでもこの鍵のロックを自動的に解除]にチェックを入れて以降表示されることが無くなりました。
その時にパスワードを入力していなかったか、間違ったパスワードを入力してしまったのかもしれません。
以下のコマンドを実行後にATDE9を再起動するとまた表示されるようになると思います。
表示されたらssh鍵のパスワードを入力してチェックボックスにチェックをいれて「ロックを解除」をすると、
何度もパスワードを求められることなくアプリを実行できるようになるかと思います。

[ATDE9]$ rm -f ~/.local/share/keyrings

shun

2024年7月17日 11時44分

お世話になっております。
ご教示いただいた方法でパスワード情報を更新したらパスワードを求められることはなくなりました。

Error: you can only attach to running containers
 
 *  The terminal process "/usr/bin/bash '-c', './scripts/run_armadillo.sh'" terminated with exit code: 125. 
 *  Terminal will be reused by tasks, press any key to close it.。

上記のエラー文が出力されてプロジェクトが実行されませんでした。
一度[App stop on Armadillo]でコンテナを停止してから再度[App run on Armadillo]を実行しても同様なエラー文が出てしまいます。

解決方法はございますでしょうか。
よろしくお願いいたします。

at_makoto.sato

2024年7月17日 13時20分

佐藤です。

コンテナのログを確認させてください。
webブラウザで、https://:58080 にアクセスしていただき、abos-webを開いてください。
ログインして「コンテナ管理」のページに行き、該当のコンテナを選択した後に、「ログ表示」を押して表示されるログはどうなってますでしょうか。

abos-webを使用していない場合は、コンソールからarmadilloにログインして以下のコマンドでログを取得してください。

[armadillo]# podman ps -a  # コンテナ名を確認
[armadillo]# podman logs <該当のコンテナ名>

もう一点確認させてください、作成したプログラムはどのようなプログラムでしょうか?
内部で無限ループが回るようなプログラムではなく、なにか特定の処理を行ってそのまま終了するようなプログラムでしょうか。
もし、後者のようなプログラムの場合は、コンテナにattachする前にプログラムが終了してコンテナも終了してしまうため、
ご報告いただいたエラーが出てしまうことがあります。

at_makoto.sato

2024年7月17日 13時24分

佐藤です。

連投すいません。
> webブラウザで、https://:58080 にアクセスしていただき、abos-webを開いてください。
webブラウザで、https://<armadilloのIPアドレス>:58080 にアクセスしていただき、abos-webを開いてください。
です。

shun

2024年7月18日 14時52分

お世話になっております。
ABOS Webの[コンテナ管理]→[ログ表示]で想定していたプログラムの実行内容が表示されていることを確認しました。

解決にご協力いただきありがとうございました。今後ともよろしくお願いいたします。