-
Notifications
You must be signed in to change notification settings - Fork 990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add new dbt invocation command #6822
Changes from 8 commits
d180f3f
22c0bce
0d7cc61
1c46190
f2aa6f5
c062a22
d350c6c
6575c9d
76653d3
1488e39
773cb82
11d1d3a
aff173e
f3390b2
6400599
95265d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: "I'm getting a \"Session occupied\" error in dbt Cloud CLI?" | ||
description: "How to debug long-running sessions in dbt Cloud CLI" | ||
sidebar_label: 'Debug long-running sessions in dbt Cloud CLI' | ||
id: long-sessions-cloud-cli | ||
--- | ||
|
||
If you're receiving a `Session occupied` error in the dbt Cloud CLI or if you're experiencing a long-running session, you can use the `dbt invocation list` command in a separate terminal window to view the status of your active session. This helps you identify the model that's causing the long-running session and debug the issue. | ||
|
||
To cancel an active session, use the `Ctrl + Z` shortcut. | ||
|
||
To learn more about the `dbt invocation` command, see the [dbt invocation command reference](/reference/commands/invocation). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
title: "About dbt invocation command" | ||
sidebar_label: "invocation" | ||
id: invocation | ||
--- | ||
|
||
The `dbt invocation` command is available in the [dbt Cloud CLI](/docs/cloud/cloud-cli-installation) and allows you to: | ||
- List active invocations to debug long-running or hanging sessions. | ||
mirnawong1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Identify and investigate sessions causing the `Session occupied` error. | ||
- Monitor currently active dbt commands (like `run`, `build`) in real-time. | ||
|
||
The `dbt invocation` command only lists _active invocations_. If no sessions are running, the list will be empty. Completed sessions aren't included in the output. | ||
|
||
## Usage | ||
|
||
This page lists the command and flag you can use with `dbt invocation`. To use them, add a command or option like this: `dbt invocation [flag]`. | ||
mirnawong1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Available flags in the command line interface (CLI) are [`help`](#dbt-invocation-help) and [`list`](#dbt-invocation-list). | ||
|
||
### dbt invocation help | ||
|
||
The `help` command provides you with the help output for the `invocation` command in the CLI, including the available flags. | ||
|
||
```shell | ||
dbt invocation help | ||
``` | ||
|
||
or | ||
|
||
```shell | ||
dbt help invocation | ||
``` | ||
|
||
The command returns the following information: | ||
|
||
```bash | ||
dbt invocation help | ||
Manage invocations | ||
|
||
Usage: | ||
dbt invocation [command] | ||
|
||
Available Commands: | ||
list List active invocations | ||
|
||
Flags: | ||
-h, --help help for invocation | ||
|
||
Global Flags: | ||
--log-format LogFormat The log format, either json or plain. (default plain) | ||
--log-level LogLevel The log level, one of debug, info, warning, error or fatal. (default info) | ||
--no-color Disables colorization of the output. | ||
-q, --quiet Suppress all non-error logging to stdout. | ||
|
||
Use "dbt invocation [command] --help" for more information about a command. | ||
``` | ||
|
||
### dbt invocation list | ||
|
||
The `list` command provides you with a list of active invocations in your dbt Cloud CLI. When a long-running session is active, you can use this command in a separate terminal window to view the active session to help debug the issue. | ||
|
||
```shell | ||
dbt invocation list | ||
``` | ||
|
||
The command returns the following information, including the `ID`, `status`, `type`, `arguments`, and `started at` time of the active session: | ||
|
||
```bash | ||
dbt invocation list | ||
|
||
Active Invocations: | ||
ID 6dcf4723-e057-48b5-946f-a4d87e1d117a | ||
Status running | ||
Type cli | ||
Args [run --select test.sql] | ||
Started At 2025-01-24 11:03:19 | ||
|
||
➜ jaffle-shop git:(test-cli) ✗ | ||
``` | ||
|
||
:::tip | ||
|
||
To cancel an active session in the terminal, use the `Ctrl + Z` shortcut. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vfcoelho i think it'd be helpful to have a 'get out' tip when the session is hanging -- just confirming this is right? it worked for me! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, good thinking! We also have another case that the user's session invocation pool is being occupied by the vscode extension. I wonder if there is any way to cancel its invocations if needed. @dichenqiandbt would you know anything about that so we can add to the tips? |
||
|
||
::: | ||
|
||
## Related docs | ||
|
||
- [Install dbt Cloud CLI](/docs/cloud/cloud-cli-installation) | ||
- [Troubleshooting dbt Cloud CLI 'Session occupied' error](/faqs/Troubleshooting/long-sessions-cloud-cli) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hiya @mirnawong1
This is a non-blocker but would it be worth making this an expandable or the other expandables, toggles so that they follow the same flow / pattern?
Kind Regards
Natalie
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i added it as a faq so it can be fetched but maybe we can turn the other expandables in detailsToggle so its consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @nataliefiann , going to turn the rest into details toggle so they follow the sme ux