Newb here and I’ve installed Owncloud on my Mac using Docker. I would like to copy a bunch of files to the files folder and then use OCC files:scan to update the database. Does anyone know the proper command to update the files.
When I type:
sudo -u www-data php occ files:scan --all
I get:
sudo: unknown user: www-data
sudo: unable to initialize policy plugin
thanks very much for the answer, this is what happened when i entered that:
PHP Warning: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Users/yoda/.owncloud_docker/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 43
PHP Warning: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Users/yoda/.owncloud_docker/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 43
An unhandled exception has been thrown:
exception ‘Doctrine\DBAL\DBALException’ with message ‘Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known’ in /Users/yoda/.owncloud_docker/lib/private/DB/Connection.php:62
#28 {main}PHP Warning: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Users/yoda/.owncloud_docker/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 43
PHP Fatal error: Uncaught exception ‘Doctrine\DBAL\DBALException’ with message ‘Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known’ in /Users/yoda/.owncloud_docker/lib/private/DB/Connection.php:62
Are you using docker compose? I recommend the following command on the docker0 (the host machine) if you are:
docker-compose exec owncloud occ files:scan --all
As the docker container is using a bunch of environment variables that need to be populated for the occ command to work. The docker-compose command is taking care of that.