Error output when passing --data-dir during command line installation #23637

Closed
enoch85 opened this Issue Mar 30, 2016 · 22 comments

Projects

None yet

4 participants

@enoch85
Member
enoch85 commented Mar 30, 2016 edited

Steps to reproduce

Basically, install ownCloud via CLI.

  1. Use this script
  2. Install ownCloud with --^ script

(Change --data-dir to something else other than /var/www/owncloud/data)

https://doc.owncloud.org/server/8.2/admin_manual/configuration_server/occ_command.html#command-line-installation

Expected behaviour

No error output

Actual behaviour

OwnCloud installs fine, but I get this error output during install:

ownCloud is not installed - only a limited number of commands are available
{"reqId":"mWcNULK3K9oZiXs7OLp1","remoteAddr":"","app":"PHP","message":"Undefined offset: 0 at \/var\/www\/owncloud\/lib\/private\/setup\/mysql.php#46","level":3,"time":"2016-03-30T00:48:11+00:00","method":"--","url":"--","user":"--"}
{"reqId":"mWcNULK3K9oZiXs7OLp1","remoteAddr":"","app":"no app in context","message":"Exception: {\"Exception\":\"DomainException\",\"Message\":\"Contacts tables are missing. Nothing to do.\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/migration\\\/migrateaddressbooks.php(83): OCA\\\\Dav\\\\Migration\\\\AddressBookAdapter->setup()\\n#1 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/application.php(186): OCA\\\\Dav\\\\Migration\\\\MigrateAddressbooks->setup()\\n#2 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/install.php(26): OCA\\\\Dav\\\\AppInfo\\\\Application->migrateAddressbooks()\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/installer.php(636): include('\\\/var\\\/www\\\/ownclo...')\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/installer.php(587): OC_Installer::includeAppScript('\\\/var\\\/www\\\/ownclo...')\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/installer.php(558): OC_Installer::installShippedApp('dav')\\n#6 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/setup.php(370): OC_Installer::installShippedApps()\\n#7 \\\/var\\\/www\\\/owncloud\\\/core\\\/command\\\/maintenance\\\/install.php(84): OC\\\\Setup->install(Array)\\n#8 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/symfony\\\/console\\\/Command\\\/Command.php(259): OC\\\\Core\\\\Command\\\\Maintenance\\\\Install->execute(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#9 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(840): Symfony\\\\Component\\\\Console\\\\Command\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#10 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(192): Symfony\\\\Component\\\\Console\\\\Application->doRunCommand(Object(OC\\\\Core\\\\Command\\\\Maintenance\\\\Install), Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#11 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(123): Symfony\\\\Component\\\\Console\\\\Application->doRun(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#12 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/console\\\/application.php(145): Symfony\\\\Component\\\\Console\\\\Application->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#13 \\\/var\\\/www\\\/owncloud\\\/console.php(88): OC\\\\Console\\\\Application->run()\\n#14 \\\/var\\\/www\\\/owncloud\\\/occ(11): require_once('\\\/var\\\/www\\\/ownclo...')\\n#15 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/migration\\\/addressbookadapter.php\",\"Line\":72}","level":3,"time":"2016-03-30T00:48:13+00:00","method":"--","url":"--","user":"--"}
{"reqId":"mWcNULK3K9oZiXs7OLp1","remoteAddr":"","app":"no app in context","message":"Exception: {\"Exception\":\"DomainException\",\"Message\":\"Calendar tables are missing. Nothing to do.\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/migration\\\/migratecalendars.php(84): OCA\\\\Dav\\\\Migration\\\\CalendarAdapter->setup()\\n#1 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/application.php(202): OCA\\\\Dav\\\\Migration\\\\MigrateCalendars->setup()\\n#2 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/install.php(27): OCA\\\\Dav\\\\AppInfo\\\\Application->migrateCalendars()\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/installer.php(636): include('\\\/var\\\/www\\\/ownclo...')\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/installer.php(587): OC_Installer::includeAppScript('\\\/var\\\/www\\\/ownclo...')\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/installer.php(558): OC_Installer::installShippedApp('dav')\\n#6 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/setup.php(370): OC_Installer::installShippedApps()\\n#7 \\\/var\\\/www\\\/owncloud\\\/core\\\/command\\\/maintenance\\\/install.php(84): OC\\\\Setup->install(Array)\\n#8 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/symfony\\\/console\\\/Command\\\/Command.php(259): OC\\\\Core\\\\Command\\\\Maintenance\\\\Install->execute(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#9 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(840): Symfony\\\\Component\\\\Console\\\\Command\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#10 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(192): Symfony\\\\Component\\\\Console\\\\Application->doRunCommand(Object(OC\\\\Core\\\\Command\\\\Maintenance\\\\Install), Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#11 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(123): Symfony\\\\Component\\\\Console\\\\Application->doRun(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#12 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/console\\\/application.php(145): Symfony\\\\Component\\\\Console\\\\Application->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#13 \\\/var\\\/www\\\/owncloud\\\/console.php(88): OC\\\\Console\\\\Application->run()\\n#14 \\\/var\\\/www\\\/owncloud\\\/occ(11): require_once('\\\/var\\\/www\\\/ownclo...')\\n#15 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/migration\\\/calendaradapter.php\",\"Line\":68}","level":3,"time":"2016-03-30T00:48:13+00:00","method":"--","url":"--","user":"--"}
ownCloud was successfully installed
{"reqId":"mWcNULK3K9oZiXs7OLp1","remoteAddr":"","app":"PHP","message":"chmod(): No such file or directory at \/var\/www\/owncloud\/lib\/private\/log\/owncloud.php#112","level":3,"time":"2016-03-30T00:48:13+00:00","method":"--","url":"--","user":"ocadmin"}

ownCloud version:
  - installed: true
  - version: 9.0.1.1
  - versionstring: 9.0.1 RC1
  - edition: 

Server configuration

Operating system:
Ubuntu Server 14.04
Web server:
Apache 2.4
Database:
MySQL 5.6
PHP version:
7
ownCloud version: (see ownCloud admin page)
9.0.1-RC1
Updated from an older ownCloud or fresh install:
New
Where did you install ownCloud from:
ZIP package from ownCloud

Logs

No logs

@enoch85
Member
enoch85 commented Mar 30, 2016

@DeepDiver1975 Any thoughts?

@Xenopathic
Member

Could you try replacing this line (https://github.com/owncloud/core/blob/master/lib/private/setup/mysql.php#L46) with the following:

if (!$row or $row[0] == 0) {

i.e. s/result/row/ on that line

@enoch85
Member
enoch85 commented Mar 30, 2016

@Xenopathic Thanks, will try. Want to debug this with me tonite? Will be trying for one more hour. I'm enoch85 @ IRC.

@enoch85
Member
enoch85 commented Mar 30, 2016 edited

@Xenopathic That gives me the same output, I think:

ownCloud is not installed - only a limited number of commands are available
{"reqId":"VPaNQo6uOLbk4fakRtTi","remoteAddr":"","app":"PHP","message":"Undefined offset: 0 at /var/www/owncloud/lib/private/setup/mysql.php#46","level":3,"time":"2016-03-30T22:11:56+00:00","method":"--","url":"--","user":"--"}
{"reqId":"VPaNQo6uOLbk4fakRtTi","remoteAddr":"","app":"no app in context","message":"Exception: {"Exception":"DomainException","Message":"Contacts tables are missing. Nothing to do.","Code":0,"Trace":"
#0 /var/www/owncloud/apps/dav/lib/migration/migrateaddressbooks.php(83): OCA\Dav\Migration\AddressBookAdapter->setup()
#1 /var/www/owncloud/apps/dav/appinfo/application.php(186): OCA\Dav\Migration\MigrateAddressbooks->setup()
#2 /var/www/owncloud/apps/dav/appinfo/install.php(26): OCA\Dav\AppInfo\Application->migrateAddressbooks()
#3 /var/www/owncloud/lib/private/installer.php(636): include('/var/www/ownclo...')
#4 /var/www/owncloud/lib/private/installer.php(587): OC_Installer::includeAppScript('/var/www/ownclo...')
#5 /var/www/owncloud/lib/private/installer.php(558): OC_Installer::installShippedApp('dav')
#6 /var/www/owncloud/lib/private/setup.php(370): OC_Installer::installShippedApps()
#7 /var/www/owncloud/core/command/maintenance/install.php(84): OC\Setup->install(Array)
#8 /var/www/owncloud/3rdparty/symfony/console/Command/Command.php(259): OC\Core\Command\Maintenance\Install->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/owncloud/3rdparty/symfony/console/Application.php(840): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/owncloud/3rdparty/symfony/console/Application.php(192): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Install), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/owncloud/3rdparty/symfony/console/Application.php(123): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/owncloud/lib/private/console/application.php(145): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/owncloud/console.php(88): OC\Console\Application->run()
#14 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#15 {main}","File":"/var/www/owncloud/apps/dav/lib/migration/addressbookadapter.php","Line":72}","level":3,"time":"2016-03-30T22:11:57+00:00","method":"--","url":"--","user":"--"}
{"reqId":"VPaNQo6uOLbk4fakRtTi","remoteAddr":"","app":"no app in context","message":"Exception: {"Exception":"DomainException","Message":"Calendar tables are missing. Nothing to do.","Code":0,"Trace":"
#0 /var/www/owncloud/apps/dav/lib/migration/migratecalendars.php(84): OCA\Dav\Migration\CalendarAdapter->setup()
#1 /var/www/owncloud/apps/dav/appinfo/application.php(202): OCA\Dav\Migration\MigrateCalendars->setup()
#2 /var/www/owncloud/apps/dav/appinfo/install.php(27): OCA\Dav\AppInfo\Application->migrateCalendars()
#3 /var/www/owncloud/lib/private/installer.php(636): include('/var/www/ownclo...')
#4 /var/www/owncloud/lib/private/installer.php(587): OC_Installer::includeAppScript('/var/www/ownclo...')
#5 /var/www/owncloud/lib/private/installer.php(558): OC_Installer::installShippedApp('dav')
#6 /var/www/owncloud/lib/private/setup.php(370): OC_Installer::installShippedApps()
#7 /var/www/owncloud/core/command/maintenance/install.php(84): OC\Setup->install(Array)
#8 /var/www/owncloud/3rdparty/symfony/console/Command/Command.php(259): OC\Core\Command\Maintenance\Install->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/owncloud/3rdparty/symfony/console/Application.php(840): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/owncloud/3rdparty/symfony/console/Application.php(192): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Install), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/owncloud/3rdparty/symfony/console/Application.php(123): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/owncloud/lib/private/console/application.php(145): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/owncloud/console.php(88): OC\Console\Application->run()
#14 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#15 {main}","File":"/var/www/owncloud/apps/dav/lib/migration/calendaradapter.php","Line":68}","level":3,"time":"2016-03-30T22:11:57+00:00","method":"--","url":"--","user":"--"}
ownCloud was successfully installed
{"reqId":"VPaNQo6uOLbk4fakRtTi","remoteAddr":"","app":"PHP","message":"chmod(): No such file or directory at /var/www/owncloud/lib/private/log/owncloud.php#112","level":3,"time":"2016-03-30T22:11:57+00:00","method":"--","url":"--","user":"ocadmin"}

Next step? :)

Btw, if i change $OCDATA to /var/www/owncloud/data the error disappears, so something is happening when I change the data dir.

@enoch85 enoch85 changed the title from Error output during command line installation to Error output when passing --data-dir during command line installation Mar 30, 2016
@Xenopathic
Member

It's that "Undefined offset" error that I was trying to fix - as far as I can tell that line is supposed to check if the ownCloud tables have been installed, and if they haven't, install them. Since the DB isn't being properly populated, you then get the cascade of errors with missing tables.

If you can, put some var_dump() statements to see the actual value of $row at that point in the script.

@enoch85
Member
enoch85 commented Mar 30, 2016

@Xenopathic PHP? Not my area of expertise. Please join me on IRC, easier to chat there. :)

https://webchat.freenode.net (#owncloud)

@Xenopathic
Member

@enoch85 Sorry, I've got a long trip ahead of me tomorrow morning so can't stay up late tonight.

@enoch85
Member
enoch85 commented Mar 30, 2016

@Xenopathic It's ok. I'm going offline now anyway. We could pick this up later, any help is appreciated.

@enoch85
Member
enoch85 commented Apr 4, 2016

@PVince81 Are you the occ command master? :) I know 9.0.1 is due tomorrow, would be great if a fix for this could go in.

@enoch85
Member
enoch85 commented Apr 4, 2016

cc @DeepDiver1975 as well, as the issues seems related to DAV, Contacts and Calenadar. Maybe @georgehrke because of the Calendar?

@enoch85
Member
enoch85 commented Apr 4, 2016

@Xenopathic Ping on IRC. :)

@enoch85
Member
enoch85 commented Apr 4, 2016

Ok so @Xenopathic fixes work. Any chance we could get this in 9.0.1? Please. :)

@enoch85 enoch85 added 3 - To Review and removed in progress labels Apr 4, 2016
@PVince81 PVince81 added this to the 9.1-current milestone Apr 18, 2016
@PVince81
Collaborator

@Xenopathic can you submit a PR with the suggested change ? Thanks

@Xenopathic
Member

@PVince81 I did (#23790) but @DeepDiver1975 wanted to make a better version... still waiting on that

@enoch85
Member
enoch85 commented May 18, 2016

Any update here @DeepDiver1975?

@PVince81
Collaborator

@DeepDiver1975 can we use the current version instead of waiting for the "better version" ? 😄

@PVince81
Collaborator

From what I see the PRs were merged and @DeepDiver1975 hasn't delivered a "better version".

If the problem is fixed I'm closing this now. Please reopen if you think otherwise.

@PVince81 PVince81 closed this Jun 27, 2016
@enoch85
Member
enoch85 commented Jun 27, 2016

The PR fixing this issue is not merged, just partially. Right @Xenopathic?

@enoch85
Member
enoch85 commented Jun 27, 2016

@PVince81 Please refer to the merged PR.

@PVince81
Collaborator

I thought this #23760 would fix it, it was also backported by you: #23805 and #23807, both merged.

Is the issue still happening ?

@enoch85
Member
enoch85 commented Jun 28, 2016

#23760 was only the MySQL part, but not the whole fix.

Anyway, it's fixed now and there is a PR that will backport the fix as well. Look here #23790 for details.

@DeepDiver1975
Member

Look here #23790 for details.

the backport is here #25279

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