caddyserver/caddy · error

getting events app

Error message

getting events app: %v

What it means

Wrapper in TLS.Provision for ctx.App("events") failure: the TLS app needs the events app (for certificate lifecycle event emission) but it could not be obtained. This indicates the events app failed to provision or is unavailable in the config; the wrapped error carries the cause.

Solutions

  1. Ensure the events app is configured and loads correctly; the wrapped error explains the failure.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at modules/caddytls/tls.go:165 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of caddyserver/caddy@50e54ee279 (2026-08-15). Data as JSON: /api/errors/f73a3c1e744f776d. Report an issue: GitHub.

Appendix: source

Thrown at modules/caddytls/tls.go:165

	// set of subjects with managed certificates,
	// and hashes of manually-loaded certificates
	// (managing's value is an optional issuer key, for distinction)
	managing, loaded map[string]string
}

// CaddyModule returns the Caddy module information.
func (TLS) CaddyModule() caddy.ModuleInfo {
	return caddy.ModuleInfo{
		ID:  "tls",
		New: func() caddy.Module { return new(TLS) },
	}
}

// Provision sets up the configuration for the TLS app.
func (t *TLS) Provision(ctx caddy.Context) error {
	eventsAppIface, err := ctx.App("events")
	if err != nil {
		return fmt.Errorf("getting events app: %v", err)
	}
	t.events = eventsAppIface.(*caddyevents.App)
	t.ctx = ctx
	t.logger = ctx.Logger()
	repl := caddy.NewReplacer()
	t.managing, t.loaded = make(map[string]string), make(map[string]string)
	t.serverNames = make(map[string]serverNameRegistration)
	t.serverNamesMu = new(sync.Mutex)

	// set up default DNS module, if any, and make sure it implements all the
	// common libdns interfaces, since it could be used for a variety of things
	// (do this before provisioning other modules, since they may rely on this)
	if len(t.DNSRaw) > 0 {
		dnsMod, err := ctx.LoadModule(t, "DNSRaw")
		if err != nil {
			return fmt.Errorf("loading overall DNS provider module: %v", err)
		}
		switch dnsMod.(type) {

View on GitHub (pinned to 50e54ee279)