goreleaser/goreleaser · error
'server' is a required config key
Error message
'server' is a required config key
What it means
The discourse announce pipe validates its config and returns this error when announce.discourse.server is empty. The server (forum base URL) is required to post the announcement, so the pipe fails fast instead of making a request to an invalid endpoint.
Source
Thrown at internal/pipe/discourse/discourse.go:64
}
return nil
}
func (p Pipe) Announce(ctx *context.Context) error {
title, err := tmpl.New(ctx).Apply(ctx.Config.Announce.Discourse.TitleTemplate)
if err != nil {
return err
}
msg, err := tmpl.New(ctx).Apply(ctx.Config.Announce.Discourse.MessageTemplate)
if err != nil {
return err
}
// Make 'server' a required config field.
if ctx.Config.Announce.Discourse.Server == "" {
return errors.New("'server' is a required config key")
}
// Make 'category_id' a required config field.
if ctx.Config.Announce.Discourse.CategoryID == 0 {
return errors.New("'category_id' is a required config key")
}
cfg, err := env.ParseAs[Config]()
if err != nil {
return err
}
pr := &postsRequest{
Title: title,
Raw: msg,
Category: ctx.Config.Announce.Discourse.CategoryID,
}
View on GitHub (pinned to f5edd73956)
Solutions
- Set announce.discourse.server in .goreleaser.yaml to your forum URL
- Ensure any environment variable used for the server value is exported in CI
- Remove/comment the discourse announce block if you don't use Discourse
Example fix
// before
announce:
discourse:
category_id: 5
// after
announce:
discourse:
server: https://forum.example.com
category_id: 5 Defensive patterns
Strategy: validation
Validate before calling
if ctx.Config.Announce.Discourse.Server == "" {
log.Fatal("announce.discourse.server must be set")
} Try / catch
if err := pipe.Announce(ctx); err != nil && strings.Contains(err.Error(), "'server' is a required") {
log.Println("discourse announce disabled: missing server")
} Prevention
- Run `goreleaser check` before releases
- Avoid empty-expanding env templates for required fields
- Keep announce config minimal to only used services
When it happens
Trigger: Calling Announce when ctx.Config.Announce.Discourse.Server == "" — i.e. the discourse announce pipe is enabled but no server value is set in .goreleaser.yaml or via environment/config parsing.
Common situations: Enabling discourse in the announce section without filling in the server field; relying on env expansion whose variable (e.g. ${DISCOURSE_SERVER}) is unset so it expands to empty.
Related errors
- 'category_id' is a required config key
- no tags provided
- no app_id provided for flatpak
- no runtime provided for flatpak
- ErrNoDescription
AI-assisted analysis of goreleaser/goreleaser@f5edd73956 (2026-09-05).
Data as JSON: /api/errors/ab737936ac7ba10d.
Report an issue: GitHub.