Macのアクティビティモニターで、謎のプロセスがいる。

どうやら、「仮想マシンサービス」らしく、Podmanだった。
Dockerでも「Docker 仮想マシンサービス」となるところが、「Dockerの莉ョ諠ウ繝槭す繝ウ繧オ繝シ繝薙せ」となるケースがあるらしい。

Macのアクティビティモニターで、謎のプロセスがいる。
どうやら、「仮想マシンサービス」らしく、Podmanだった。
Dockerでも「Docker 仮想マシンサービス」となるところが、「Dockerの莉ョ諠ウ繝槭す繝ウ繧オ繝シ繝薙せ」となるケースがあるらしい。
別のバージョンで試してもOpenJDKのインストールがエラーになる。
最初は「ダウンロードが失敗しました: read ENETDOWN」でOpenJDKの配布元がダウンしてるかと思ったけど、どこから配布してるか不明だし、Twitterにもそんなコメントはなかった。
「read ENETDOWN」なので、アンチウイルスを疑ってESETのFWを無効にしたらダウンロードが成功、次は「 Installation Failed」となったので一旦Esetのリアルタイム保護なども停止して再度実行したら成功!
Unity Hub Open JDK インストール成功
タイトルの通りjsの日付ライブラリmomentの日付操作のパラメータが変更になっていた。
確認したのは2.29.1
"dependencies": {
"moment": "^2.29.1"
}
moment().add( 'days' , -6,).format("YYYY-MM-DD");
Deprecation warning: moment().add(period, number) is deprecated. Please use moment().add(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.
moment().add( -6, 'days' ).format("YYYY-MM-DD");
dockerをアップデート後に、以前は動いていたプロジェクトをdocker-composeでupしようとしたらエラーがでました。
dp-local:docker dp$ docker-compose up -d
network ネットワーク名 declared as external, but could not be found
「could not be found」・・あれ、ネットワークってアップデートで消えるっけ?
network *** declared as external, but could not be foundエラーの対策
$ docker network create ネットワーク名
94e22c6998b77e55944db7c4f41b6acf48efa366bf4abe224ff574510
でネットワークを再作成すればOK
/wp-json/contact-form-7/v1/contact-forms/{postId}/feedback
フォームの送信先はAjaxでここにアクセスしてた。
ここで作成されたカスタムエンドポイント
plugins/contact-form-7/includes/rest-api.php
register_rest_route( $namespace,
'/contact-forms/(?P<id>\d+)/feedback',
array(
array(
'methods' => WP_REST_Server::CREATABLE,
'callback' => 'wpcf7_rest_create_feedback',
'permission_callback' => '__return_true',
),
)
);
function wpcf7_rest_create_feedback( WP_REST_Request $request ) {
$url_params = $request->get_url_params();
$item = null;
if ( ! empty( $url_params['id'] ) ) {
$item = wpcf7_contact_form( $url_params['id'] );
}
if ( ! $item ) {
return new WP_Error( 'wpcf7_not_found',
__( "The requested contact form was not found.", 'contact-form-7' ),
array( 'status' => 404 )
);
}
$result = $item->submit();
$unit_tag = $request->get_param( '_wpcf7_unit_tag' );
$response = array(
'into' => '#' . wpcf7_sanitize_unit_tag( $unit_tag ),
'status' => $result['status'],
'message' => $result['message'],
'posted_data_hash' => $result['posted_data_hash'],
);
wpcf7_contact_formで取得したインスタンスのsubmitを実行してるので中身をみる
contact-form.php
public function submit( $args = '' ) {
$args = wp_parse_args( $args, array(
'skip_mail' =>
( $this->in_demo_mode()
|| $this->is_true( 'skip_mail' )
|| ! empty( $this->skip_mail ) ),
) );
if ( $this->is_true( 'subscribers_only' )
and ! current_user_can( 'wpcf7_submit', $this->id() ) ) {
$result = array(
'contact_form_id' => $this->id(),
'status' => 'error',
'message' => __(
"This contact form is available only for logged in users.",
'contact-form-7'
),
);
return $result;
}
$submission = WPCF7_Submission::get_instance( $this, array(
'skip_mail' => $args['skip_mail'],
) );
$result = array(
'contact_form_id' => $this->id(),
'status' => $submission->get_status(),
'message' => $submission->get_response(),
'demo_mode' => $this->in_demo_mode(),
);
if ( $submission->is( 'validation_failed' ) ) {
$result['invalid_fields'] = $submission->get_invalid_fields();
}
switch ( $submission->get_status() ) {
case 'init':
case 'validation_failed':
case 'acceptance_missing':
case 'spam':
$result['posted_data_hash'] = '';
break;
default:
$result['posted_data_hash'] = $submission->get_posted_data_hash();
break;
}
do_action( 'wpcf7_submit', $this, $result );
return $result;
}
ahamoにdocomoのギガホから変更しようと思ったら、「料金明細サービス」の設定状態が原因で手続きができませんでした。
「現在のご契約状態ではahamoへのプラン変更ができません。」
「料金明細サービス 明細内訳表示設定(WORLD WING) 下4桁を除き表示■料金明細サービス明細内訳表示設定(WORLD WING):「下4桁を除き表示」から「全桁表示(すべて表示)」への設定変更をお願いします」
そんな設定した覚えがなく、WORLD WINGも加入はしてるけどってレベルなので調べました。
現在のご契約状態ではahamoへのプラン変更ができません。
以下の項目をご確認いただき、各サービスの申込/廃止/設定変更等のお手続きを実施いただいた後、ahamoへのプラン変更をお申込みください。
サービスの申込/廃止/変更については、My docomo、ドコモインフォメーションセンター(局番なし151)、お近くのドコモショップにてお手続きが可能です。
※dアカウントの発行、dポイントクラブ入会、オンライン発行dポイントカード発行/登録がお済みでない方は、お手続きをお願いします。
※ahamoへのプラン変更時の「事前に必要なお手続き」について詳しくはコチラ
■料金明細サービス
明細内訳表示設定(WORLD WING):「下4桁を除き表示」から「全桁表示(すべて表示)」への設定変更をお願いします
WORLD WINGの下4桁を除き表示なんて設定したっけ?というくらい忘れてる項目でどこから変えるかもわからない。。
確かにDocomoの契約変更から見ると「WORLD WING」は契約中で料金明細の表示区分は下4桁を除き表示ってなってるけど、お手続き内容に「国際ローミングサービス( WORDL WING)を解約する」しかない。。
どこから設定変更するんだろう。
ahamoだと「WORLD WING Wi-Fi」が使えないこととローミングできる国が少ないのは知ってるけど、明細の表示とかどうでもよくない?
151のWORDLWING窓口でmydocomoを見ながら教えていただいたんですが、WORDLWINGは契約中だけど、WORDLWING料金明細サービスは未契約でした。
ちなみに下4桁を除き表示はデフォルト設定らしく、ローミング中に電話した相手の電話番号を明細にどう表示するか?の設定らしいです。
自分の場合はWORDLWING料金明細サービスは未契約なので、WORDLWINGの設定変更とかじゃなく、ahamo側の問題ということで電話を回してもらえました。
自分の場合、料金明細サービスに申し込んでいなかったので、エラーだったのですが、「明細内訳表示設定(WORLD WING):「下4桁を除き表示」から「全桁表示(すべて表示)」への設定変更をお願いします」という表示になってしまっているとのことでした。
申込はmydocomoから行えて、申し込み後すぐに適用されます。
申込後、設定を見てみると契約中となって、表示区分も全桁表示になっていました。
下4桁表示がデフォルトって言われてたけど。。未契約状態の表示のことなのかな。
これでahamoでエラーがでなくなりました。
Redashのソースコードを修正する必要がでたのでredash(v9)をdocker-composeで起動した際にbuildでエラーが発生したので修正
rsion is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of atsd-client to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r requirements_all_ds.txt (line 12), -r requirements_all_ds.txt (line 21) and -r requirements_all_ds.txt (line 34) because these package versions have conflicting dependencies.
The conflict is caused by:
atsd-client 3.0.5 depends on python-dateutil
azure-kusto-data 0.0.35 depends on python-dateutil>=2.8.0
dql 0.5.26 depends on python-dateutil<2.7.0
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
ERROR: Service 'server' failed to build : The command '/bin/sh -c if [ "x$skip_ds_deps" = "x" ] ; then pip install -r requirements_all_ds.txt ; else echo "Skipping pip install -r requirements_all_ds.txt" ; fi' returned a non-zero code: 1
rsion is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of atsd-client to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r requirements_all_ds.txt (line 20) and mysqlclient==1.3.14 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
The conflict is caused by:
The user requested mysqlclient==1.3.14
memsql 3.0.0 depends on mysqlclient==1.3.13
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: Service 'server' failed to build : The command '/bin/sh -c if [ "x$skip_ds_deps" = "x" ] ; then pip install -r requirements_all_ds.txt ; else echo "Skipping pip install -r requirements_all_ds.txt" ; fi' returned a non-zero code: 1
rc211v-linough:redash-9.0.0-beta yuta_takehira$ docker-com
requirements_all_ds.txtの2箇所をコマンとアウトして再実行すれば起動できました。
memsqlとdqlです。
google-api-python-client==1.7.11
gspread==3.1.0
impyla==0.16.0
influxdb==5.2.3
mysqlclient==1.3.14
oauth2client==4.1.3
pyhive==0.6.1
pymongo[tls,srv]==3.9.0
vertica-python==0.9.5
td-client==1.0.0
pymssql==2.1.4
#dql==0.5.26
dynamo3==0.4.10
boto3>=1.10.0,<1.11.0
botocore>=1.13,<1.14.0
sasl>=0.1.3
thrift>=0.8.0
thrift_sasl>=0.1.0
cassandra-driver==3.21.0
#memsql==3.0.0
atsd_client==3.0.5
simple_salesforce==0.74.3
PyAthena>=1.5.0
pymapd==0.19.0
qds-sdk>=1.9.6
ibm-db>=2.0.9
pydruid==0.5.7
requests_aws_sign==0.1.5
snowflake-connector-python==2.1.3
phoenixdb==0.7
# certifi is needed to support MongoDB and SSL:
certifi>=2019.9.11
pydgraph==2.0.2
azure-kusto-data==0.0.35
pyexasol==0.12.0
python-rapidjson==0.8.0
pyodbc==4.0.28
ElectronでGoogleSpreadSheetやGoogleDriveからデータを取得して、文字列の一致判定で濁点が含まれる文字の場合、見た目は同じだけど別の文字として判定されてしまうケースが出てしまった。
ElectronからGoogle SpreadSheetに結果を出力すると、確かに見た目は一緒だけど、SpreadSheetの文字検索でも一致とはならないし、コピーしてVSCodeやSublimeでテキスト検索を試しても別の文字として判定される。
試しにjsで試すとこんな感じ
Welcome to Node.js v15.4.0.
Type ".help" for more information.
> let a = 'ジ'
undefined
> let b = 'ジ'
undefined
> a == b
false
調べてみると、UTFとSJISとかのい問題ではなく、UTFの中でも濁点ありには複数あって、濁点を含んだ文字か、濁点が追加された文字か?の違いだった。
escapeでコードを確認すると「し」の濁点ありでも、コードも長さも異なる。
> escape(a)
'%u30B8'
> escape(b)
'%u30B7%u3099'
> a.length
1
> b.length
2
これはstring.normalizeで統一することができるようで、NFCとNFDを指定することで任意の型式に変換できる。
今回はSpreadSheetやDriveからの文字取得時にはNFCに統一する型式にして回避
> escape(a.normalize('NFC'))
'%u30B8'
> escape(b.normalize('NFC'))
'%u30B8'
> escape(a.normalize('NFD'))
'%u30B7%u3099'
> escape(b.normalize('NFD'))
'%u30B7%u3099'
rc211v-mbp:backend ros2$ php artisan migrate
Migrating: 2020_12_07_191937_add_provider_users_table
Error
Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found
at vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php:89
85▕ * @return \Doctrine\DBAL\Driver\PDOMySql\Driver
86▕ */
87▕ protected function getDoctrineDriver()
88▕ {
➜ 89▕ return new DoctrineDriver;
90▕ }
91▕ }
92▕
+8 vendor frames
9 database/migrations/2020_12_07_191937_add_oauth_users_table.php:22
Illuminate\Support\Facades\Facade::__callStatic("table")
+22 vendor frames
32 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
タイトルの通り、doctrine/dbalをインストールしても「Doctrine\DBAL\Driver\PDOMySql\Driver」エラーが発生して、「Doctrine\DBAL\Driver\PDOMySql\Driver」で検索すると「composer require doctrine/dbal」が必要という記事がよく見つかります。
「composer require doctrine/dbal」は成功しています。
Using version ^3.0 for doctrine/dbal
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: laravel/ui
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: rcrowe/twigbridge
Package manifest generated successfully.
78 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
ですがファイル「Doctrine\DBAL\Driver\PDOMySql\Driver」はvendorにないので、どうやらバージョンが不一致のようです。
バージョン指定なしでインストールして「3.0」が入っていましたが、Githubで2系の情報をみると、「Doctrine\DBAL\Driver\PDOMySql\Driver」があるので、Laravelのマイグレーションでは2系をインストールする必要があります。
composer require "doctrine/dbal:2.*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
- Installing doctrine/event-manager (1.1.1): Loading from cache
- Installing doctrine/cache (1.10.2): Loading from cache
- Installing doctrine/dbal (2.12.1): Downloading (100%)
doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)
2系をインストール後にmigrateを実行すると成功!
$ php artisan migrate
Migrating: 2020_12_07_191937_add_provider_users_table
Migrated: 2020_12_07_191937_add_provider_users_table (230.26ms)
LINE BOTでFlexメッセージなどをテストする必要があり、最新版のline-bot-sdkを別ディレクトリにcomposerでインストールしようとしたところエラーとなりました。
以前はさくらのレンタルサーバーでもcomposer でLINE BOT SDKがインストールできましたが、下記のエラーでLine-bot-sdkのインストールに失敗。。
Using version ^4.5 for linecorp/line-bot-sdk
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for linecorp/line-bot-sdk ^4.5 -> satisfiable by linecorp/line-bot-sdk[4.5.0].
- linecorp/line-bot-sdk 4.5.0 requires ext-sockets * -> the requested PHP extension sockets is missing from your system.
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/php/7.4/etc/php.ini
- /usr/local/php/7.4/etc/conf.d/apcu.ini
- /usr/local/php/7.4/etc/conf.d/mcrypt.ini
- /usr/local/php/7.4/etc/conf.d/opcache.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, deleting ./composer.json.
エラーはext-socketsがphpで有効になっていない為で、ext-socketsはLINE SDKのcomposer.jsonを見ると最近のアップデートでrequireにext-soketsが追加されていました。
"require": {
"php": ">=5.5",
"ext-curl": "*",
"ext-json": "*",
"ext-sockets": "*"
},
ext-socketsはさくらのレンタルサーバーのphp.iniではコメントアウトされています。
自分用のphp.iniにモジュールを追加すればいいかと思いましたが、そもそもさくらレンタルサーバーのPHPのエクステンションにはsockets.soは入っていません。
cat /usr/local/php/7.4/etc/php.ini | grep socket
; Default timeout for socket based streams (seconds)
; http://php.net/default-socket-timeout
default_socket_timeout = 60
;extension=sockets
$ ll /usr/local/php/7.4/lib/php/extensions/no-debug-non-zts-20190902/
total 2348
-rw-r--r-- 1 root wheel 124476 Aug 7 09:14 apcu.so
-rw-r--r-- 1 root wheel 595997 Aug 7 09:13 imagick.so
-rw-r--r-- 1 root wheel 61009 Aug 7 09:14 mcrypt.so
-rw-r--r-- 1 root wheel 312644 Aug 7 09:13 oauth.so
-rwxr-xr-x 1 root wheel 1185945 Aug 7 09:12 opcache.so
php-configで確認するとさくらレンタルサーバーのPHP7.4.9ではSocketは指定されていないので、sockets.soを自前で準備する必要があります。
--configure-options [--prefix=/usr/local/php/7.4 --mandir=/usr/local/php/7.4/man --with-config-file-path=/usr/local/php/7.4/etc --with-config-file-scan-dir=/usr/local/php/7.4/etc/conf.d --with-apxs2=/usr/local/apache/bin/apxs --with-openssl --with-zlib --with-curl --enable-exif --enable-gd --with-jpeg --with-webp --with-freetype --with-gettext --with-gmp --with-iconv-dir=/usr/local --enable-intl --enable-mbstring --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-snmp --enable-soap --with-xsl --enable-opcache --with-zip --enable-ftp --with-pear OPENSSL_CFLAGS=-I/usr/include OPENSSL_LIBS=-L/usr/lib -lssl -lcrypto]
まずは、同じバージョンのPHPのソースを落として、解凍したphpのソースディレクトリ内のext内にあるsocketsディレクトリ でビルドを行い、sockets.soを自分のphp.iniで指定します。
$ php -v
PHP 7.4.9 (cli) (built: Aug 7 2020 09:12:44) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.9, Copyright (c), by Zend Technologies
$ wget https://github.com/php/php-src/archive/php-7.4.9.zip
解凍して
$cd ./php-src-php-7.4.9/ext/sockets/
$phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
$./configure --prefix=/home/○○/php_modules/
$ make
cp ./.libs/sockets.so /home/〇〇/php-src-php-7.4.9/ext/sockets/modules/sockets.so
cp ./.libs/sockets.lai /home/〇〇/php-src-php-7.4.9/ext/sockets/modules/sockets.la
出来上がった、sockets.soとsockets.laiを自分のphp.iniで指定して、aliasでphp.iniを読み込む様に変更してから、下記のコマンでインストールが成功
$ alias php='/usr/local/bin/php -c /home/〇〇/www/php.ini'
$ php ~/bin/composer.phar require linecorp/line-bot-sdk
PHP Warning: PHP Startup: mailparse: Unable to initialize module
Module compiled with module API=20170718
PHP compiled with module API=20190902
These options need to match
in Unknown on line 0
Using version ^4.5 for linecorp/line-bot-sdk
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing linecorp/line-bot-sdk (4.5.0): Downloading (100%)
linecorp/line-bot-sdk suggests installing apigen/apigen (Install with roave/better-reflection:dev-master to generate docs)
linecorp/line-bot-sdk suggests installing roave/better-reflection (Required by apigen/apigen:dev-master)
Package oscarotero/psr7-middlewares is abandoned, you should avoid using it. Use middlewares/* instead.
Writing lock file
Generating autoload files