Skip to content
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

Improve error logging for Sentry errors reduction #2553

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packit_service/worker/allowlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def check_and_report(
return callback(event, project, job_configs)

msg = f"Failed to validate account: Unrecognized event type {type(event)!r}."
logger.error(msg)
logger.debug(msg)
raise PackitException(msg)

def get_approval_issue(self, namespace) -> Optional[str]:
Expand Down
5 changes: 0 additions & 5 deletions packit_service/worker/handlers/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,6 @@ def run_job(self):
job_results[result_key] = self.run_n_clean()
logger.debug("Job finished!")

for result in job_results.values():
if not (result and result["success"]):
if msg := result["details"].get("msg"):
logger.error(msg)

# push the metrics from job
self.pushgateway.push()

Expand Down
8 changes: 4 additions & 4 deletions packit_service/worker/helpers/build/babysit.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def update_vm_image_build(build_id: int, build: "VMImageBuildTargetModel"):
status = body["image_status"]["status"]
except HTTPError as ex:
message = f"No response for VM Image Build {build_id}: {ex}"
logger.error(message)
logger.debug(message)
status = VMImageBuildStatus.error
except Exception as ex:
message = (
Expand All @@ -503,7 +503,7 @@ def update_vm_image_build(build_id: int, build: "VMImageBuildTargetModel"):
if status == VMImageBuildStatus.failure:
error = body["image_status"]["error"]
message = f"VM image build {build.build_id} failed: {error}"
logger.error(message)
logger.debug(message)

if status == VMImageBuildStatus.success:
message = get_message_for_successful_build(body["image_status"])
Expand All @@ -524,7 +524,7 @@ def update_vm_image_build(build_id: int, build: "VMImageBuildTargetModel"):
packages_config = event.get_packages_config()
if not packages_config:
build.set_status(status)
logger.error(
logger.debug(
f"No package config found for {build.build_id}. "
"No feedback can be given to the user."
)
Expand Down Expand Up @@ -555,7 +555,7 @@ def update_vm_image_build(build_id: int, build: "VMImageBuildTargetModel"):
return True

build.set_status(status)
logger.error(
logger.debug(
f"Something went wrong retrieving job configs for {build.build_id}. "
"No feedback can be given to the user."
)
Expand Down
6 changes: 3 additions & 3 deletions packit_service/worker/helpers/testing_farm.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def distro2compose(self, target: str) -> Optional[str]:
f"The compose {compose} (from target {distro}) does not match any compose"
f" in the list of available composes:\n{composes}. "
)
logger.error(msg)
logger.debug(msg)
msg += (
"Please, check the targets defined in your test job configuration. If you think"
f" your configuration is correct, get in touch with [us]({CONTACTS_URL})."
Expand Down Expand Up @@ -762,7 +762,7 @@ def _is_supported_architecture(self, target: str):
f"The architecture {arch} is not in the list of "
f"available architectures:\n{supported_architectures}. "
)
logger.error(msg)
logger.debug(msg)
msg += (
"Please, check the targets defined in your test job configuration. If you think"
f" your configuration is correct, get in touch with [us]({CONTACTS_URL})."
Expand Down Expand Up @@ -841,7 +841,7 @@ def run_testing_farm(
# Leaving here just to be sure that we will discover this situation if it occurs.
# Currently not possible to trigger this situation.
msg = f"Target '{test_run.target}' not defined for tests but triggered."
logger.error(msg)
logger.debug(msg)
send_to_sentry(PackitConfigException(msg))
return TaskResults(
success=False,
Expand Down
Loading