nextcloud / nextcloud/nextcloudpi
Restore broken ncp-restore MariaDB Dump 999999 sandbox invalid command / at line 1
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 2.9k
- Forks
- 318
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
restoring my full ncp-backup from NextcloudPi 1.55.3 on arm32 bulleseye on NextcloudPi v1.55.3 -
v24.11.1 for Raspberry Pi 4 running Armbian Linux 6.6.63-current-bcm2711 stopped.
My files had been restored. The backup was broken while restoring db-dump with "... invalid command at line 1".
If found Compatibility Change the current Armbian with Bookworm is running mariadb 10.11.6-0+deb12u1, as wirtten in the link, the client does not know the 1st line "/999999.*sandbox", my old arm32 version had this security feature implemented, the version 10.11.6 is missing it.
My workaround was patching /usr/local/bin/ncp-restore with as suggested in the link comments.
sed -i '1{/999999.sandbox/d}' "$TEMPDIR"/nextcloud-sqlbkp_.bak
sed -i '1{/999999.*sandbox/d}' "$TEMPDIR"/nextcloud-sqlbkp_*.bak
mysql -u root nextcloud < "$TEMPDIR"/nextcloud-sqlbkp_*.bak || { echo "Error restoring nextcloud database"; exit 1; }
## RESTORE DATADIR
I'll leave this information here, if some one has the same problem. For me we can close this issue ;-)
I'm not sure (it's a rare case) if it's worth to be fixed.
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.
Research direction
Inspect /usr/local/bin/ncp-restore, focusing on the MariaDB dump restore command and the temporary backup file it imports. Review the linked MariaDB compatibility change and test the restore path with the affected dump format and client versions. Done means the database restore succeeds without the reported invalid-command error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, mariadb, shell
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100