Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres installation with occ tool fails #2683

Closed
nebulade opened this issue Dec 14, 2016 · 3 comments
Closed

Postgres installation with occ tool fails #2683

nebulade opened this issue Dec 14, 2016 · 3 comments

Comments

@nebulade
Copy link

Installing nextcloud on vanilla ubuntu 16.04 with postgres 9.4.4 and a freshly downloaded nextcloud 11 tarball.

Using occ maintenance:install breaks with the following error:

php /app/code/occ  maintenance:install --database "pgsql" --database-name "${POSTGRESQL_DATABASE}"  --database-user "${POSTGRESQL_USERNAME}" --database-pass "${POSTGRESQL_PASSWORD}" --database-host "${POSTGRESQL_HOST}" --database-port ${POSTGRESQL_PORT} --admin-user "admin" --admin-pass "changeme" --data-dir "/app/data" -n
Nextcloud is not installed - only a limited number of commands are available
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OC\DB\ConnectionFactory::__construct() must implement interface OCP\IConfig, none given, called in /app/code/lib/private/Setup/AbstractDatabase.php on line 139 and defined in /app/code/lib/private/DB/ConnectionFactory.php:68
Stack trace:
#0 /app/code/lib/private/Setup/AbstractDatabase.php(139): OC\DB\ConnectionFactory->__construct()
#1 /app/code/lib/private/Setup/PostgreSQL.php(41): OC\Setup\AbstractDatabase->connect(Array)
#2 /app/code/lib/private/Setup.php(332): OC\Setup\PostgreSQL->setupDatabase('admin')
#3 /app/code/core/Command/Maintenance/Install.php(91): OC\Setup->install(Array)
#4 /app/code/3rdparty/symfony/console/Command/Command.php(256): OC\Core\Command\Maintenance\Install->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /app/code/3rdparty/symfony/console/Application.php(818): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /app/code/3rdparty/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Install), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /app/code/3rdparty/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /app/code/lib/private/Console/Application.php(169): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /app/code/console.php(90): OC\Console\Application->run()
#10 /app/code/occ(11): require_once('/app/code/conso...')

The very same command works fine with nextcloud 10.0.1. The postgres env vars are valid, tested with PGPASSWORD=${POSTGRESQL_PASSWORD} psql -h ${POSTGRESQL_HOST} -p ${POSTGRESQL_PORT} -U ${POSTGRESQL_USERNAME} -d ${POSTGRESQL_DATABASE}

The database exists already.

Let me know if further information is required.

@nebulade
Copy link
Author

Actually the same happens with mysql:

php /app/code/occ  maintenance:install --database "mysql" --database-name "${MYSQL_DATABASE}"  --database-user "${MYSQL_USERNAME}" --database-pass "${MYSQL_PASSWORD}" --database-host "${MYSQL_HOST}" --database-port ${MYSQL_PORT} --admin-user "admin" --admin-pass "changeme" --data-dir "/app/data" -n
Nextcloud is not installed - only a limited number of commands are available
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OC\DB\ConnectionFactory::__construct() must implement interface OCP\IConfig, none given, called in /app/code/lib/private/Setup/AbstractDatabase.php on line 139 and defined in /app/code/lib/private/DB/ConnectionFactory.php:68
Stack trace:
#0 /app/code/lib/private/Setup/AbstractDatabase.php(139): OC\DB\ConnectionFactory->__construct()
#1 /app/code/lib/private/Setup/MySQL.php(38): OC\Setup\AbstractDatabase->connect()
#2 /app/code/lib/private/Setup.php(332): OC\Setup\MySQL->setupDatabase('admin')
#3 /app/code/core/Command/Maintenance/Install.php(91): OC\Setup->install(Array)
#4 /app/code/3rdparty/symfony/console/Command/Command.php(256): OC\Core\Command\Maintenance\Install->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /app/code/3rdparty/symfony/console/Application.php(818): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /app/code/3rdparty/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Install), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /app/code/3rdparty/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /app/code/lib/private/Console/Application.php(169): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /app/code/console.php(90): OC\Console\Application->run()
#10 /app/code/occ(11): require_once('/app/code/conso...')

@nickvergessen
Copy link
Member

Can you make sure that your the Setup folder was replaced correctly and Setup/AbstractDatabase.php in line 139 says $cf = new ConnectionFactory($this->config);

@nebulade
Copy link
Author

Indeed, it was a packaging error on my side. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants