Product: Couchbase Server
Component: tools
Issue Link: MB-65491
Affects Version(s): 7.0.x, 7.1.x, 7.2.x, 7.6.x
Fix Version(s): 8.0.0Summary
- When the
cbbackupmgrtool does not have sufficient permissions to access the backup stats directory (e.g.,/data/staging/archive/logs/stats) within the backup staging directory, the stats collector will fail with a panic error.
Symptoms
- cbbackupmgr crashes with a panic when backups are attempted, resulting in failing backups.
Triggers
- This issue gets triggered when cbbackupmgr executes a backup that does not have permissions to access the stats directory(e.g., /data/staging/archive/logs/stats) in the backup staging directory.
Verification
- Look for the following messages indicating the stats collector failed to create a new directory in the cbbackupmgr logs:
2025-02-06T10:24:49.355+00:00 WARN: (Stats) Failed to create stat collector: failed to create 'stats' directory: chmod /data/staging/archive/logs/stats: operation not permitted -- main.startStatCollector() at stats.go:25- Look for the following panic messages in the cbbackupmgr logs:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0x1539277]
goroutine 1 [running]:
github.com/couchbase/backup/stats.(*Aggregator).Start(0x0)
/home/couchbase/jenkins/workspace/couchbase-server-unix/backup/stats/stats.go:93 +0x17
main.startStatCollector(0xc0007ae0f0?, {0x1b545dd?, 0x1b77001?}, {0x7fffc0b8dbf5?, 0xc00005962c?})
backup/cmd/cbbackupmgr/stats.go:28 +0xf0
main.(*BackupContext).Run(0xc000a8a000)
backup/cmd/cbbackupmgr/backup.go:283 +0x182e
github.com/couchbase/cbflag.(*Command).parseFlags(0xc000902070, 0xc0007cd1c0, {0xc000130020, 0x12, 0x17638c0?})
/home/couchbase/.cbdepscache/gomodcache/pkg/mod/github.com/couchbase/cbflag@v0.0.0-20220325172535-f0f642f857ed/command.go:283 +0x10de
github.com/couchbase/cbflag.(*Command).parse(0xc000902070, 0xc0007cd1c0, {0xc000130020?, 0x12, 0x12})
/home/couchbase/.cbdepscache/gomodcache/pkg/mod/github.com/couchbase/cbflag@v0.0.0-20220325172535-f0f642f857ed/command.go:111 +0x12a
github.com/couchbase/cbflag.(*Command).parseCommands(0xc000902bd0, 0xc0007cd1c0, {0xc000130010, 0x13, 0x13})
/home/couchbase/.cbdepscache/gomodcache/pkg/mod/github.com/couchbase/cbflag@v0.0.0-20220325172535-f0f642f857ed/command.go:124 +0x19e
github.com/couchbase/cbflag.(*Command).parse(0xc000902bd0, 0xc0007cd1c0, {0xc000130010?, 0x13, 0x13})
/home/couchbase/.cbdepscache/gomodcache/pkg/mod/github.com/couchbase/cbflag@v0.0.0-20220325172535-f0f642f857ed/command.go:109 +0x13d
github.com/couchbase/cbflag.(*CLI).Parse(0xc000905c80, {0xc000130000, 0x14, 0x14})
/home/couchbase/.cbdepscache/gomodcache/pkg/mod/github.com/couchbase/cbflag@v0.0.0-20220325172535-f0f642f857ed/cli.go:70 +0x15c
main.main()
backup/cmd/cbbackupmgr/main.go:4116 +0xd677Workarounds
- Run the cbbackupmgr command as a root user (sudo cbbackupmgr backup) or change the ownership (chown) of the files/directories under the staging directory (e.g.,/data/staging/archive) to the user you are running the backup as. We recommend the second method as a more secure one.
Comments
0 comments
Article is closed for comments.