Skip to content
DocsChangelogv0.7.8

Troubleshooting

This guide is designed to help if things don’t quite work as expected.

In order to uniquely identify resources on disk we need to normalise the paths to a project and the resources within them. An ID is constructed for each resource based on the following format:

@{{project-slug}}|{{workspace}}|{{resource-type}}/{{resource-name}}

The ID is then converted to a sha256 hash to ensure a valid filesystem path string that is predictable and unique. This hash is used for various internals such as log paths, service names and more.

Examples of resource IDs:

  • Project: @marcqualie/denvig#root
  • Action: @marcqualie/denvig#root|action/hello
  • Workspace + Action: @marcqualie/denvig#apps/web|action/dev

You can find the hash details for a resource with the following command:

Terminal window
denvig internals:resource-hash service/hello # Example output: abc123...
# You can also use workspace notation:
denvig internals:resource-hash "apps/web|action/dev"
# Or use the --workspace flag:
denvig internals:resource-hash action/dev --workspace apps/web
# a full ID can also be passed in:
denvig internals:resource-hash "@marcqualie/denvig#apps/web|action/dev"

You can also find the ID to verify it has been resolved correctly:

Terminal window
denvig internals:resource-id service/hello # @marcqualie/denvig#root|service/hello

Denvig uses launchctl under the hood to manage services so everything can also be interacted with directly there.

Directly list all denvig launchctl services that are currently loaded by running:

Terminal window
launchctl list | grep denvig

You can forcefully stop and remove all denvig services at once by running:

Terminal window
launchctl list | grep denvig | awk '{print $3}' | xargs -I {} -n 1 launchctl bootout gui/$(id -u)/{}
rm ~/Library/LaunchAgents/com.denvig.*

You can target a specific service by using its resource hash (detailed above):

Terminal window
launchctl bootout gui/$(id -u)/com.denvig.<resource-hash>
rm ~/Library/LaunchAgents/com.denvig.<resource-hash>.plist

All logs are stored in ~/.denvig/logs/. You can tail the logs of a specific service by running:

Terminal window
tail -f ~/.denvig/logs/<resource-hash>.log

The easiest way to follow a service’s logs is with denvig services logs <name> --follow.

Every service routed through the gateway is written into a single ~/.denvig/nginx.conf, with each server block annotated with its service and log location. Read it to see exactly which domains route where:

Terminal window
cat ~/.denvig/nginx.conf

If it doesn’t match your running services, rebuild it with denvig gateway configure.

Set DENVIG_DEBUG to record a trace of what denvig is doing. It accepts a comma-separated list of scopes, or * for all of them. The deps scope traces dependency checks, network requests, and git commands:

Terminal window
DENVIG_DEBUG=deps denvig deps outdated

Traces are written to ~/.denvig/logs/debug/traces/<date>/ (override the path with DENVIG_DEBUG_TRACE_PATH) and can be opened in https://ui.perfetto.dev.