element-hq / element-hq/dendrite

nats: account requires a stream config to have max bytes set

Open
#3,417 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
965
Forks
101
PR merge metrics
No merged PRs in 30d

Description

*This issue was originally created by [**@paigeadelethompson**](https://github.com/paigeadelethompson) at .*

This is an issue that came up while trying to use a SaaS NATS provider:

`time="2024-09-10T14:40:05.105105731Z" level=fatal msg="Unable to add in-memory stream" error="nats: account requires a stream config to have max bytes set" stream=DendriteInputRoomEvent subjects="[DendriteInputRoomEvent DendriteInputRoomEvent.>]"`

I believe it refers to the StreamConfig specified in:

https://github.com/matrix-org/dendrite/blob/main/setup/jetstream/streams.go#L48

Also something else that I'm noticing about the StreamConfig is that a few of them explicitly indicate memory for the storage type:

```
{
Name: OutputTypingEvent,
Retention: nats.InterestPolicy,
Storage: nats.MemoryStorage,
MaxAge: time.Second * 60,
},
```

which would also afaik be a problem for the SaaS provider wile using the free tier

Contributor guide

Open the contributing guide

Research direction

Start with setup/jetstream/streams.go at the referenced StreamConfig and inspect the retention, storage, and size-related settings for each stream. Compare them with the SaaS NATS provider's requirements; the issue does not name a test or exact target configuration, so done means the affected streams can be created without the reported max-bytes or memory-storage errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.