診断
pw doctor は、検査項目ごとに PW0412 のような識別子を付けて結果を報告します。
この識別子は変更も再利用もされないため、検索や issue での参照、この一覧からの
対処方法の確認に使えます。
診断結果の深刻度は、対象環境によって決まります。pw doctor --env=prod は、
同じファイルでも pw doctor --env=dev より厳しく検査します。対象外の環境にしか
関係しない項目は、深刻度を下げて表示するのではなく、結果に表示しません。
このページはチェックカタログから生成されています。チェックを追加すれば、その項目もここに 増えます。項目名と直し方が英語のままなのは、それがターミナルに出る文字列そのものだからです。
プロジェクトとツールチェイン (PW01xx)
Section titled “プロジェクトとツールチェイン (PW01xx)”プロジェクトが宣言した形、ツールチェイン、生成物の三つが、まだ互いに一致しているかどうか。
PW0101: project.main does not name a main package
Section titled “PW0101: project.main does not name a main package”- 深刻度: error
- 対象: すべての環境
- 読むもの: プロジェクトのファイル
- 直し方: point project.main at the directory holding func main, or scaffold one with pw new
PW0102: migration directory is missing
Section titled “PW0102: migration directory is missing”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定、プロジェクトのファイル
- 直し方: run pw add database, which writes the directory and its starter schema
PW0110: generated file outlived its source
Section titled “PW0110: generated file outlived its source”- 深刻度: error
- 対象: すべての環境
- 読むもの: プロジェクトのファイル
- 直し方: delete the generated file
PW0111: generated file is older than its source
Section titled “PW0111: generated file is older than its source”- 深刻度: warning
- 対象: すべての環境
- 読むもの: プロジェクトのファイル
- 直し方: run pw generate
PW0113: generated sources are neither committed nor ignored
Section titled “PW0113: generated sources are neither committed nor ignored”- 深刻度: note
- 対象: すべての環境
- 読むもの: プロジェクトのファイル
- 直し方: commit *_pw_gen.go or add it to .gitignore, so the project says once which it is
PW0120: devbox Go version disagrees with the go.mod directive
Section titled “PW0120: devbox Go version disagrees with the go.mod directive”- 深刻度: warning
- 対象: すべての環境
- 読むもの: プロジェクトのファイル
- 直し方: align devbox.json with the go directive, so the shell build and the CI build are one build
PW0121: pinned TinyGo is below the supported baseline
Section titled “PW0121: pinned TinyGo is below the supported baseline”- 深刻度: error
- 対象: すべての環境
- 読むもの: プロジェクトのファイル
- 直し方: pin tinygo 0.42 or newer in devbox.json
PW0122: running outside the devbox shell
Section titled “PW0122: running outside the devbox shell”- 深刻度: note
- 対象: すべての環境
- 読むもの: プロジェクトのファイル、プロセス環境変数
- 直し方: run devbox shell, so the tools pw dev expects are on PATH
PW0123: configuration selects a service devbox does not declare
Section titled “PW0123: configuration selects a service devbox does not declare”- 深刻度: warning
- 対象: すべての環境
- 読むもの: マージ済み設定、プロジェクトのファイル
- 直し方: run pw add redis-valkey
PW0124: Tailwind is enabled without its toolchain or entry point
Section titled “PW0124: Tailwind is enabled without its toolchain or entry point”- 深刻度: error
- 対象: すべての環境
- 読むもの: プロジェクトのファイル
- 直し方: run pw add tailwind, or create the configured CSS entry point
PW0125: the configured port is already in use
Section titled “PW0125: the configured port is already in use”- 深刻度: warning
- 対象:
devのみ - 読むもの: マージ済み設定
- 直し方: stop the process holding it, or set server.port
PW0130: a public file’s content does not match its extension
Section titled “PW0130: a public file’s content does not match its extension”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定、プロジェクトのファイル
- 直し方: rename the file to the type it actually is, or list the path in assets.verify.allow
PW0131: a public SVG carries executable content
Section titled “PW0131: a public SVG carries executable content”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定、プロジェクトのファイル
- 直し方: remove the script, or list the path in assets.verify.allow when the SVG is interactive on purpose
PW0132: a large media file is compiled into the binary
Section titled “PW0132: a large media file is compiled into the binary”- 深刻度: warning
- 対象: すべての環境
- 読むもの: プロジェクトのファイル
- 直し方: move it to public-external/, which ships beside the binary instead of inside it
PW0140: a declared package is not in the module graph
Section titled “PW0140: a declared package is not in the module graph”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定、プロジェクトのファイル
- 直し方: run go get for the module, then pw generate before go mod tidy — tidy drops a declaration nothing imports yet
PW0141: a linked module publishes a package this project never declared
Section titled “PW0141: a linked module publishes a package this project never declared”- 深刻度: warning
- 対象: すべての環境
- 読むもの: マージ済み設定、プロジェクトのファイル
- 直し方: declare it in packages if the project uses it, or leave it as the ordinary dependency it is
PW0143: a declared package was generated by a newer Popcorn Web
Section titled “PW0143: a declared package was generated by a newer Popcorn Web”- 深刻度: warning
- 対象: すべての環境
- 読むもの: マージ済み設定、プロジェクトのファイル
- 直し方: upgrade this project’s Popcorn Web, or pin the package to a version generated against it
PW0144: a declared package has no Go package at its import path
Section titled “PW0144: a declared package has no Go package at its import path”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定、プロジェクトのファイル
- 直し方: the package’s manifest needs package.import naming the path that holds its Go, unless the module root holds it
ルートとテンプレート (PW02xx)
Section titled “ルートとテンプレート (PW02xx)”衝突するパスと、誰も応答しないパスについてルート表が語ること。これらには pw generate がまだ出力しないルート表が必要なので、pw doctor は「検査していない」と報告します。
PW0201: two registrations share one route pattern
Section titled “PW0201: two registrations share one route pattern”- 深刻度: error
- 対象: すべての環境
- 読むもの: ルート表
- 直し方: remove one registration
PW0202: an application route collides with an enabled framework mount
Section titled “PW0202: an application route collides with an enabled framework mount”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定、ルート表
- 直し方: move the route, or disable the mount with its configuration key
PW0203: a route registration the analysis could not read a pattern from
Section titled “PW0203: a route registration the analysis could not read a pattern from”- 深刻度: note
- 対象: すべての環境
- 読むもの: ルート表
- 直し方: register a literal method-and-path pattern, per rule:static-route-discovery
ストレージ (PW03xx)
Section titled “ストレージ (PW03xx)”マイグレーションのソースが妥当かどうか。--online ではさらに、データベースがまだそれと一致しているかどうか。
PW0301: two migrations share one version
Section titled “PW0301: two migrations share one version”- 深刻度: error
- 対象: すべての環境
- 読むもの: プロジェクトのファイル
- 直し方: renumber the newer file; never renumber one already applied
PW0302: the migration version sequence has a gap
Section titled “PW0302: the migration version sequence has a gap”- 深刻度: note
- 対象: すべての環境
- 読むもの: プロジェクトのファイル
- 直し方: no action required
PW0304: the local database path is not writable
Section titled “PW0304: the local database path is not writable”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定、プロジェクトのファイル
- 直し方: create the parent directory, or point the DSN elsewhere
PW0310: the applied migration state was not read
Section titled “PW0310: the applied migration state was not read”- 深刻度: note
- 対象: すべての環境
- 読むもの: マージ済み設定
- 直し方: run pw doctor –online, or pw migrate status
PW0311: a configured database connection was refused
Section titled “PW0311: a configured database connection was refused”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定、ネットワーク
- 直し方: check the DSN, the server, and the network path
PW0312: the database is behind the migration sources
Section titled “PW0312: the database is behind the migration sources”- 深刻度: warning
- 対象: すべての環境
- 読むもの: マージ済み設定、ネットワーク
- 直し方: run pw migrate up
設定・シークレット・認証プロバイダ (PW04xx)
Section titled “設定・シークレット・認証プロバイダ (PW04xx)”ここで壊れるものは三つあります。バイナリが実際には持っていない配線、診断対象の環境には勧められない値、そして置き場所を間違えたシークレットです。
PW0401: selected session backend is not linked
Section titled “PW0401: selected session backend is not linked”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定、import グラフ
- 直し方: add the blank import of the backend plugin
PW0402: no database/sql driver answers the configured DSN scheme
Section titled “PW0402: no database/sql driver answers the configured DSN scheme”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定、import グラフ
- 直し方: add the blank import of the driver package for that scheme
PW0403: configured key belongs to no linked binding
Section titled “PW0403: configured key belongs to no linked binding”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定、import グラフ
- 直し方: import the plugin that owns the key, or correct the key
PW0404: the development identity provider is linked into the application
Section titled “PW0404: the development identity provider is linked into the application”- 深刻度: error
- 対象: すべての環境
- 読むもの: import グラフ
- 直し方: remove the contrib/devidp import; pw dev runs it as a separate process
PW0405: a linked plugin is selected by no configuration
Section titled “PW0405: a linked plugin is selected by no configuration”- 深刻度: note
- 対象: すべての環境
- 読むもの: マージ済み設定、import グラフ
- 直し方: drop the import, or select it in configuration
PW0406: a TinyGo project registers no Netdev
Section titled “PW0406: a TinyGo project registers no Netdev”- 深刻度: error
- 対象: すべての環境
- 読むもの: プロジェクトのファイル
- 直し方: restore tinygohelper.go with the tinygodriver/netdev blank import
PW0407: authentication is enabled without a session store
Section titled “PW0407: authentication is enabled without a session store”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定
- 直し方: enable session, whose rdb backend holds the login session
PW0408: the session store reuses a database middleware that is off
Section titled “PW0408: the session store reuses a database middleware that is off”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定
- 直し方: enable middleware.rdb, or give the session a dedicated source
PW0409: a framework-owned write resolves to a readonly group
Section titled “PW0409: a framework-owned write resolves to a readonly group”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定
- 直し方: name a writable group in middleware.rdb.write_group
PW0410: the session cookie is not marked secure
Section titled “PW0410: the session cookie is not marked secure”- 深刻度: error
- 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: set session.cookie.secure; false is a development-only exception, and the process refuses to start with it outside dev
PW0411: browser response headers are disabled
Section titled “PW0411: browser response headers are disabled”- 深刻度: warning(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: enable security.headers
PW0412: a secret is set from the configuration file
Section titled “PW0412: a secret is set from the configuration file”- 深刻度: error
- 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定、プロジェクトのファイル
- 直し方: move the value to an environment variable, or reference one with ${NAME}
PW0413: a secret still holds a scaffolded or placeholder value
Section titled “PW0413: a secret still holds a scaffolded or placeholder value”- 深刻度: error(
devでは warning) - 対象: すべての環境
- 読むもの: マージ済み設定
- 直し方: replace it; a scaffold value is published in the framework source
PW0414: one secret value is shared between environments
Section titled “PW0414: one secret value is shared between environments”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定、他環境の設定
- 直し方: give each environment its own value
PW0415: a file holding a secret is tracked by version control
Section titled “PW0415: a file holding a secret is tracked by version control”- 深刻度: error
- 対象:
dev以外のすべての環境 - 読むもの: プロジェクトのファイル
- 直し方: untrack the file and read the value from the environment instead
PW0416: a file holding a secret is readable beyond its owner
Section titled “PW0416: a file holding a secret is readable beyond its owner”- 深刻度: warning
- 対象:
dev以外のすべての環境 - 読むもの: プロジェクトのファイル
- 直し方: chmod 600 the file
PW0417: a credentialed cross-origin caller is not trusted by the CSRF check
Section titled “PW0417: a credentialed cross-origin caller is not trusted by the CSRF check”- 深刻度: warning
- 対象: すべての環境
- 読むもの: マージ済み設定
- 直し方: add each security.cors.allowed_origins entry to security.csrf.trusted_origins while allow_credentials is on
PW0418: a plain-http origin is admitted
Section titled “PW0418: a plain-http origin is admitted”- 深刻度: warning(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: name https origins in security.cors.allowed_origins outside development
PW0420: query diagnostics are enabled outside dev
Section titled “PW0420: query diagnostics are enabled outside dev”- 深刻度: warning(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: set observability.query.enabled to off
PW0421: query bind values are logged outside dev
Section titled “PW0421: query bind values are logged outside dev”- 深刻度: warning(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: set observability.query.bind_values to off
PW0422: the log level is below info outside dev
Section titled “PW0422: the log level is below info outside dev”- 深刻度: warning(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: set observability.minimum_level to info or higher
PW0423: an in-memory database is configured outside dev
Section titled “PW0423: an in-memory database is configured outside dev”- 深刻度: warning(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: point the DSN at a durable database; the schema and every row are lost at restart
PW0424: public assets are served from the local filesystem outside dev
Section titled “PW0424: public assets are served from the local filesystem outside dev”- 深刻度: warning(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: set server.public.read_local to false; pw dev forces it on its own
PW0426: logs are plaintext outside dev
Section titled “PW0426: logs are plaintext outside dev”- 深刻度: note
- 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: set observability.stdout_format to json for a log collector
PW0427: telemetry export is disabled outside dev
Section titled “PW0427: telemetry export is disabled outside dev”- 深刻度: note
- 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: set observability.otel.endpoint to export traces and logs
PW0430: the development identity provider is enabled outside dev
Section titled “PW0430: the development identity provider is enabled outside dev”- 深刻度: error(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: プロジェクトのファイル
- 直し方: set dev.idp.enabled to false; it authenticates nobody
PW0431: the OIDC issuer is a development one outside dev
Section titled “PW0431: the OIDC issuer is a development one outside dev”- 深刻度: error(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: set auth.oidc.issuer to the deployment provider
PW0432: the OIDC issuer is reached over http outside dev
Section titled “PW0432: the OIDC issuer is reached over http outside dev”- 深刻度: error(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: use an https issuer and clear auth.oidc.allow_loopback_http
PW0433: the OIDC redirect URL does not match the callback path
Section titled “PW0433: the OIDC redirect URL does not match the callback path”- 深刻度: error
- 対象: すべての環境
- 読むもの: マージ済み設定
- 直し方: make auth.oidc.redirect_url end with auth.callback_path
PW0434: no provider values are declared for a deployed environment
Section titled “PW0434: no provider values are declared for a deployed environment”- 深刻度: note
- 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定、プロセス環境変数
- 直し方: confirm the deployment sets AUTH_OIDC_ISSUER, AUTH_OIDC_CLIENT_ID, and AUTH_OIDC_CLIENT_SECRET
PW0436: the loopback development pairing is still set outside dev
Section titled “PW0436: the loopback development pairing is still set outside dev”- 深刻度: error(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: clear auth.oidc.allow_loopback_http and set session.cookie.secure
PW0437: the OIDC redirect URL is derived from a request outside dev
Section titled “PW0437: the OIDC redirect URL is derived from a request outside dev”- 深刻度: error(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: set auth.oidc.redirect_url to the absolute URL registered with the deployed provider
本番前チェック (PW05xx)
Section titled “本番前チェック (PW05xx)”公開前のチェックリストを、読むものではなく走らせるものにしたもの。診断対象が dev のあいだは何も言いません。
PW0501: the API documentation endpoint is exposed
Section titled “PW0501: the API documentation endpoint is exposed”- 深刻度: warning(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: clear server.api_doc unless the exposure is intended
PW0502: Tailwind output is not minified
Section titled “PW0502: Tailwind output is not minified”- 深刻度: warning(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: プロジェクトのファイル
- 直し方: set assets.tailwind.minify
PW0503: the generated stylesheet is older than its sources
Section titled “PW0503: the generated stylesheet is older than its sources”- 深刻度: error(
devでは warning) - 対象:
dev以外のすべての環境 - 読むもの: プロジェクトのファイル
- 直し方: run pw build, which rebuilds the stylesheet
PW0504: the built asset tree is older than what it was built from
Section titled “PW0504: the built asset tree is older than what it was built from”- 深刻度: warning(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: プロジェクトのファイル
- 直し方: run pw build, which rebuilds dist/public and its manifest
PW0505: image conversion is enabled and no encoder is installed
Section titled “PW0505: image conversion is enabled and no encoder is installed”- 深刻度: warning(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: プロジェクトのファイル
- 直し方: run pw add images, or install the encoders it pins
PW0506: the login session is stored where it cannot be revoked
Section titled “PW0506: the login session is stored where it cannot be revoked”- 深刻度: warning(
devでは note) - 対象:
dev以外のすべての環境 - 読むもの: マージ済み設定
- 直し方: set session.backend to rdb, redis, or dynamo where a logout must end a session
