Skip to content

chore(grpc): wrap errors in codec#15283

Merged
janisz merged 4 commits intomasterfrom
chore_grpc_wrap_errors_in_codec
May 21, 2025
Merged

chore(grpc): wrap errors in codec#15283
janisz merged 4 commits intomasterfrom
chore_grpc_wrap_errors_in_codec

Conversation

@janisz
Copy link
Contributor

@janisz janisz commented May 13, 2025

Description

This PR wrap errors that occured in grpc codec to get more information what failed exactly.

  • CHANGELOG update is not needed
  • Documentation is not needed

Testing

  • inspected CI results

Automated testing

  • modified existing tests
  • contributed no automated tests

How I validated my change

CI

Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
@janisz janisz requested review from a team, mtodor, rhybrillou and vikin91 May 13, 2025 15:21
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @janisz - I've reviewed your changes - here's some feedback:

  • Extract the duplicate Wrapf logic in Unmarshal into a shared fallback helper (similar to Marshal) to reduce code duplication and ensure consistency.
  • Standardize the error message templates and placeholder usage across both Marshal and Unmarshal wraps so failure logs are uniform and easy to search.
  • Note that when the fallback succeeds, the original codec error is dropped—consider preserving or logging that initial error so the root cause isn’t lost.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@janisz
Copy link
Contributor Author

janisz commented May 14, 2025

/retest

@rhacs-bot
Copy link
Contributor

rhacs-bot commented May 14, 2025

Images are ready for the commit at 65a4828.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.8.x-692-g65a4828037.

@vikin91
Copy link
Contributor

vikin91 commented May 14, 2025

Tomek, show me this in action with some examples what it does, cause the expectations suggest that it may help a lot with debugging grpc problems as the few recent ones that we are handling.

@codecov
Copy link

codecov bot commented May 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 49.13%. Comparing base (8080109) to head (32daf6f).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
pkg/grpc/codec.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15283   +/-   ##
=======================================
  Coverage   49.12%   49.13%           
=======================================
  Files        2563     2563           
  Lines      188228   188232    +4     
=======================================
+ Hits        92476    92480    +4     
  Misses      88463    88463           
  Partials     7289     7289           
Flag Coverage Δ
go-unit-tests 49.13% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

4 similar comments
@codecov
Copy link

codecov bot commented May 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 49.13%. Comparing base (8080109) to head (32daf6f).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
pkg/grpc/codec.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15283   +/-   ##
=======================================
  Coverage   49.12%   49.13%           
=======================================
  Files        2563     2563           
  Lines      188228   188232    +4     
=======================================
+ Hits        92476    92480    +4     
  Misses      88463    88463           
  Partials     7289     7289           
Flag Coverage Δ
go-unit-tests 49.13% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov
Copy link

codecov bot commented May 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 49.13%. Comparing base (8080109) to head (32daf6f).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
pkg/grpc/codec.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15283   +/-   ##
=======================================
  Coverage   49.12%   49.13%           
=======================================
  Files        2563     2563           
  Lines      188228   188232    +4     
=======================================
+ Hits        92476    92480    +4     
  Misses      88463    88463           
  Partials     7289     7289           
Flag Coverage Δ
go-unit-tests 49.13% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov
Copy link

codecov bot commented May 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 49.13%. Comparing base (8080109) to head (32daf6f).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
pkg/grpc/codec.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15283   +/-   ##
=======================================
  Coverage   49.12%   49.13%           
=======================================
  Files        2563     2563           
  Lines      188228   188232    +4     
=======================================
+ Hits        92476    92480    +4     
  Misses      88463    88463           
  Partials     7289     7289           
Flag Coverage Δ
go-unit-tests 49.13% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov
Copy link

codecov bot commented May 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 49.13%. Comparing base (8080109) to head (32daf6f).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
pkg/grpc/codec.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15283   +/-   ##
=======================================
  Coverage   49.12%   49.13%           
=======================================
  Files        2563     2563           
  Lines      188228   188232    +4     
=======================================
+ Hits        92476    92480    +4     
  Misses      88463    88463           
  Partials     7289     7289           
Flag Coverage Δ
go-unit-tests 49.13% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov
Copy link

codecov bot commented May 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.23%. Comparing base (8080109) to head (65a4828).
Report is 86 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #15283      +/-   ##
==========================================
+ Coverage   49.12%   49.23%   +0.10%     
==========================================
  Files        2563     2573      +10     
  Lines      188228   188858     +630     
==========================================
+ Hits        92476    92992     +516     
- Misses      88463    88546      +83     
- Partials     7289     7320      +31     
Flag Coverage Δ
go-unit-tests 49.23% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vikin91
Copy link
Contributor

vikin91 commented May 15, 2025

I have just tested that for you by using the image from this PR on Central and sending the garbled message using local-sensor. Central has panicked:

# Here I kill the regular sensor

central-554dcf89c8-zsscz cloudsources/manager: 2025/05/15 07:36:46.325005 manager.go:98: Info: Marking discovered clusters matching cluster "7f9f75d1-1466-4184-b330-44f34d94196d" as secured
central-554dcf89c8-zsscz cloudsources/manager: 2025/05/15 07:37:52.036128 manager.go:103: Info: Marking discovered clusters matching cluster "7f9f75d1-1466-4184-b330-44f34d94196d" as unsecured
central-554dcf89c8-zsscz cloudsources/manager: 2025/05/15 07:37:52.036186 manager.go:103: Info: Marking discovered clusters matching cluster "7f9f75d1-1466-4184-b330-44f34d94196d" as unsecured
central-554dcf89c8-zsscz cloudsources/manager: 2025/05/15 07:37:52.036311 manager.go:103: Info: Marking discovered clusters matching cluster "7f9f75d1-1466-4184-b330-44f34d94196d" as unsecured
central-554dcf89c8-zsscz sensor/service/connection: 2025/05/15 07:37:52.036111 manager_impl.go:325: Warn: Connection to server in cluster 7f9f75d1-1466-4184-b330-44f34d94196d terminated: context error: context canceled
central-554dcf89c8-zsscz cloudsources/manager: 2025/05/15 07:37:52.036475 manager.go:103: Info: Marking discovered clusters matching cluster "7f9f75d1-1466-4184-b330-44f34d94196d" as unsecured
central-554dcf89c8-zsscz cloudsources/manager: 2025/05/15 07:37:52.036625 manager.go:103: Info: Marking discovered clusters matching cluster "7f9f75d1-1466-4184-b330-44f34d94196d" as unsecured
central-554dcf89c8-zsscz cloudsources/manager: 2025/05/15 07:37:52.036798 manager.go:103: Info: Marking discovered clusters matching cluster "7f9f75d1-1466-4184-b330-44f34d94196d" as unsecured
central-554dcf89c8-zsscz cloudsources/manager: 2025/05/15 07:37:52.036862 manager.go:103: Info: Marking discovered clusters matching cluster "7f9f75d1-1466-4184-b330-44f34d94196d" as unsecured
central-554dcf89c8-zsscz cloudsources/manager: 2025/05/15 07:37:52.036814 manager.go:103: Info: Marking discovered clusters matching cluster "7f9f75d1-1466-4184-b330-44f34d94196d" as unsecured

# Here, I start local-sensor
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
central-554dcf89c8-zsscz         github.com/stackrox/rox/pkg/contextutil/contextupdater.go:52 +0x7f
central-554dcf89c8-zsscz     google.golang.org/grpc.getChainStreamHandler.func1({0xa0962a0, 0xc00210d900}, {0xb88c1d8, 0xc00c9aee40})
central-554dcf89c8-zsscz         google.golang.org/grpc@v1.72.0/server.go:1548 +0xb2
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/grpc/ratelimit.(*rateLimiter).GetStreamServerInterceptor.StreamServerInterceptor.func1({0xa0962a0, 0xc00210d900}, {0xb88c1d8, 0xc00c9aee40}, 0xc00c9aee10, 0xc00b8ecf00)
central-554dcf89c8-zsscz         github.com/grpc-ecosystem/go-grpc-middleware/v2@v2.2.0/interceptors/ratelimit/ratelimit.go:37 +0x13c
central-554dcf89c8-zsscz     google.golang.org/grpc.getChainStreamHandler.func1({0xa0962a0, 0xc00210d900}, {0xb88c1d8, 0xc00c9aee40})
central-554dcf89c8-zsscz         google.golang.org/grpc@v1.72.0/server.go:1548 +0xb2
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/grpc/errors.ErrorToGrpcCodeStreamInterceptor({0xa0962a0?, 0xc00210d900?}, {0xb88c1d8?, 0xc00c9aee40?}, 0xc00c9aee10?, 0xb013930?)
central-554dcf89c8-zsscz         github.com/stackrox/rox/pkg/grpc/errors/interceptor.go:73 +0x2e
central-554dcf89c8-zsscz     google.golang.org/grpc.getChainStreamHandler.func1({0xa0962a0, 0xc00210d900}, {0xb88c1d8, 0xc00c9aee40})
central-554dcf89c8-zsscz         google.golang.org/grpc@v1.72.0/server.go:1548 +0xb2
central-554dcf89c8-zsscz     github.com/grpc-ecosystem/go-grpc-prometheus.init.(*ServerMetrics).StreamServerInterceptor.func4({0xa0962a0, 0xc00210d900}, {0xb88b198, 0xc001d701c0}, 0xc00c9aee10, 0xc00b8ece80)
central-554dcf89c8-zsscz         github.com/grpc-ecosystem/go-grpc-prometheus@v1.2.1-0.20210315223345-82c243799c99/server_metrics.go:122 +0xd2
central-554dcf89c8-zsscz     google.golang.org/grpc.NewServer.chainStreamServerInterceptors.chainStreamInterceptors.func2({0xa0962a0, 0xc00210d900}, {0xb88b198, 0xc001d701c0}, 0xc00c9aee10, 0xc0069ac590?)
central-554dcf89c8-zsscz         google.golang.org/grpc@v1.72.0/server.go:1539 +0x85
central-554dcf89c8-zsscz     google.golang.org/grpc.(*Server).processStreamingRPC(0xc0067bb000, {0xb878078, 0xc00746fd70}, 0xc001aee780, 0xc006104ab0, 0xff684a0, 0x0)
central-554dcf89c8-zsscz         google.golang.org/grpc@v1.72.0/server.go:1702 +0x124a
central-554dcf89c8-zsscz     google.golang.org/grpc.(*Server).handleStream(0xc0067bb000, {0xb87aeb8, 0xc00b846d00}, 0xc001aee780)
central-554dcf89c8-zsscz         google.golang.org/grpc@v1.72.0/server.go:1819 +0xb69
central-554dcf89c8-zsscz     google.golang.org/grpc.(*Server).serveStreams.func2.1()
central-554dcf89c8-zsscz         google.golang.org/grpc@v1.72.0/server.go:1035 +0x7f
central-554dcf89c8-zsscz     created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 32438
central-554dcf89c8-zsscz         google.golang.org/grpc@v1.72.0/server.go:1046 +0x125
central-554dcf89c8-zsscz     
central-554dcf89c8-zsscz 
central-554dcf89c8-zsscz goroutine 32419 [running]:
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/utils/panic.HardPanic({0x9d8b220, 0xc00c9af218})
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/utils/panic/hard_panic.go:25 +0xa7
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/utils.ShouldErr(...)
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/utils/must.go:34
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/utils.Should(...)
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/utils/must.go:44
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/grpc.panicHandler({0x9fc9180?, 0xc00c9af1e8?})
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/grpc/recovery.go:24 +0xe5
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/grpc.(*apiImpl).streamRecovery.(*apiImpl).recoveryOpts.WithRecoveryHandler.func1.1({0x10000c00c9af1d0?, 0xf0?}, {0x9fc9180?, 0xc00c9af1e8?})
central-554dcf89c8-zsscz     github.com/grpc-ecosystem/go-grpc-middleware/v2@v2.2.0/interceptors/recovery/options.go:36 +0x27
central-554dcf89c8-zsscz github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/recovery.recoverFrom({0xb878078?, 0xc00739e3f0?}, {0x9fc9180?, 0xc00c9af1e8?}, 0xc001ca0fc0?)
central-554dcf89c8-zsscz     github.com/grpc-ecosystem/go-grpc-middleware/v2@v2.2.0/interceptors/recovery/interceptors.go:54 +0xea
central-554dcf89c8-zsscz github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/recovery.StreamServerInterceptor.func1.1()
central-554dcf89c8-zsscz     github.com/grpc-ecosystem/go-grpc-middleware/v2@v2.2.0/interceptors/recovery/interceptors.go:44 +0x7b
central-554dcf89c8-zsscz panic({0x9fc9180?, 0xc00c9af1e8?})
central-554dcf89c8-zsscz     runtime/panic.go:785 +0x132
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/utils/panic.HardPanic({0x9fc9180, 0xc00c9af1e8})
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/utils/panic/hard_panic.go:25 +0xa7
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/utils.ShouldErr(...)
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/utils/must.go:34
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/safe.RunE(0xc000012798?)
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/safe/run.go:13 +0x5e
central-554dcf89c8-zsscz github.com/stackrox/rox/central/sensor/service.(*serviceImpl).Communicate(0xc00210d900, {0xb896950, 0xc0069ac800})
central-554dcf89c8-zsscz     github.com/stackrox/rox/central/sensor/service/service_impl.go:155 +0x100b
central-554dcf89c8-zsscz github.com/stackrox/rox/generated/internalapi/central._SensorService_Communicate_Handler({0xa0962a0?, 0xc00210d900}, {0xb88ace8, 0xc00701be60})
central-554dcf89c8-zsscz     github.com/stackrox/rox/generated/internalapi/central/sensor_iservice_grpc.pb.go:91 +0xd8
central-554dcf89c8-zsscz github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/recovery.StreamServerInterceptor.func1({0xa0962a0?, 0xc00210d900?}, {0xb88ace8?, 0xc00701be60?}, 0xc00739e3f0?, 0xc001d00708?)
central-554dcf89c8-zsscz     github.com/grpc-ecosystem/go-grpc-middleware/v2@v2.2.0/interceptors/recovery/interceptors.go:48 +0x82
central-554dcf89c8-zsscz google.golang.org/grpc.getChainStreamHandler.func1({0xa0962a0, 0xc00210d900}, {0xb88ace8, 0xc00701be60})
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1548 +0xb2
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/grpc/errors.PanicOnInvariantViolationStreamInterceptor({0xa0962a0?, 0xc00210d900?}, {0xb88ace8?, 0xc00701be60?}, 0xc00c9aee10?, 0xb013930?)
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/grpc/errors/interceptor.go:33 +0x2a
central-554dcf89c8-zsscz google.golang.org/grpc.getChainStreamHandler.func1({0xa0962a0, 0xc00210d900}, {0xb88ace8, 0xc00701be60})
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1548 +0xb2
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/grpc/errors.LogInternalErrorStreamInterceptor({0xa0962a0?, 0xc00210d900?}, {0xb88ace8?, 0xc00701be60?}, 0xc00c9aee10?, 0xb013930?)
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/grpc/errors/interceptor.go:53 +0x2a
central-554dcf89c8-zsscz google.golang.org/grpc.getChainStreamHandler.func1({0xa0962a0, 0xc00210d900}, {0xb88ace8, 0xc00701be60})
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1548 +0xb2
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/grpc.(*apiImpl).streamInterceptors.StreamServerInterceptor.func4({0xa0962a0, 0xc00210d900}, {0xb88ace8, 0xc00701be60}, 0xc00c9aee10, 0xc00b8ed080)
central-554dcf89c8-zsscz     github.com/grpc-ecosystem/go-grpc-middleware/v2@v2.2.0/interceptors/auth/auth.go:68 +0x126
central-554dcf89c8-zsscz google.golang.org/grpc.getChainStreamHandler.func1({0xa0962a0, 0xc00210d900}, {0xb88ace8, 0xc00701be60})
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1548 +0xb2
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/grpc.(*apiImpl).streamInterceptors.StreamServerInterceptor.func3({0xa0962a0, 0xc00210d900}, {0xb88ace8, 0xc00701be40}, 0xc00c9aee10?, 0xc00b8ed040)
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/contextutil/contextupdater.go:52 +0x7f
central-554dcf89c8-zsscz google.golang.org/grpc.getChainStreamHandler.func1({0xa0962a0, 0xc00210d900}, {0xb88ace8, 0xc00701be40})
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1548 +0xb2
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/grpc.(*apiImpl).streamInterceptors.StreamServerInterceptor.func2({0xa0962a0, 0xc00210d900}, {0xb88ace8, 0xc00701bd40}, 0xc00c9aee10?, 0xc00b8ecf80)
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/contextutil/contextupdater.go:52 +0x7f
central-554dcf89c8-zsscz google.golang.org/grpc.getChainStreamHandler.func1({0xa0962a0, 0xc00210d900}, {0xb88ace8, 0xc00701bd40})
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1548 +0xb2
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/grpc.(*apiImpl).streamInterceptors.StreamServerInterceptor.func1({0xa0962a0, 0xc00210d900}, {0xb88c1d8, 0xc00c9aee40}, 0xc00c9aee10?, 0xc00b8ecf40)
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/contextutil/contextupdater.go:52 +0x7f
central-554dcf89c8-zsscz google.golang.org/grpc.getChainStreamHandler.func1({0xa0962a0, 0xc00210d900}, {0xb88c1d8, 0xc00c9aee40})
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1548 +0xb2
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/grpc/ratelimit.(*rateLimiter).GetStreamServerInterceptor.StreamServerInterceptor.func1({0xa0962a0, 0xc00210d900}, {0xb88c1d8, 0xc00c9aee40}, 0xc00c9aee10, 0xc00b8ecf00)
central-554dcf89c8-zsscz     github.com/grpc-ecosystem/go-grpc-middleware/v2@v2.2.0/interceptors/ratelimit/ratelimit.go:37 +0x13c
central-554dcf89c8-zsscz google.golang.org/grpc.getChainStreamHandler.func1({0xa0962a0, 0xc00210d900}, {0xb88c1d8, 0xc00c9aee40})
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1548 +0xb2
central-554dcf89c8-zsscz github.com/stackrox/rox/pkg/grpc/errors.ErrorToGrpcCodeStreamInterceptor({0xa0962a0?, 0xc00210d900?}, {0xb88c1d8?, 0xc00c9aee40?}, 0xc00c9aee10?, 0xb013930?)
central-554dcf89c8-zsscz     github.com/stackrox/rox/pkg/grpc/errors/interceptor.go:73 +0x2e
central-554dcf89c8-zsscz google.golang.org/grpc.getChainStreamHandler.func1({0xa0962a0, 0xc00210d900}, {0xb88c1d8, 0xc00c9aee40})
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1548 +0xb2
central-554dcf89c8-zsscz github.com/grpc-ecosystem/go-grpc-prometheus.init.(*ServerMetrics).StreamServerInterceptor.func4({0xa0962a0, 0xc00210d900}, {0xb88b198, 0xc001d701c0}, 0xc00c9aee10, 0xc00b8ece80)
central-554dcf89c8-zsscz     github.com/grpc-ecosystem/go-grpc-prometheus@v1.2.1-0.20210315223345-82c243799c99/server_metrics.go:122 +0xd2
central-554dcf89c8-zsscz google.golang.org/grpc.NewServer.chainStreamServerInterceptors.chainStreamInterceptors.func2({0xa0962a0, 0xc00210d900}, {0xb88b198, 0xc001d701c0}, 0xc00c9aee10, 0xc0069ac590?)
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1539 +0x85
central-554dcf89c8-zsscz google.golang.org/grpc.(*Server).processStreamingRPC(0xc0067bb000, {0xb878078, 0xc00746fd70}, 0xc001aee780, 0xc006104ab0, 0xff684a0, 0x0)
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1702 +0x124a
central-554dcf89c8-zsscz google.golang.org/grpc.(*Server).handleStream(0xc0067bb000, {0xb87aeb8, 0xc00b846d00}, 0xc001aee780)
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1819 +0xb69
central-554dcf89c8-zsscz google.golang.org/grpc.(*Server).serveStreams.func2.1()
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1035 +0x7f
central-554dcf89c8-zsscz created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 32438
central-554dcf89c8-zsscz     google.golang.org/grpc@v1.72.0/server.go:1046 +0x125
stream closed EOF for stackrox/central-554dcf89c8-zsscz (central)

@janisz
Copy link
Contributor Author

janisz commented May 15, 2025

@vikin91 do you have a full log with an error? The panic is caused because it is not release image but I'd love to see the error message.

// RunE executes the given function, and will wrap any panic that it encountered as an error. Any error returned
// from fn() in normal execution is passed through as-is.
// Note: the error is passed through `utils.Should`, resulting in a panic on debug builds and a log message on
// release builds.
func RunE(fn func() error) error {
return utils.ShouldErr(runE(fn))
}

@vikin91
Copy link
Contributor

vikin91 commented May 15, 2025

@vikin91 do you have a full log with an error? The panic is caused because it is not release image but I'd love to see the error message.

I thought, I pasted entire log starting from a moment where everything was healthy until the end of the log.
I can try that again.

Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>

# Conflicts:
#	pkg/grpc/codec.go
@janisz
Copy link
Contributor Author

janisz commented May 16, 2025

/retest

@janisz janisz requested a review from rhybrillou May 20, 2025 10:46
Co-authored-by: Yann Brillouet <91869377+rhybrillou@users.noreply.github.com>
@janisz janisz enabled auto-merge (squash) May 21, 2025 15:40
@janisz janisz merged commit 17bb406 into master May 21, 2025
84 of 91 checks passed
@janisz janisz deleted the chore_grpc_wrap_errors_in_codec branch May 21, 2025 17:40
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.

4 participants