We're using Nextcloud as a file upload/download front-end for a single-user application. This means we are running a Docker image with two volumes attached:
./nextcloud:/var/www/html
./userdata:/var/www/html/data/the_user/files
The userdata volume is attached to another service that creates and removes files from it. Our setup periodically runs files:scan --all to keep Nextcloud up to date.
In prior versions the above setup worked fine. In nextcloud 18, one gets the error Username is invalid because files already exist for this user when creating a user with a data directory that already exists, but creating such a user is exactly my intention.
Steps to reproduce
mkdir -p userdata/stuff && touch userdata/stuff/a_file
docker run --rm --name nextcloud -e POSTGRES_... -v $PWD/nextcloud:/var/www/html -v $PWD/userdata:/var/www/html/data/the_user/files nextcloud:18
docker exec nextcloud php occ maintenance:install
docker exec nextcloud php occ user:add the_user
Expected behaviour
The user is created. The pre-populated user data is found when running php occ files:scan -all.
Actual behaviour
The message Username is invalid because files already exist for this user is printed to stdout.
Server configuration
Operating system: Ubuntu 18
Web server: Apache/2.4.38 (Debian)
Database: postgres 12
PHP version: PHP/7.3.17
Nextcloud version: 18.0.4.2
Questions
- Is there some flag to
user:add that supresses this check and I missed it?
- If not, would such a flag be a welcome addition to nextcloud?
- I can't seem to locate the
if that generates this error in this repository. I wish to remove this check in a fork; can someone point me to the right direction?
- Is there a reason for this changed behaviour?
We're using Nextcloud as a file upload/download front-end for a single-user application. This means we are running a Docker image with two volumes attached:
./nextcloud:/var/www/html./userdata:/var/www/html/data/the_user/filesThe
userdatavolume is attached to another service that creates and removes files from it. Our setup periodically runsfiles:scan --allto keep Nextcloud up to date.In prior versions the above setup worked fine. In nextcloud 18, one gets the error
Username is invalid because files already exist for this userwhen creating a user with a data directory that already exists, but creating such a user is exactly my intention.Steps to reproduce
mkdir -p userdata/stuff && touch userdata/stuff/a_filedocker run --rm --name nextcloud -e POSTGRES_... -v $PWD/nextcloud:/var/www/html -v $PWD/userdata:/var/www/html/data/the_user/files nextcloud:18docker exec nextcloud php occ maintenance:installdocker exec nextcloud php occ user:add the_userExpected behaviour
The user is created. The pre-populated user data is found when running
php occ files:scan -all.Actual behaviour
The message
Username is invalid because files already exist for this useris printed tostdout.Server configuration
Operating system: Ubuntu 18
Web server: Apache/2.4.38 (Debian)
Database: postgres 12
PHP version: PHP/7.3.17
Nextcloud version: 18.0.4.2
Questions
user:addthat supresses this check and I missed it?ifthat generates this error in this repository. I wish to remove this check in a fork; can someone point me to the right direction?