Hasura Console のバグ調査ログ
業務で Hasura のバグを引いたので修正してみる!
修正対象はこちら
one-off scheduled events を console から作ると、payload の JSON が文字列化されてしまうというバグ。あんまよくわかってないけど、JSON.parse
してあげればいいんでしょ、という感じがするので手軽そう。
Hasura Console の説明に目を通す。
まずは Hasura Console をローカルで立ち上げたい
依存関係のインストールのために npm run deps
を実行しろと書いてあるが、deps
なんてコマンドはなさそう・・・情報が古いのかな。とりあえず npm install
してみる。
npm install 実行ログ
67 vulnerabilities (3 low, 7 moderate, 55 high, 2 critical)
って出てるが大丈夫なのか...?
$ npm install
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated redux-devtools-instrument@1.10.0: Package moved to @redux-devtools/instrument.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated redux-devtools@3.7.0: Package moved to @redux-devtools/core.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @types/reselect@2.2.0: This is a stub types definition for reselect (https://github.com/rackt/reselect). reselect provides its own type definitions, so you don't need @types/reselect installed!
npm WARN deprecated @types/react-youtube@7.10.0: This is a stub types definition. react-youtube provides its own type definitions, so you do not need this installed.
npm WARN deprecated @types/react-hot-loader@4.1.1: This is a stub types definition. react-hot-loader provides its own type definitions, so you do not need this installed.
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated @types/dotenv@8.2.0: This is a stub types definition. dotenv provides its own type definitions, so you do not need this installed.
npm WARN deprecated @types/clean-webpack-plugin@0.1.3: This is a stub types definition. clean-webpack-plugin provides its own type definitions, so you do not need this installed.
npm WARN deprecated @types/anymatch@3.0.0: This is a stub types definition. anymatch provides its own type definitions, so you do not need this installed.
npm WARN deprecated @types/fork-ts-checker-webpack-plugin@0.4.5: This is a stub types definition. fork-ts-checker-webpack-plugin provides its own type definitions, so you do not need this installed.
npm WARN deprecated subscriptions-transport-ws@0.9.16: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated @material-ui/system@3.0.0-alpha.2: You can now upgrade to @mui/system. See the guide: https://mui.com/guides/migration-v4/
npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated viz.js@2.1.2: no longer supported
npm WARN deprecated highlight.js@9.15.8: Version no longer supported. Upgrade to @latest
npm WARN deprecated core-js@1.2.7: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated @material-ui/core@3.9.4: You can now upgrade to @mui/material. See the guide: https://mui.com/guides/migration-v4/
added 3945 packages, and audited 3946 packages in 5m
339 packages are looking for funding
run `npm fund` for details
67 vulnerabilities (3 low, 7 moderate, 55 high, 2 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
server
モード、cli
モードの2種類開発方法があるらしい。マイグレーションとかメタデータの更新関連は cli
モード、それ以外は server
モードで開発してくれとのこと。今回はマイグレーションは関係ないので server
モードで開発する。
.env
をサンプルからコピって npm run dev
してみる。
$ npm run dev
> @hasura/console-oss@1.0.0 dev
> TAILWIND_MODE=watch webpack serve --config ./webpack/dev.config.js
Starting type checking service...
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:3000/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.11.14:3000/
<i> [webpack-dev-server] Content not from webpack is served from '/Users/XXX/graphql-engine/console/public' directory
<i> [webpack-dev-server] 404s will fallback to '/index.html'
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (/Users/XXX/graphql-engine/console/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/Users/XXX/graphql-engine/console/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/Users/XXX/graphql-engine/console/node_modules/webpack/lib/NormalModule.js:471:10)
at /Users/XXX/graphql-engine/console/node_modules/webpack/lib/NormalModule.js:503:5
at /Users/XXX/graphql-engine/console/node_modules/webpack/lib/NormalModule.js:358:12
at /Users/XXX/graphql-engine/console/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/Users/XXX/graphql-engine/console/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/Users/XXX/graphql-engine/console/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
node:internal/crypto/hash:71
this[kHandle] = new _Hash(algorithm, xofLen);
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (/Users/XXX/graphql-engine/console/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/Users/XXX/graphql-engine/console/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/Users/XXX/graphql-engine/console/node_modules/webpack/lib/NormalModule.js:471:10)
at /Users/XXX/graphql-engine/console/node_modules/webpack/lib/NormalModule.js:503:5
at /Users/XXX/graphql-engine/console/node_modules/webpack/lib/NormalModule.js:358:12
at /Users/XXX/graphql-engine/console/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/Users/XXX/graphql-engine/console/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/Users/XXX/graphql-engine/console/node_modules/loader-runner/lib/LoaderRunner.js:221:10) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v18.12.1
だめだった。node のバージョンかな。v12+
って書いてあったから v18 系でもいけるかもとおもったが。
~いったん 12 系に落としてみるか。~
.nvmrc があったのでそこに記載されているバージョンにしてみる
$ nodebrew install v16.15.1
$ nodebrew use v16.15.1
$ node -v
v16.15.1
node_modules を全消しして再度 npm install
する
npm run dev
してしばらく待つとなんか立ち上がったっぽい感じ。いっぱい WARNING が出てるが一旦スルー
立ち上がったが Error: Unmanaged console type "undefined"
って言われる
console type とやらが渡されてないらしい
あ、これか。
見てたドキュメントのバージョンがちょっと古かった。むっちゃコンソールエラー出てるけどなんとか立ち上がった。
ん!?最新の master ブランチだと直ってる!??
2.17.0 から修正されてるっぽい?
Minor enhancements to the one-off scheduled trigger form on the console. As a result of the change, placement of few fields have changed including that of comment/description.
https://github.com/hasura/graphql-engine/releases/tag/v2.17.0-beta.1
ここでしれっと直されてる説。
コミットならず。。。
まだ issue が Open されてたから直されてないものだと勝手に思ってた〜
次からちゃんと最新版確認するようにしよう