Nas backup restore fails if the backup repository mount options have a trailing space
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend, infrastructure
Research direction
Start at LibvirtRestoreBackupCommandWrapper and inspect how mountOptions are passed to Script.executeCommand; compare this with the shell handling in nasbackup.sh. Reproduce the restore using a repository option with trailing whitespace, then verify the restore succeeds and the existing mount command behavior remains intact.
Written by the indexing model from the issue text.
Description
problem
Backup works because mount options are processed inside the shell script nasbackup.sh where trailing spaces are not a problem.
But restore (LibvirtRestoreBackupCommandWrapper) builds and runs mount in Java
if (StringUtils.isNotBlank(mountOptions)) {
mountCmd.add("-o");
mountCmd.add(mountOptions);
}
Script.executeCommand(mountCmd.toArray(new String[0]));
Script.executeCommand(String...) builds a ProcessBuilder argument list
mount receives the literal -o "vers=4.1 ". libmount splits options only on commas, so the trailing blank stays glued to the last option, and mount.nfs/the kernel rejects it as a malformed or unknown option ("an incorrect mount option was specified").
WARN utils.script.Script (logid:435302bd) Process [445800] for command [sudo /usr/bin/mount -t nfs <redacted> encountered the error: [mount.nfs: an incorrect mount option was specified for /usr/share/cloudstack-agent/tmp/csbackup...
versions
ACS 4.22.1
The steps to reproduce the bug
- Create a backup repository - specify mount options (
vers=4.1) with a trailing space - Create backup
- Restore backup - it fails
...
What to do about it?
Trim trailing whitespaces before using the mount options
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 1.4k
- Avg merge
- 7d 5h
- Merged PRs (30d)
- 28
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/cloudstack
-
bug component:kubernetes
Difficulty 1/5 Under an hour Newbie friendliness 88/100
apache/cloudstack#14180 ·
-
bug component:projects component:UI
Difficulty 1/5 Under an hour Newbie friendliness 88/100
apache/cloudstack#14070 · 5 comments ·
-
KVM agent fails to connect to Ceph RBD storage pool after upgrading Ceph client to Tentacle 20.2.4 Openbug component:ceph
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/cloudstack#13989 · 3 comments ·
-
component:UI
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/cloudstack#13944 · 3 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/cloudstack#13921 ·
All issues in apache/cloudstack
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100