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

Fix bug in handling traffic #64

Open
mostafa opened this issue Oct 16, 2023 · 0 comments
Open

Fix bug in handling traffic #64

mostafa opened this issue Oct 16, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@mostafa
Copy link
Member

mostafa commented Oct 16, 2023

This is the log output of GatewayD when running it against the latest changes in this PR. It seems that the OnTrafficFromClient hook returns an error, which is swallowed until the server is killed or stopped.

Note
The SDK, Go template and the plugins should be tested with the new changes in this PR to ensure compatibility.

2023-10-16T13:22:20+02:00 WRN Running GatewayD in development mode (not recommended for production)
2023-10-16T13:22:20+02:00 INF configuring client automatic mTLS plugin=gatewayd-plugin-cache
2023-10-16T13:22:20+02:00 INF Starting metrics server via HTTP over Unix domain socket endpoint=/metrics plugin=gatewayd-plugin-cache timestamp=2023-10-16T13:22:20.157+0200 unixDomainSocket=/tmp/gatewayd-plugin-cache.sock
2023-10-16T13:22:20+02:00 ERR Failed to ping Redis server error="dial tcp 127.0.0.1:6379: connect: connection refused" plugin=gatewayd-plugin-cache timestamp=2023-10-16T13:22:20.227+0200
2023-10-16T13:22:20+02:00 INF configuring server automatic mTLS plugin=gatewayd-plugin-cache timestamp=2023-10-16T13:22:20.227+0200
2023-10-16T13:22:20+02:00 INF Registering plugin hooks name=gatewayd-plugin-cache
2023-10-16T13:22:20+02:00 INF Plugin is ready name=gatewayd-plugin-cache
2023-10-16T13:22:20+02:00 INF Started the metrics merger scheduler metricsMergerPeriod=5s startDelay=1697455345
2023-10-16T13:22:20+02:00 INF Starting plugin health check scheduler healthCheckPeriod=5s
2023-10-16T13:22:20+02:00 INF Metrics are exposed address=http://localhost:9090/metrics
2023-10-16T13:22:20+02:00 INF There are clients available in the pool count=10 name=default
2023-10-16T13:22:20+02:00 INF Started the client health check scheduler healthCheckPeriod=1m0s startDelay=2023-10-16T13:23:20+02:00
2023-10-16T13:22:20+02:00 INF GatewayD is listening address=0.0.0.0:15432
2023-10-16T13:22:20+02:00 INF Started the HTTP API address=localhost:18080
2023-10-16T13:22:20+02:00 INF Started the gRPC API address=localhost:19090 network=tcp
2023-10-16T13:22:20+02:00 INF GatewayD is running pid=1343

2023-10-16T13:22:25+02:00 ERR Database name not found or set in cache, startup message or plugin config. Skipping cache plugin=gatewayd-plugin-cache timestamp=2023-10-16T13:22:25.499+0200
2023-10-16T13:22:25+02:00 ERR Consider setting the database name in the plugin config or disabling the plugin if you don't need it plugin=gatewayd-plugin-cache timestamp=2023-10-16T13:22:25.499+0200
2023-10-16T13:22:25+02:00 ERR Database name not found or set in cache, startup message or plugin config. Skipping cache plugin=gatewayd-plugin-cache timestamp=2023-10-16T13:22:25.703+0200
2023-10-16T13:22:25+02:00 ERR Consider setting the database name in the plugin config or disabling the plugin if you don't need it plugin=gatewayd-plugin-cache timestamp=2023-10-16T13:22:25.703+0200
2023-10-16T13:22:28+02:00 ERR Database name not found or set in cache, startup message or plugin config. Skipping cache plugin=gatewayd-plugin-cache timestamp=2023-10-16T13:22:28.482+0200
2023-10-16T13:22:28+02:00 ERR Consider setting the database name in the plugin config or disabling the plugin if you don't need it plugin=gatewayd-plugin-cache timestamp=2023-10-16T13:22:28.482+0200
^C2023-10-16T13:22:30+02:00 INF Notifying the plugins that the server is shutting down
2023-10-16T13:22:30+02:00 INF GatewayD is shutting down
2023-10-16T13:22:30+02:00 INF Stopped health check scheduler
2023-10-16T13:22:30+02:00 INF Stopped metrics merger
2023-10-16T13:22:30+02:00 INF Stopped metrics server
2023-10-16T13:22:30+02:00 INF Stopping server name=default
2023-10-16T13:22:30+02:00 INF Stopped all servers
2023-10-16T13:22:30+02:00 ERR Cannot receive startup message error=EOF plugin=gatewayd-plugin-cache timestamp=2023-10-16T13:22:30.321+0200
2023-10-16T13:22:30+02:00 ERR Hook returned an error error="rpc error: code = Unavailable desc = error reading from server: EOF" hookName=HOOK_NAME_ON_TRAFFIC_FROM_CLIENT priority=1000
2023-10-16T13:22:30+02:00 ERR Database name not found or set in cache, startup message or plugin config. Skipping cache plugin=gatewayd-plugin-cache timestamp=2023-10-16T13:22:30.323+0200
2023-10-16T13:22:30+02:00 ERR Consider setting the database name in the plugin config or disabling the plugin if you don't need it plugin=gatewayd-plugin-cache timestamp=2023-10-16T13:22:30.323+0200
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xb77762]

goroutine 129 [running]:
github.com/gatewayd-io/gatewayd/plugin.(*Registry).Run(0xc0002341c0, {0x17d00f8, 0xc0000fe0e0}, 0xc00049ff00?, 0x1?, {0x0, 0x0, 0x0})
        /gatewayd/gatewayd/plugin/plugin_registry.go:343 +0x8a2
github.com/gatewayd-io/gatewayd/network.(*Proxy).PassThroughToServer(0xc00058d110, {0x17d4be8?, 0xc0004aa008}, 0xc00025ab50?)
        /gatewayd/gatewayd/network/proxy.go:295 +0x366
github.com/gatewayd-io/gatewayd/network.(*Server).OnTraffic.func1(0xc0006c2d00, {0x17d4be8, 0xc0004aa008}, 0xc0004aa008?, 0x0?)
        /gatewayd/gatewayd/network/server.go:280 +0xa6
created by github.com/gatewayd-io/gatewayd/network.(*Server).OnTraffic in goroutine 51
        /gatewayd/gatewayd/network/server.go:277 +0x49b
exit status 2
make: *** [Makefile:98: run] Error 1
@mostafa mostafa added the bug Something isn't working label Oct 16, 2023
@mostafa mostafa added this to the v0.2.x milestone Oct 16, 2023
@mostafa mostafa self-assigned this Oct 16, 2023
@mostafa mostafa moved this from 🆕 New to 📋 Backlog in Plugins Public Roadmap Oct 16, 2023
@mostafa mostafa removed their assignment Dec 26, 2023
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
Status: 📋 Backlog
Development

No branches or pull requests

1 participant