nextcloud / nextcloud/nextcloudpi

NCP 1.55.1 Raspi4 image: impossible to use USB stick; never mounted; saves "USBdrive" to SD card

Open
#1,982 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

has-updates
Dominant language
Shell
Stars
2.9k
Forks
318
PR merge metrics
No merged PRs in 30d

Description

System information

NextcloudPi version v1.55.1
NextcloudPi image
OS Armbian-unofficial 24.8.2 Bookworm \l . 6.6.45-current-bcm2711 (aarch64)
automount yes
USB devices sda
datadir /media/USBdrive/ncdata/data
data in SD yes
data filesystem ext2/ext3
data disk usage 4.5G/29G
rootfs usage 4.5G/29G
swapfile /var/swap
dbdir /media/pendrive/ncdatabase
Nextcloud check ok
Nextcloud version 29.0.4.1
HTTPD service up
PHP service up
MariaDB service up
Redis service up
HPB service up
Postfix service down
Internet check ok
Public IPv4 REMOVED SENSITIVE VALUE
Public IPv6 REMOVED SENSITIVE VALUE
Port 80 open
Port 443 open
IP REMOVED SENSITIVE VALUE
Gateway REMOVED SENSITIVE VALUE
Interface end0
Certificates REMOVED SENSITIVE VALUE
NAT loopback no
Uptime 2:25

Problem appears in first minutes of setting up new instance from a SD card which was imaged with official NCP image on Raspi 4.
So I am not getting anywhere.
I want to have the OS and NCP on SD card and data and db on a USB drive.

Even though I let the wizard format my USB drive (sda1) and I ask it to move data to my USB drive, it actually does not.
NCP does create a folder called "media/USBdrive" but actually it still resides on the SD card. This took me quite some effort to realize.
The physical sda USB stick is never mounted automatically by NCP.

Even when I mount it manually to a folder media/pendrive it all doesnt work as I can not shift the data dircetory there. See:

[ nc-datadir ] (Sun Sep 22 20:34:39 UTC 2024)
Maintenance mode enabled
moving data directory from /media/USBdrive/ncdata/data to /media/pendrive/ncdata...
BTRFS filesystem detected
Create subvolume '/media/pendrive/ncdata'
{"reqId":"o4ji31NuJK0u90YEXkev","level":2,"time":"2024-09-22T20:34:43+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /media/USBdrive/ncdata/data/tmp is not present or writable","userAgent":"--","version":"29.0.4.1","data":[]}
Nextcloud is in maintenance mode, no apps are loaded.
Commands provided by apps are unavailable.
Your data directory is invalid.
Ensure there is a file called ".ocdata" in the root of the data directory.

Cannot create "data" directory.
This can usually be fixed by giving the web server write access to the root directory. See https://docs.nextcloud.com/server/29/go.php?to=admin-dir_permissions

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:167
Stack trace:
#0 /var/www/nextcloud/console.php(101): OC\Console\Application->loadCommands()
#1 /var/www/nextcloud/occ(11): require_once('...')
#2 {main}
Nextcloud is in maintenance mode, no apps are loaded.
Commands provided by apps are unavailable.
System config value logfile set to string /media/pendrive/ncdata/data/nextcloud.log
Nextcloud is in maintenance mode, no apps are loaded.
Commands provided by apps are unavailable.
System config value tempdirectory set to string /media/pendrive/ncdata/data/tmp
Installing template 'php/opcache.ini.sh'...
Maintenance mode disabled
Installing template 'ncp-metrics.cfg.sh'...
The NC data directory has been moved successfully.

When I try to upload any file it fails with error.

As a consequence I am totally unable to create a working NCP instance unless I leave everything on the SD card forever.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the fresh SD-card setup on a Raspberry Pi 4 using the NCP 1.55.1 image, then trace the automount and data-directory move involving sda1, /media/USBdrive, /media/pendrive, and the nc-datadir command. Done means the USB drive mounts automatically, data and the database remain on it, and file uploads succeed after migration.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, raspberry-pi, shell
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.