You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a `SnippetsFilter` is defined in a Route resource and contains a Snippet which includes an invalid NGINX configuration, NGINX will continue to operate
394
+
with the last valid configuration and an event with the error will be outputted. No new configuration will be applied until the invalid Snippet is fixed.
395
+
396
+
An example of an error from the NGINX Gateway Fabric `nginx-gateway` container logs:
397
+
398
+
```text
399
+
{"level":"error","ts":"2024-10-29T22:19:41Z","logger":"eventLoop.eventHandler","msg":"Failed to update NGINX configuration","batchID":156,"error":"failed to reload NGINX: reload unsuccessful: no new NGINX worker processes started for config version 141. Please check the NGINX container logs for possible configuration issues: context deadline exceeded","stacktrace":"github.com/nginxinc/nginx-gateway-fabric/internal/mode/static.(*eventHandlerImpl).HandleEventBatch\n\ti.8713187.xyz/nginxinc/nginx-gateway-fabric/internal/mode/static/handler.go:219\ni.8713187.xyz/nginxinc/nginx-gateway-fabric/internal/framework/events.(*EventLoop).Start.func1.1\n\ti.8713187.xyz/nginxinc/nginx-gateway-fabric/internal/framework/events/loop.go:74"}
400
+
```
401
+
402
+
An example of an error from the NGINX Gateway Fabric `nginx` container logs:
403
+
404
+
```text
405
+
2024/10/29 22:18:41 [emerg] 40#40: invalid number of arguments in "limit_req_zone" directive in /etc/nginx/includes/SnippetsFilter_http_default_rate-limiting-sf.conf:1
406
+
```
407
+
408
+
The Route resource which references the `SnippetsFilter` may also contain information in its conditions describing the error:
409
+
410
+
```text
411
+
Conditions:
412
+
Last Transition Time: 2024-10-29T22:19:41Z
413
+
Message: All references are resolved
414
+
Observed Generation: 2
415
+
Reason: ResolvedRefs
416
+
Status: True
417
+
Type: ResolvedRefs
418
+
Last Transition Time: 2024-10-29T22:19:41Z
419
+
Message: The Gateway is not programmed due to a failure to reload nginx with the configuration. Please see the nginx container logs for any possible configuration issues. NGINX may still be configured for this Route. However, future updates to this resource will not be configured until the Gateway is programmed again
420
+
Observed Generation: 2
421
+
Reason: GatewayNotProgrammed
422
+
Status: False
423
+
Type: Accepted
424
+
```
425
+
426
+
If a Route resource references a `SnippetsFilter` which cannot be resolved, the route will return a 500 HTTP error response on all requests.
427
+
The Route conditions will contain information describing the error:
428
+
429
+
```text
430
+
Conditions:
431
+
Last Transition Time: 2024-10-29T22:26:01Z
432
+
Message: The route is accepted
433
+
Observed Generation: 2
434
+
Reason: Accepted
435
+
Status: True
436
+
Type: Accepted
437
+
Last Transition Time: 2024-10-29T22:26:01Z
438
+
Message: spec.rules[0].filters[0].extensionRef: Not found: v1.LocalObjectReference{Group:"gateway.nginx.org", Kind:"SnippetsFilter", Name:"rate-limiting-sf"}
439
+
Observed Generation: 2
440
+
Reason: InvalidFilter
441
+
Status: False
442
+
Type: ResolvedRefs
443
+
```
444
+
445
+
---
446
+
391
447
## See also
392
448
393
449
-[API reference]({{< relref "reference/api.md" >}}): all configuration fields for the `SnippetsFilter` API.
0 commit comments