opencloud icon indicating copy to clipboard operation
opencloud copied to clipboard

Server panic in CI: nil pointer dereference in Blobstore.Upload during file write

Open ScharfViktor opened this issue 2 months ago • 1 comments

I noticed server crash in CI while running tests here #1605 https://ci.opencloud.eu/repos/3/pipeline/502/80

The tests were successfully rerun and the error did not recur.

2025/10/06 14:18:31 /root/.opencloud/storage/users/users/e400d0e5-2e2d-4b0e-95f1-cf5471229493/,DELETE,test.txt
2025/10/06 14:18:31 /root/.opencloud/storage/users/users/e400d0e5-2e2d-4b0e-95f1-cf5471229493/,CREATE,test.txt
2025/10/06 14:18:31 /root/.opencloud/storage/users/users/e400d0e5-2e2d-4b0e-95f1-cf5471229493/,"CLOSE_WRITE,CLOSE",test.txt
2025/10/06 14:18:31 /root/.opencloud/storage/users/users/e400d0e5-2e2d-4b0e-95f1-cf5471229493/.oc-nodes/locks/,"CLOSE_WRITE,CLOSE",8e773c2c-680f-4874-9a36-361da7fb465c.mlock
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x1d225ce]

goroutine 890 [running]:
github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/blobstore.(*Blobstore).Upload(0x0?, 0xc00234a840, {0xc0015588c0, 0x4b}, {0x0, 0x0})
	/go/src/github.com/opencloud-eu/opencloud/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/blobstore/blobstore.go:72 +0x20e
github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/tree.(*Tree).WriteBlob(0xc002c296f8?, 0x5298a18?, {0xc0015588c0?, 0x39c9b40?})
	/go/src/github.com/opencloud-eu/opencloud/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/tree/tree.go:617 +0xed
github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/upload.(*DecomposedFsSession).Finalize(0xc002250a20, {0x5298a18?, 0xc00237a5a0?})
	/go/src/github.com/opencloud-eu/opencloud/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/upload/upload.go:304 +0x3d6
github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs.(*Decomposedfs).Postprocessing(0xc0020a2180, 0xc0014a7260)
	/go/src/github.com/opencloud-eu/opencloud/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/decomposedfs.go:320 +0xa59
created by github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs.New in goroutine 882
	/go/src/github.com/opencloud-eu/opencloud/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/decomposedfs.go:266 +0xb9f
2025/10/06 14:18:31 [ocwrapper] opencloud server exited with code 2
2025/10/06 14:18:31 [ocwrapper] Retry starting opencloud server... (retry 1)
2025/10/06 14:18:32 [ocwrapper] Stopping OpenCloud server...
{"level":"error","error":"error connecting to nats cluster opencloud-cluster: error connecting to nats at 127.0.0.1:9233 with tls enabled (false): nats: no servers available for connection","time":"2025-10-06T14:18:33Z","caller":"/go/src/github.com/opencloud-eu/opencloud/vendor/github.com/cenkalti/backoff/retry.go:24","message":"can't connect to nats (jetstream) server, retrying in 1.20710111s"}
{"level":"error","error":"error connecting to nats cluster opencloud-cluster: error connecting to nats at 127.0.0.1:9233 with tls enabled (false): nats: no servers available for connection","time":"2025-10-06T14:18:35Z","caller":"/go/src/github.com/opencloud-eu/opencloud/vendor/github.com/cenkalti/backoff/retry.go:24","message":"can't connect to nats (jetstream) server, retrying in 2.719140608s"}

CC @rhafer

ScharfViktor avatar Oct 07 '25 07:10 ScharfViktor

I was not able to reproduce it, @ScharfViktor do you have any recent builds where this reoccured?

dragonchaser avatar Nov 18 '25 16:11 dragonchaser