Skip to content

[pa/spm] Improve SPM and PA error handling and logging #255

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

Merged
merged 1 commit into from
Jun 27, 2025

Conversation

moidx
Copy link
Collaborator

@moidx moidx commented Jun 27, 2025

This commit introduces several improvements to error handling and logging in the SPM and PA services.

In the Provisioning Appliance (PA):

  • Replaced generic internal error statuses with the specific status codes returned by the SPM. This provides more meaningful error information to the client.
  • Enhanced log messages to include the SKU, which aids in debugging and tracing requests for specific device types.

In the Secure Provisioning Module (SPM):

  • Corrected gRPC status codes to more accurately reflect the nature of the error. For example, using NotFound for unknown SKUs and Unauthenticated for failed authentication instead of Internal.
  • Made error messages more descriptive by including contextual information such as the SKU, which helps in diagnosing issues.
  • Changed several Internal errors to InvalidArgument where the failure is due to invalid data from the client, such as during certificate validation.
  • Added more details to cryptographic-related error messages to assist in debugging signature and parsing failures.

@moidx moidx requested a review from timothytrippel June 27, 2025 21:48
This commit introduces several improvements to error handling and
logging in the SPM and PA services.

In the Provisioning Appliance (PA):
- Replaced generic internal error statuses with the specific status
  codes returned by the SPM. This provides more meaningful error
  information to the client.
- Enhanced log messages to include the SKU, which aids in debugging
  and tracing requests for specific device types.

In the Secure Provisioning Module (SPM):
- Corrected gRPC status codes to more accurately reflect the nature
  of the error. For example, using `NotFound` for unknown SKUs and
  `Unauthenticated` for failed authentication instead of `Internal`.
- Made error messages more descriptive by including contextual
  information such as the SKU, which helps in diagnosing issues.
- Changed several `Internal` errors to `InvalidArgument` where the
  failure is due to invalid data from the client, such as during
  certificate validation.
- Added more details to cryptographic-related error messages to assist
  in debugging signature and parsing failures.

Signed-off-by: Miguel Osorio <[email protected]>
@moidx moidx force-pushed the pa-spm-error-reporting-improvements branch from 660720e to ac37702 Compare June 27, 2025 22:47
@moidx moidx merged commit d3d038c into lowRISC:main Jun 27, 2025
4 checks passed
@moidx moidx deleted the pa-spm-error-reporting-improvements branch June 27, 2025 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants