-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Describe your changes - renamed plugins to cli reference - added docs about the stack traces - updated some dependencies - explicit utf-8 encoding, should prevent weird windows bugs, because they use `windows-1252` by default. The scantree was added as part of #112 The scandir was added along with dirhash in #89 The tests are passing locally on windows. ## Issue ticket number and link fixes #129 fixes #130 ## Checklist before requesting a review - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] If it is a core feature, I have added thorough tests.
- Loading branch information
Showing
11 changed files
with
121 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
title: Troubleshooting | ||
summary: Troubleshooting and debugging | ||
authors: | ||
- Matěj Račinský | ||
date: 2024-08-26 | ||
--- | ||
|
||
# Troubleshooting | ||
|
||
## Stack traces | ||
Wanna-ml CLI interface uses [typer](https://typer.tiangolo.com/) package and | ||
[rich](https://rich.readthedocs.io/en/latest/) for showing help, stack traces etc. | ||
|
||
By default, the wanna-ml will show verbose stack trace containing all local variables which can simplify | ||
the development, but can be too verbose sometimes, | ||
see [the docs](https://typer.tiangolo.com/tutorial/exceptions/#exceptions-with-rich) for more details. | ||
|
||
The stack trace looks something like this: | ||
|
||
``` | ||
│ │ timeout = None │ │ | ||
│ │ transcoded_request = { │ │ | ||
│ │ │ 'uri': '/compute/v1/projects/your-gcp-project-id/regions', │ │ | ||
│ │ │ 'query_params': , │ │ | ||
│ │ │ 'method': 'get' │ │ | ||
│ │ } │ │ | ||
│ │ uri = '/compute/v1/projects/your-gcp-project-id/regions' │ │ | ||
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ | ||
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ | ||
NotFound: 404 GET https://compute.googleapis.com/compute/v1/projects/your-gcp-project-id/regions: The resource 'projects/your-gcp-project-id' was not found | ||
``` | ||
|
||
If you don't like this tabular stack trace, you can disable this behavior by setting environment variable | ||
|
||
```shell | ||
export _TYPER_STANDARD_TRACEBACK=1 | ||
``` | ||
in shell, or | ||
|
||
```powershell | ||
$Env:_TYPER_STANDARD_TRACEBACK=1 | ||
``` | ||
in powershell. Then, the regular stack trace will be shown, like this: | ||
``` | ||
File "C:\Projects\others\wanna-ml\src\wanna\core\utils\validators.py", line 29, in validate_region | ||
available_regions = get_available_regions(project_id=values.get("project_id")) | ||
File "C:\Projects\others\wanna-ml\src\wanna\core\utils\gcp.py", line 228, in get_available_regions | ||
response = RegionsClient(credentials=get_credentials()).list(project=project_id) | ||
File "C:\Users\E10270\.conda\envs\wanna-ml-py310\lib\site-packages\google\cloud\compute_v1\services\regions\client.py", line 874, in list | ||
response = rpc( | ||
File "C:\Users\E10270\.conda\envs\wanna-ml-py310\lib\site-packages\google\api_core\gapic_v1\method.py", line 131, in __call__ | ||
return wrapped_func(*args, **kwargs) | ||
File "C:\Users\E10270\.conda\envs\wanna-ml-py310\lib\site-packages\google\api_core\grpc_helpers.py", line 76, in error_remapped_callable | ||
return callable_(*args, **kwargs) | ||
File "C:\Users\E10270\.conda\envs\wanna-ml-py310\lib\site-packages\google\cloud\compute_v1\services\regions\transports\rest.py", line 392, in __call__ | ||
raise core_exceptions.from_http_response(response) | ||
google.api_core.exceptions.NotFound: 404 GET https://compute.googleapis.com/compute/v1/projects/your-gcp-project-id/regions: The resource 'projects/your-gcp-project-id' was not found | ||
``` | ||
|
||
If you like the verbosity of the tabular stack trace, but it's too narrow, you can increase the width to an arbitrary number by setting the `COLUMNS` or `TERMINAL_WIDTH` environment variable, e.g.: | ||
|
||
```shell | ||
export COLUMNS=150 | ||
export TERMINAL_WIDTH=150 | ||
``` | ||
in shell, or | ||
```powershell | ||
$Env:COLUMNS=150 | ||
$Env:TERMINAL_WIDTH=150 | ||
``` | ||
|
||
Then, the stack trace will look like this: | ||
|
||
``` | ||
│ │ self = _List( │ │ | ||
│ │ │ _session=<google.auth.transport.requests.AuthorizedSession object at 0x000001F4E9CA17B0>, │ │ | ||
│ │ │ _host='https://compute.googleapis.com', │ │ | ||
│ │ │ _interceptor=<google.cloud.compute_v1.services.regions.transports.rest.RegionsRestInterceptor object at │ │ | ||
│ │ 0x000001F4E9CA15A0> │ │ | ||
│ │ ) │ │ | ||
│ │ timeout = None │ │ | ||
│ │ transcoded_request = {'uri': '/compute/v1/projects/your-gcp-project-id/regions', 'query_params': , 'method': 'get'} │ │ | ||
│ │ uri = '/compute/v1/projects/your-gcp-project-id/regions' │ │ | ||
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ | ||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ | ||
NotFound: 404 GET https://compute.googleapis.com/compute/v1/projects/your-gcp-project-id/regions: The resource 'projects/your-gcp-project-id' was not | ||
found | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters