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

Updating NC12: update theming app fails #5219

Closed
ptibubu opened this issue Jun 1, 2017 · 5 comments
Closed

Updating NC12: update theming app fails #5219

ptibubu opened this issue Jun 1, 2017 · 5 comments

Comments

@ptibubu
Copy link

ptibubu commented Jun 1, 2017

Same issue than the one reported here , but currently unsolved for me.
Giving NC a try, but I got the same issue while migrating/updating.

I migrated from OC 9.1 to NC 11.0.3.2 and then updating to NC12 using occ:

# sudo -u www-data php occ upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Updating database schema
Updated database
Updating <theming> ...
InvalidArgumentException: $absolutePath must be relative to "files"
Update failed
Maintenance mode is kept active
Reset log level

System:
debian 8.8, x86_64
PHP 5.6.30
NGINX 1.10.3
mariadb 10.0.30

Nextcloud logs:

{"reqId":"JoG4zF47JsDfNLinxANy","level":0,"time":"2017-05-31T17:23:01+02:00","remoteAddr":"","user":"--","app":"core","method":"--","url":"--","message":"starting upgrade from 11.0.3.2 to 12.0.0.29","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":1,"time":"2017-05-31T17:23:01+02:00","remoteAddr":"","user":"--","app":"updater","method":"--","url":"--","message":"\\OC\\Repair::step: Repair step: Repair MySQL collation","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":1,"time":"2017-05-31T17:23:01+02:00","remoteAddr":"","user":"--","app":"updater","method":"--","url":"--","message":"\\OC\\Repair::info: Repair info: All tables already have the correct collation -> nothing to do","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":1,"time":"2017-05-31T17:23:01+02:00","remoteAddr":"","user":"--","app":"updater","method":"--","url":"--","message":"\\OC\\Repair::step: Repair step: Repair SQLite autoincrement","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":1,"time":"2017-05-31T17:23:01+02:00","remoteAddr":"","user":"--","app":"updater","method":"--","url":"--","message":"\\OC\\Repair::step: Repair step: Copy data from accounts table when migrating from ownCloud","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":1,"time":"2017-05-31T17:23:01+02:00","remoteAddr":"","user":"--","app":"updater","method":"--","url":"--","message":"\\OC\\Updater::dbUpgradeBefore: Updating database schema","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":1,"time":"2017-05-31T17:23:02+02:00","remoteAddr":"","user":"--","app":"updater","method":"--","url":"--","message":"\\OC\\Updater::dbUpgrade: Updated database","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":1,"time":"2017-05-31T17:23:03+02:00","remoteAddr":"","user":"--","app":"updater","method":"--","url":"--","message":"\\OC\\Updater::appUpgradeStarted: Updating <theming> ...","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":1,"time":"2017-05-31T17:23:03+02:00","remoteAddr":"","user":"--","app":"updater","method":"--","url":"--","message":"\\OC\\Repair::step: Repair step: Move theming files to AppData storage","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":3,"time":"2017-05-31T17:23:03+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"--","url":"--","message":"$absolutePath must be relative to \"files\", value is \"%s\"","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":3,"time":"2017-05-31T17:23:03+02:00","remoteAddr":"","user":"--","app":"core","method":"--","url":"--","message":"Exception: {\"Excepti
    on\":\"InvalidArgumentException\",\"Message\":\"$absolutePath must be relative to \\\"files\\\"\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1951): OC\\\\Files\\\\View->getPathRelativeToFiles('\\\/appdata_oc9nyo...')\\n#1 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1126): OC\\\\Files\\\\View->changeLock('\\\/appdata_oc9nyo...', 2)\\n#2 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(269): OC\\\\Files\\\\View->basicOperation('mkdir', '\\\/appdata_oc9nyo...', Array)\\n#3 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Node\\\/Folder.php(160): OC\\\\Files\\\\View->mkdir('\\\/appdata_oc9nyo...')\\n#4 [internal function]: OC\\\\Files\\\\Node\\\\Folder->newFolder('appdata_oc9nyok...')\\n#5 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Node\\\/LazyRoot.php(63): call_user_func_array(Array, Array)\\n#6 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Node\\\/LazyRoot.php(385): OC\\\\Files\\\\Node\\\\LazyRoot->__call('newFolder', Array)\\n#7 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/AppData\\\/AppData.php(82): OC\\\\Files\\\\Node\\\\LazyRoot->newFolder('appdata_oc9nyok...')\\n#8 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/AppData\\\/AppData.php(112): OC\\\\Files\\\\AppData\\\\AppData->getAppDataFolder()\\n#9 \\\/home\\\/www-data\\\/nextcloud\\\/apps\\\/theming\\\/lib\\\/Migration\\\/ThemingImages.php(56): OC\\\\Files\\\\AppData\\\\AppData->newFolder('images')\\n#10 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Repair.php(85): OCA\\\\Theming\\\\Migration\\\\ThemingImages->run(Object(OC\\\\Repair))\\n#11 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/legacy\\\/app.php(1114): OC\\\\Repair->run()\\n#12 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/legacy\\\/app.php(1049): OC_App::executeRepairSteps('theming', Array)\\n#13 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Updater.php(381): OC_App::updateApp('theming')\\n#14 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Updater.php(264): OC\\\\Updater->doAppUpgrade()\\n#15 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Updater.php(130): OC\\\\Updater->doUpgrade('12.0.0.29', '11.0.3.2')\\n#16 \\\/home\\\/www-data\\\/nextcloud\\\/core\\\/Command\\\/Upgrade.php(263): OC\\\\Updater->upgrade()\\n#17 \\\/home\\\/www-data\\\/nextcloud\\\/3rdparty\\\/symfony\\\/console\\\/Command\\\/Command.php(256): OC\\\\Core\\\\Command\\\\Upgrade->execute(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#18 \\\/home\\\/www-data\\\/nextcloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(818): Symfony\\\\Component\\\\Console\\\\Command\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#19 \\\/home\\\/www-data\\\/nextcloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(186): Symfony\\\\Component\\\\Console\\\\Application->doRunCommand(Object(OC\\\\Core\\\\Command\\\\Upgrade), Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#20 \\\/home\\\/www-data\\\/nextcloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(117): Symfony\\\\Component\\\\Console\\\\Application->doRun(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#21 \\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Console\\\/Application.php(170): Symfony\\\\Component\\\\Console\\\\Application->run(NULL, NULL)\\n#22 \\\/home\\\/www-data\\\/nextcloud\\\/console.php(92): OC\\\\Console\\\\Application->run()\\n#23 \\\/home\\\/www-data\\\/nextcloud\\\/occ(11): require_once('\\\/home\\\/www-data\\\/...')\\n#24 {main}\",\"File\":\"\\\/home\\\/www-data\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php\",\"Line\":2084}","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":3,"time":"2017-05-31T17:23:03+02:00","remoteAddr":"","user":"--","app":"updater","method":"--","url":"--","message":"\\OC\\Updater::failure: InvalidArgumentException: $absolutePath must be relative to \"files\"","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":3,"time":"2017-05-31T17:23:03+02:00","remoteAddr":"","user":"--","app":"updater","method":"--","url":"--","message":"\\OC\\Updater::updateEnd: Update failed","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":1,"time":"2017-05-31T17:23:03+02:00","remoteAddr":"","user":"--","app":"updater","method":"--","url":"--","message":"\\OC\\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"--","version":"11.0.3.2"}
    {"reqId":"JoG4zF47JsDfNLinxANy","level":1,"time":"2017-05-31T17:23:03+02:00","remoteAddr":"","user":"--","app":"updater","method":"--","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Error(3)","userAgent":"--","version":"11.0.3.2"}


And since $absolutePath must be relative to \"files\", value is \"%s\" does not help very much ;-), it seems that $absolutePath is set to "remoteAddr"

# sudo -u www-data php occ app:list
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Enabled:
  - activity: 2.5.2
  - comments: 1.2.0
  - dav: 1.3.0
  - federatedfilesharing: 1.2.0
  - federation: 1.2.0
  - files: 1.7.2
  - files_external: 1.3.0
  - files_pdfviewer: 1.1.1
  - files_sharing: 1.4.0
  - files_texteditor: 2.4.1
  - files_trashbin: 1.2.0
  - files_versions: 1.5.0
  - files_videoplayer: 1.1.0
  - firstrunwizard: 2.1
  - gallery: 17.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - nextcloud_announcements: 1.1
  - notifications: 2.0.0
  - oauth2: true
  - password_policy: 1.2.2
  - provisioning_api: 1.2.0
  - serverinfo: 1.2.0
  - sharebymail: 1.2.0
  - survey_client: 1.0.0
  - systemtags: 1.2.0
  - theming: 1.1.1
  - twofactor_backupcodes: 1.1.1
  - updatenotification: 1.2.0
  - workflowengine: 1.2.0
Disabled:
  - admin_audit
  - encryption
  - user_external
  - user_ldap

# sudo -u www-data php occ config:list system
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
          ***REMOVED SENSITIVE VALUE***
        ],
        "datadirectory": "\/var\/www\/nextcloud_data\/data",
        "overwrite.cli.url": "\/owncloud",
        "dbtype": "mysql",
        "version": "11.0.3.2",
        "dbname": "nextcloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "loglevel": 3,
        "logtimezone": "Europe\/Paris",
        "theme": "",
        "maintenance": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "trashbin_retention_obligation": "auto",
        "appstore.experimental.enabled": true
    }
}

Are you using encryption: no

**Are you using an external user-backend, no

@blizzz
Copy link
Member

blizzz commented Jun 12, 2017

@nickvergessen perhaps?

@nickvergessen
Copy link
Member

nickvergessen commented Jun 12, 2017

"overwrite.cli.url": "/owncloud",

you should fix that to the full url (including protocol, domain and subfolder)

{
    "reqId": "JoG4zF47JsDfNLinxANy",
    "level": 3,
    "time": "2017-05-31T17:23:03+02:00",
    "remoteAddr": "",
    "user": "--",
    "app": "core",
    "method": "--",
    "url": "--",
    "message": {
        "Exception": {
            "Exception": "InvalidArgumentException",
            "Message": "$absolutePath must be relative to \"files\"",
            "Code": 0,
            "Trace": {
                "#0": [
                    "/home/www-data/nextcloud/lib/private/Files/View.php(1951):",
                    "OC\Files\View->getPathRelativeToFiles('/appdata_oc9nyo...')"
                ],
                "#1": [
                    "/home/www-data/nextcloud/lib/private/Files/View.php(1126): OC\Files\View->changeLock('/appdata_oc9nyo...', 2)",
                    null
                ],
                "#2": [
                    "/home/www-data/nextcloud/lib/private/Files/View.php(269): OC\Files\View->basicOperation('mkdir', '/appdata_oc9nyo...', Array)",
                    null
                ],
                "#3": [
                    "/home/www-data/nextcloud/lib/private/Files/Node/Folder.php(160):",
                    "OC\Files\View->mkdir('/appdata_oc9nyo...')"
                ],
                "#4": [
                    "[internal function]: OC\Files\Node\Folder->newFolder('appdata_oc9nyok...')",
                    null
                ],
                "#5": [
                    "/home/www-data/nextcloud/lib/private/Files/Node/LazyRoot.php(63): call_user_func_array(Array, Array)",
                    null
                ],
                "#6": [
                    "/home/www-data/nextcloud/lib/private/Files/Node/LazyRoot.php(385): OC\Files\Node\LazyRoot->__call('newFolder', Array)",
                    null
                ],
                "#7": [
                    "/home/www-data/nextcloud/lib/private/Files/AppData/AppData.php(82):",
                    "OC\Files\Node\LazyRoot->newFolder('appdata_oc9nyok...')"
                ],
                "#8": [
                    "/home/www-data/nextcloud/lib/private/Files/AppData/AppData.php(112):",
                    "OC\Files\AppData\AppData->getAppDataFolder()"
                ],
                "#9": [
                    "/home/www-data/nextcloud/apps/theming/lib/Migration/ThemingImages.php(56):",
                    "OC\Files\AppData\AppData->newFolder('images')"
                ],
                "#10": [
                    "/home/www-data/nextcloud/lib/private/Repair.php(85):",
                    "OCA\Theming\Migration\ThemingImages->run(Object(OC\Repair))"
                ],
                "#11": [
                    "/home/www-data/nextcloud/lib/private/legacy/app.php(1114):",
                    "OC\Repair->run()"
                ],
                "#12": [
                    "/home/www-data/nextcloud/lib/private/legacy/app.php(1049): OC_App::executeRepairSteps('theming', Array)",
                    null
                ],
                "#13": [
                    "/home/www-data/nextcloud/lib/private/Updater.php(381):",
                    "OC_App::updateApp('theming')"
                ],
                "#14": [
                    "/home/www-data/nextcloud/lib/private/Updater.php(264):",
                    "OC\Updater->doAppUpgrade()"
                ],
                "#15": [
                    "/home/www-data/nextcloud/lib/private/Updater.php(130): OC\Updater->doUpgrade('12.0.0.29', '11.0.3.2')",
                    null
                ],
                "#16": [
                    "/home/www-data/nextcloud/core/Command/Upgrade.php(263):",
                    "OC\Updater->upgrade()"
                ],
                "#17": [
                    "/home/www-data/nextcloud/3rdparty/symfony/console/Command/Command.php(256): OC\Core\Command\Upgrade->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))",
                    null
                ],
                "#18": [
                    "/home/www-data/nextcloud/3rdparty/symfony/console/Application.php(818): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))",
                    null
                ],
                "#19": [
                    "/home/www-data/nextcloud/3rdparty/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Upgrade), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))",
                    null
                ],
                "#20": [
                    "/home/www-data/nextcloud/3rdparty/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))",
                    null
                ],
                "#21": [
                    "/home/www-data/nextcloud/lib/private/Console/Application.php(170): Symfony\Component\Console\Application->run(NULL, NULL)",
                    null
                ],
                "#22": [
                    "/home/www-data/nextcloud/console.php(92):",
                    "OC\Console\Application->run()"
                ],
                "#23": [
                    "/home/www-data/nextcloud/occ(11):",
                    "require_once('/home/www-data/...')"
                ],
                "#24": [
                    "{main}",
                    null
                ]
            },
            "File": "/home/www-data/nextcloud/lib/private/Files/View.php",
            "Line": 2084
        }
    },
    "userAgent": "--",
    "version": "11.0.3.2"
}

as for the actual problem, I'm not sure. I guess @rullzer (vacation) knows most about the appdata stuff.

@ptibubu
Copy link
Author

ptibubu commented Jun 12, 2017

Thanks for the TIP. I also tried to remove overwrite.cli.url which is not needed anymore, but no success.

@ptibubu
Copy link
Author

ptibubu commented Jun 22, 2017

Finally succeeded in migrating from OC to NC 11, Using migration tool from OC9 to NC 10, then NC11.
Interestingly, I got data file issues after migration. Was forced to run occ files:scan to recover files, with many errors (like cannot found files...).
But now it finally works, not really sure why...

@nickvergessen
Copy link
Member

Ah, so this happens when the path is already locked, then we end up in:

} catch (\OCP\Lock\LockedException $e) {
// rethrow with the a human-readable path
throw new \OCP\Lock\LockedException(
$this->getPathRelativeToFiles($absolutePath),
$e
);
}

and that tries so display a readable path to the user, which therefor must start relative to files...

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

4 participants