Billionmail/BillionMail · error

Model not found

Error message

Model not found

What it means

modifyPostfixNetworksText found the 'postfix-billionmail:' service line but no 'networks:' block inside that service's definition. Because the function edits the existing networks section in place rather than synthesizing the whole service block, it refuses to proceed and returns the file unchanged.

Source

Thrown at core/internal/controller/askai/askai_v1_supplier.go:41

func (c *ControllerV1) Models(ctx context.Context, req *v1.ModelsReq) (res *v1.ModelsRes, err error) {
	res = &v1.ModelsRes{}
	res.Data = askai.Models(req.SupplierName)
	res.SetSuccess(public.LangCtx(ctx, "List of models retrieved successfully"))
	return res, nil
}

func (c *ControllerV1) AddModel(ctx context.Context, req *v1.AddModelReq) (res *v1.AddModelRes, err error) {
	res = &v1.AddModelRes{}
	res.Data = askai.AddModel(req.SupplierName, req.Title, req.ModelId, req.MaxTokens, req.Capability)
	res.SetSuccess(public.LangCtx(ctx, "Model added successfully"))
	return res, nil
}

func (c *ControllerV1) RemoveModel(ctx context.Context, req *v1.RemoveModelReq) (res *v1.RemoveModelRes, err error) {
	res = &v1.RemoveModelRes{}
	res.Data = askai.RemoveModel(req.SupplierName, req.ModelId)
	if res.Data == nil {
		res.SetError(errors.New(public.LangCtx(ctx, "Model not found")))
		return res, nil
	}
	res.SetSuccess(public.LangCtx(ctx, "Model removed successfully"))
	return res, nil
}

func (c *ControllerV1) SetSupplierConfig(ctx context.Context, req *v1.SetSupplierConfigReq) (res *api_v1.StandardRes, err error) {
	res = &api_v1.StandardRes{}
	result := askai.SetSupplierConfig(req.SupplierName, req.BaseUrl, req.ApiKey)
	if result == nil {
		res.Data = result
		res.SetSuccess(public.LangCtx(ctx, "Supplier configuration updated successfully"))
	} else {
		res.SetError(result)
	}

	return res, nil
}

View on GitHub (pinned to fc36c76c05)

Solutions

  1. Add a 'networks:' section (even with one entry) to the postfix-billionmail service in docker-compose.yml
  2. Keep the networks key at the indentation the scanner expects (8 spaces / two tab levels under services)
  3. Run the rebuild-based path (rebuildPostfixServiceNetworks) instead, which works on parsed YAML and can add missing networks
  4. Regenerate docker-compose.yml from the original BillionMail template

Example fix

# before
services:
  postfix-billionmail:
    image: billionmail/postfix
# after
services:
  postfix-billionmail:
    image: billionmail/postfix
    networks:
      billionmail-network:
        aliases:
          - postfix
Defensive patterns

Strategy: validation

Validate before calling

if !strings.Contains(string(data), "networks:") {
	// ensure the postfix service declares a networks section before the text edit
}

Try / catch

lines, err := m.modifyPostfixNetworksText(lines, configs)
if err != nil && strings.Contains(err.Error(), "networks section not found") {
	// fall back to the parsed-YAML rebuild path which can add networks
}

Prevention

When it happens

Trigger: The postfix-billionmail service exists in docker-compose.yml but has no 'networks:' key under it (the scanner looks for a line containing 'networks:' after the service start index).

Common situations: Compose files where the service was written without an explicit networks section (relying on the default network), or where networks was removed during customization.

Related errors


AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05). Data as JSON: /api/errors/10e24163608180e5. Report an issue: GitHub.