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

[Bug]: golang的agent在grpc中使用了一元拦截器(UnaryInterceptor)的时候报错 #44

Open
3 tasks done
Fliv opened this issue Jul 14, 2022 · 1 comment
Open
3 tasks done
Labels
bug Something isn't working

Comments

@Fliv
Copy link

Fliv commented Jul 14, 2022

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.
  • I am not looking for support or already pursued the available support channels without success.

Version

1.8.1

Installation Type

Official Docker Compose

Service Name

DongTai-Core

Describe the details of the bug and the steps to reproduce it

在项目中已经使用了grpc一元拦截器(grpc.UnaryInterceptor)的情况下,dongtai agent再注册拦截器会导致报错

代码路径:
https://github.com/HXSecurity/DongTai-agent-go/blob/v0.4.2/core/grpc/newServer/replacement.go#L25

报错:

panic: The unary server interceptor was already set and may not be reset

Additional Information

No response

Logs

2022-07-13 19:13:43.840 error ******[-]: panic: The unary server interceptor was already set and may not be reset. 
	/usr/local/go/src/runtime/panic.go:844
google.golang.org/grpc.UnaryInterceptor.func1
	/***/go/pkg/mod/google.golang.org/[email protected]/server.go:382
google.golang.org/grpc.(*funcServerOption).apply
	/***/go/pkg/mod/google.golang.org/[email protected]/server.go:201
google.golang.org/grpc.NewServer
	/***/go/pkg/mod/google.golang.org/[email protected]/server.go:564
github.com/HXSecurity/DongTai-agent-go/core/grpc/newServer.NewServer
	/***/go/pkg/mod/github.com/!h!x!security/!dong![email protected]/core/grpc/newServer/replacement.go:26
@Fliv Fliv added the bug Something isn't working label Jul 14, 2022
@Bidaya0
Copy link

Bidaya0 commented Jul 18, 2022

Thanks for the feedback, PRs from users are welcome

@Bidaya0 Bidaya0 transferred this issue from HXSecurity/DongTai Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants