Neil 39eabb4f0a When checking replica count when updating retention, make sure stream assignment is set (#4391)
This should fix a panic found by @scottf:
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x68 pc=0x10ce982]
goroutine 51 [running]:
github.com/nats-io/nats-server/v2/server.(*stream).updateWithAdvisory(0xc0000c6380, 0xc000510156?, 0x1)
        C:/nats/temp/nats-server/server/stream.go:1793 +0xa82
github.com/nats-io/nats-server/v2/server.(*stream).update(...)
        C:/nats/temp/nats-server/server/stream.go:1609
github.com/nats-io/nats-server/v2/server.(*Server).jsStreamUpdateRequest(0xc000184d80, 0x4d00000000000000?, 0xc0001d4c80, 0x64d6330f?, {0xc000510140, 0x1c}, {0xc00041c150, 0x11}, {0xc0003cc240, 0x100, ...})
        C:/nats/temp/nats-server/server/jetstream_api.go:1460 +0xbf2
github.com/nats-io/nats-server/v2/server.(*jetStream).apiDispatch(0xc0001e6000, 0xc0001e2a80, 0xc0001d4c80, 0xc0001c2280, {0xc000510140, 0x1c}, {0xc00041c150, 0x11}, {0xc0003cc240, 0x100, ...})
        C:/nats/temp/nats-server/server/jetstream_api.go:768 +0x26a
github.com/nats-io/nats-server/v2/server.(*client).deliverMsg(0xc0001d4c80, 0x0, 0xc0001e2a80, 0x30?, {0xc000510120, 0x1c, 0x20}, {0xc00041c138, 0x11, 0x18}, ...)
        C:/nats/temp/nats-server/server/client.go:3421 +0xabe
github.com/nats-io/nats-server/v2/server.(*client).processMsgResults(0xc0001d4c80, 0xc0001c2280, 0xc0001ef3e0, {0xc0003cc240, 0x102, 0x120}, {0x0, 0x0, 0x243fb484c00?}, {0xc000510120, ...}, ...)
        C:/nats/temp/nats-server/server/client.go:4473 +0xb12
github.com/nats-io/nats-server/v2/server.(*client).processServiceImport(0xc0001d4c80, 0xc00015c480, 0xc0001c2000, {0xc00008255b, 0x83, 0xa5})
        C:/nats/temp/nats-server/server/client.go:4258 +0x11be
github.com/nats-io/nats-server/v2/server.(*Account).addServiceImportSub.func1(0xc0004a3018?, 0xb02705?, 0x0?, {0x1?, 0x0?}, {0x0?, 0x0?}, {0xc00008255b, 0x83, 0xa5})
        C:/nats/temp/nats-server/server/accounts.go:1993 +0x32
github.com/nats-io/nats-server/v2/server.(*client).deliverMsg(0xc0001d4c80, 0x0, 0xc0001f0000, 0x3100000020?, {0xc000082504, 0x1c, 0xfc}, {0xc000082521, 0x34, 0xdf}, ...)
        C:/nats/temp/nats-server/server/client.go:3419 +0xb69
github.com/nats-io/nats-server/v2/server.(*client).processMsgResults(0xc0001d4c80, 0xc0001c2000, 0xc0001ef050, {0xc00008255b, 0x83, 0xa5}, {0x0, 0x0, 0xc00006ab40?}, {0xc000082504, ...}, ...)
        C:/nats/temp/nats-server/server/client.go:4473 +0xb12
github.com/nats-io/nats-server/v2/server.(*client).processInboundClientMsg(0xc0001d4c80, {0xc00008255b, 0x83, 0xa5})
        C:/nats/temp/nats-server/server/client.go:3893 +0xc8c
github.com/nats-io/nats-server/v2/server.(*client).processInboundMsg(0xc0001d4c80?, {0xc00008255b?, 0x83?, 0xa5?})
        C:/nats/temp/nats-server/server/client.go:3732 +0x3d
github.com/nats-io/nats-server/v2/server.(*client).parse(0xc0001d4c80, {0xc000082500, 0xde, 0x100})
        C:/nats/temp/nats-server/server/parser.go:497 +0x210a
github.com/nats-io/nats-server/v2/server.(*client).readLoop(0xc0001d4c80, {0x0, 0x0, 0x0})
        C:/nats/temp/nats-server/server/client.go:1373 +0x1305
github.com/nats-io/nats-server/v2/server.(*Server).createClientEx.func1()
        C:/nats/temp/nats-server/server/server.go:3130 +0x29
github.com/nats-io/nats-server/v2/server.(*Server).startGoRoutine.func1()
        C:/nats/temp/nats-server/server/server.go:3607 +0x1bd
created by github.com/nats-io/nats-server/v2/server.(*Server).startGoRoutine
        C:/nats/temp/nats-server/server/server.go:3603 +0x265
```

Signed-off-by: Neil Twigg <neil@nats.io>
2023-08-11 15:09:16 +01:00
2023-08-07 17:12:20 -07:00
2021-07-13 10:07:31 +02:00
2023-08-07 17:12:20 -07:00
2023-07-21 16:56:13 -07:00
2023-08-07 17:12:20 -07:00
2022-08-03 14:01:55 -07:00
2018-03-15 11:38:25 -07:00
2022-08-16 16:48:00 -06:00
2023-07-23 11:43:51 -07:00
2023-07-23 11:43:51 -07:00
2020-11-10 10:40:28 -06:00
2018-03-15 22:31:07 -07:00
2023-03-17 15:09:50 -07:00
2020-06-22 11:10:49 -05:00
2023-08-04 10:11:06 -04:00

NATS Logo

NATS is a simple, secure and performant communications system for digital systems, services and devices. NATS is part of the Cloud Native Computing Foundation (CNCF). NATS has over 40 client language implementations, and its server can run on-premise, in the cloud, at the edge, and even on a Raspberry Pi. NATS can secure and simplify design and operation of modern distributed systems.

License Build Release Slack Coverage Docker Downloads CII Best Practices

Documentation

Contact

  • Twitter: Follow us on Twitter!
  • Google Groups: Where you can ask questions
  • Slack: Click here to join. You can ask question to our maintainers and to the rich and active community.

Contributing

If you are interested in contributing to NATS, read about our...

Roadmap

The NATS product roadmap can be found here.

Security

Security Audit

A third party security audit was performed by Cure53, you can see the full report here.

Reporting Security Vulnerabilities

If you've found a vulnerability or a potential vulnerability in the NATS server, please let us know at nats-security.

License

Unless otherwise noted, the NATS source files are distributed under the Apache Version 2.0 license found in the LICENSE file.

Description
No description provided
Readme Apache-2.0 33 MiB
Languages
Go 99.6%
Shell 0.4%