Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NRF panics with [nrf] assignment to entry in nil map #429

Open
gatici opened this issue Dec 5, 2024 · 0 comments · Fixed by omec-project/nrf#160
Open

NRF panics with [nrf] assignment to entry in nil map #429

gatici opened this issue Dec 5, 2024 · 0 comments · Fixed by omec-project/nrf#160
Labels
bug Something isn't working v1.5

Comments

@gatici
Copy link
Contributor

gatici commented Dec 5, 2024

Bug Description

NRF panics with [nrf] assignment to entry in nil map and other NF's can not register.

To Reproduce

Deploy Charmed Ather SD-Core and leave it running. After some time, you will see this error in the NRF logs.

Environment

Juju 3.5.5
Microk8s 1.31

Relevant log output

2024-12-05T10:11:56.398Z [nrf] 2024-12-05T10:11:56.398Z	INFO	producer/nf_management.go:358	nf profile [NSSF] update success	{"component": "NRF", "category": "MGMT"}
2024-12-05T10:11:56.399Z [nrf] 2024-12-05T10:11:56.398Z	INFO	logger/logger.go:92	| 200 |     10.1.146.50 | PATCH   | /nnrf-nfm/v1/nf-instances/3933fba9-1cf2-4112-80e6-f079cdd41283 | 	{"component": "NRF", "category": "GIN"}
2024-12-05T10:11:57.401Z [pebble] Cannot flush logs to target "grafana-agent/0": Post "http://grafana-agent-0.grafana-agent-endpoints.sdcore.svc.cluster.local:3500/loki/api/v1/push": dial tcp 10.1.146.28:3500: connect: connection refused
2024-12-05T10:11:59.544Z [nrf] 2024-12-05T10:11:59.544Z	INFO	producer/nf_management.go:89	Handle UpdateNFInstanceRequest	{"component": "NRF", "category": "MGMT"}
2024-12-05T10:11:59.546Z [nrf] 2024-12-05T10:11:59.546Z	ERROR	logger/logger.go:127	[Debugging] panic:
User-Agent: OpenAPI-Generator/1.0.0/gosonf-nfm/v1/nf-instances/0db6df75-9389-44c2-856b-60aec7b21621 HTTP/2.0
2024-12-05T10:11:59.546Z [nrf] assignment to entry in nil map
2024-12-05T10:11:59.546Z [nrf] goroutine 13779 [running]:
2024-12-05T10:11:59.546Z [nrf] runtime/debug.Stack()
2024-12-05T10:11:59.546Z [nrf] 	/snap/go/10678/src/runtime/debug/stack.go:24 +0x5e
2024-12-05T10:11:59.546Z [nrf] github.com/omec-project/util/logger.NewGinWithZap.ginRecover.func2.1()
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/omec-project/util@v1.2.3/logger/logger.go:112 +0x117
2024-12-05T10:11:59.546Z [nrf] panic({0xe0afc0?, 0x1102da0?})
2024-12-05T10:11:59.546Z [nrf] 	/snap/go/10678/src/runtime/panic.go:914 +0x21f
2024-12-05T10:11:59.546Z [nrf] github.com/evanphx/json-patch.(*partialDoc).set(0xe9e3a0?, {0xc00013f9c8?, 0xf2d4a2?}, 0xc0008ccdb0)
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/evanphx/json-patch@v5.9.0+incompatible/patch.go:385 +0x36
2024-12-05T10:11:59.546Z [nrf] github.com/evanphx/json-patch.Patch.replace({0xc00013f948?, 0x4?, 0x8?}, 0xc000a7d2c0, 0xc00080e120?)
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/evanphx/json-patch@v5.9.0+incompatible/patch.go:605 +0x2e3
2024-12-05T10:11:59.546Z [nrf] github.com/evanphx/json-patch.Patch.ApplyIndent({0xc00080e110?, 0x1, 0x1}, {0xc00013f948, 0x4, 0x8}, {0x0, 0x0})
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/evanphx/json-patch@v5.9.0+incompatible/patch.go:815 +0x30c
2024-12-05T10:11:59.546Z [nrf] github.com/evanphx/json-patch.Patch.Apply(...)
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/evanphx/json-patch@v5.9.0+incompatible/patch.go:781
2024-12-05T10:11:59.546Z [nrf] github.com/omec-project/util/mongoapi.(*MongoClient).RestfulAPIJSONPatch(0xe176e0?, {0xf3b141, 0x9}, 0xc?, {0xc000bc9200, 0x3a, 0x200})
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/omec-project/util@v1.2.3/mongoapi/mongoapi.go:265 +0x1df
2024-12-05T10:11:59.546Z [nrf] github.com/omec-project/nrf/producer.UpdateNFInstanceProcedure({0xc000641e5a, 0x24}, {0xc000bc9200, 0x3a, 0x200})
2024-12-05T10:11:59.546Z [nrf] 	/root/parts/nrf/build/producer/nf_management.go:336 +0xf8
2024-12-05T10:11:59.546Z [nrf] github.com/omec-project/nrf/producer.HandleUpdateNFInstanceRequest(0xc0003182a0)
2024-12-05T10:11:59.546Z [nrf] 	/root/parts/nrf/build/producer/nf_management.go:93 +0xb3
2024-12-05T10:11:59.546Z [nrf] github.com/omec-project/nrf/management.HTTPUpdateNFInstance(0xc00097a700)
2024-12-05T10:11:59.546Z [nrf] 	/root/parts/nrf/build/management/api_nf_instance_id_document.go:148 +0x335
2024-12-05T10:11:59.546Z [nrf] github.com/gin-gonic/gin.(*Context).Next(0xc00097a700)
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
2024-12-05T10:11:59.546Z [nrf] github.com/omec-project/util/logger.NewGinWithZap.ginRecover.func2(0xc0009ee600?)
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/omec-project/util@v1.2.3/logger/logger.go:142 +0x57
2024-12-05T10:11:59.546Z [nrf] github.com/gin-gonic/gin.(*Context).Next(0xc00097a700)
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
2024-12-05T10:11:59.546Z [nrf] github.com/omec-project/util/logger.NewGinWithZap.ginToZap.func1(0xc00097a700)
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/omec-project/util@v1.2.3/logger/logger.go:81 +0x5f
2024-12-05T10:11:59.546Z [nrf] github.com/gin-gonic/gin.(*Context).Next(...)
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
2024-12-05T10:11:59.546Z [nrf] github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc000780340, 0xc00097a700)
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 +0x892
2024-12-05T10:11:59.546Z [nrf] github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc000780340, {0x110ccf0?, 0xc00080e108}, 0xc000986300)
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 +0x1dd
2024-12-05T10:11:59.546Z [nrf] golang.org/x/net/http2/h2c.h2cHandler.ServeHTTP({{0x1105660?, 0xc000780340?}, 0xc000222ee0?}, {0x110ccf0, 0xc00080e108}, 0xc000986300)
2024-12-05T10:11:59.546Z [nrf] 	/root/go/pkg/mod/golang.org/x/net@v0.30.0/http2/h2c/h2c.go:125 +0x699
2024-12-05T10:11:59.546Z [nrf] net/http.serverHandler.ServeHTTP({0x6c9de0?}, {0x110ccf0?, 0xc00080e108?}, 0xc000354460?)
2024-12-05T10:11:59.546Z [nrf] 	/snap/go/10678/src/net/http/server.go:2943 +0x8e
2024-12-05T10:11:59.546Z [nrf] net/http.initALPNRequest.ServeHTTP({{0x110e588?, 0xc000d057d0?}, 0xc0005cf180?, {0xc000452000?}}, {0x110ccf0, 0xc00080e108}, 0xc000986300)
2024-12-05T10:11:59.546Z [nrf] 	/snap/go/10678/src/net/http/server.go:3551 +0x231
2024-12-05T10:11:59.546Z [nrf] net/http.(*http2serverConn).runHandler(0xc00081ad60?, 0x110e518?, 0x17e5cc0?, 0xc000b9fef0?)
2024-12-05T10:11:59.546Z [nrf] 	/snap/go/10678/src/net/http/h2_bundle.go:6232 +0xbb
2024-12-05T10:11:59.546Z [nrf] created by net/http.(*http2serverConn).scheduleHandler in goroutine 11511
2024-12-05T10:11:59.546Z [nrf] 	/snap/go/10678/src/net/http/h2_bundle.go:6167 +0x21d
2024-12-05T10:11:59.546Z [nrf] 	{"component": "NRF", "category": "GIN"}
2024-12-05T10:11:59.546Z [nrf] 2024-12-05T10:11:59.546Z	INFO	logger/logger.go:92	| 500 |     10.1.146.35 | PATCH   | /nnrf-nfm/v1/nf-instances/0db6df75-9389-44c2-856b-60aec7b21621 | 	{"component": "NRF", "category": "GIN"}
2024-12-05T10:11:59.552Z [nrf] 2024-12-05T10:11:59.552Z	INFO	producer/nf_management.go:65	Handle NFRegisterRequest	{"component": "NRF", "category": "MGMT"}
2024-12-05T10:11:59.552Z [nrf] 2024-12-05T10:11:59.552Z	INFO	context/management_data.go:87	HearBeat Timer value: 60 sec	{"component": "NRF", "category": "MGMT"}
2024-12-05T10:11:59.555Z [nrf] 2024-12-05T10:11:59.555Z	INFO	context/management_data.go:452	urilist update	{"component": "NRF", "category": "MGMT"}
2024-12-05T10:11:59.566Z [nrf] 2024-12-05T10:11:59.566Z	INFO	producer/nf_management.go:457	Create NF Profile  AMF	{"component": "NRF", "category": "MGMT"}
2024-12-05T10:11:59.569Z [nrf] 2024-12-05T10:11:59.568Z	INFO	producer/nf_management.go:472	Location header:  https://nrf:29510/nnrf-nfm/v1/nf-instances/0db6df75-9389-44c2-856b-60aec7b21621	{"component": "NRF", "category": "MGMT"}

Additional context

No response

@gatici gatici added bug Something isn't working v1.5 labels Dec 5, 2024
@gatici gatici changed the title NRF panics with NRF errıor [nrf] assignment to entry in nil map NRF panics with [nrf] assignment to entry in nil map Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v1.5
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant