Skip to content

Commit

Permalink
Prompt user for intproxy logs. (metalbear-co#2769)
Browse files Browse the repository at this point in the history
* Prompt user for intproxy logs.

* better description in template

* improve error message

* change relevant logs name

* changelog

* fix typo
  • Loading branch information
meowjesty authored Sep 30, 2024
1 parent c2b40ef commit c1b1579
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
15 changes: 12 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,19 @@ body:
description: If your bug produces a backtrace, please include it here.
render: shell
- type: textarea
id: logs
id: layer-logs
attributes:
label: Relevant Logs
description: If possible, reproduce the bug with the envrionment variable RUST_LOG set to 'trace', and attach the printed logs
label: mirrord layer logs
description: If possible, reproduce the bug with the environment variable RUST_LOG set to 'trace', and attach the printed logs.
render: shell
- type: textarea
id: intproxy-logs
attributes:
label: Internal proxy logs
description: |
Please attach the relevant `mirrord-intproxy` logs. You can find them in your `/tmp` directory (by default).
The default log file looks like `/tmp/mirrord-intproxy-1727386366-5rqqf2x`.
You can change this default with the `internal_proxy.log_destination` mirrord config.
render: shell
- type: input
id: os_version
Expand Down
1 change: 1 addition & 0 deletions changelog.d/2750.changed.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Prompt user for intproxy logs (when intproxy crashes).
Adds .log as a file type for intproxy default log file.
12 changes: 10 additions & 2 deletions mirrord/layer/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,16 @@ impl From<HookError> for i64 {
}
HookError::ProxyError(ref err) => {
graceful_exit!(
"Proxy error, connectivity issue or a bug. \n\
You may report it to us on https://github.com/metalbear-co/mirrord/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml \n{err}"
r"Proxy error, connectivity issue or a bug.
Please report it to us on https://github.com/metalbear-co/mirrord/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml
You can find the `mirrord-intproxy` logs in {}.
{err}",
crate::setup()
.layer_config()
.internal_proxy
.log_destination
.clone()
.unwrap_or("/tmp".to_string())
)
}
_ => error!("Error occured in Layer >> {fail:?}"),
Expand Down
4 changes: 4 additions & 0 deletions mirrord/layer/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ impl LayerSetup {
}
}

pub fn layer_config(&self) -> &LayerConfig {
&self.config
}

pub fn env_config(&self) -> &EnvConfig {
&self.config.feature.env
}
Expand Down

0 comments on commit c1b1579

Please sign in to comment.