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

RouteNotFoundException during upgrade of an app #18861

Closed
MorrisJobke opened this issue Sep 6, 2015 · 6 comments
Closed

RouteNotFoundException during upgrade of an app #18861

MorrisJobke opened this issue Sep 6, 2015 · 6 comments

Comments

@MorrisJobke
Copy link
Contributor

  • have an app with URLGenerator->linkToRoute('appname.page.index') right inside the appinfo/app.php (not inside a closure for the app navigation) - like the music app: https://github.com/owncloud/music/blob/bd492a38b0f90004805f0f80547d546aa2f7fa7d/appinfo/app.php#L26
  • enable this app via ./occ app:enable appname
  • disable this app via ./occ app:disable appname
  • change the version of this app
  • enable this app via ./occ app:enable appname
  • run upgrade (web/cli causes this but web has a proper stacktrace in logs) ./occ upgrade

Expected

Upgrade runs just fine

Actual

Upgrade is broken an can not be executed

{
    "reqId": "UfQ+fCDmnLOgb//ovLPs",
    "remoteAddr": "127.0.0.1",
    "app": "update",
    "message": "Exception: {
        \"Exception\":\"Symfony\\\\Component\\\\Routing\\\\Exception\\\\RouteNotFoundException\",
        \"Message\":\"Unable to generate a URL for the named route \\\"music.page.index\\\" as such route does not exist.\",
        \"Code\":0,
        \"Trace\":\"
            #0 /lib/private/route/router.php(313): Symfony\Component\Routing\Generator\UrlGenerator->generate('music.page.inde...', Array, false)
            #1 /lib/private/route/cachingrouter.php(53): OC\Route\Router->generate('music.page.inde...', Array, false)
            #2 /lib/private/urlgenerator.php(65): OC\Route\CachingRouter->generate('music.page.inde...', Array)
            #3 /apps2/music/appinfo/app.php(26): OC\URLGenerator->linkToRoute('music.page.inde...')
            #4 /lib/private/app.php(149): require_once('/home/mjob/Proj...')
            #5 /lib/private/app.php(130): OC_App::requireAppFile('music')
            #6 /lib/private/app.php(1154): OC_App::loadApp('music', false)
            #7 /lib/private/updater.php(408): OC_App::updateApp('music')
            #8 /lib/private/updater.php(305): OC\Updater->doAppUpgrade()
            #9 /lib/private/updater.php(195): OC\Updater->doUpgrade('8.2.0.4', '8.2.0.4')
            #10 /core/ajax/update.php(93): OC\Updater->upgrade()
            #11 {main}
        \",
        \"File\":\"3rdparty\\/symfony\\/routing\\/Symfony\\/Component\\/Routing\\/Generator\\/UrlGenerator.php\",
        \"Line\":134
    }",
    "level": 4,
    "time": "2015-09-06T21:20:06+00:00",
    "method": "GET",
    "url": "/master/core/ajax/update.php?requesttoken=8af21d0f2e58b11e522a95d91fe8bf22e0a91cc4dfccad52ffda8989863db2cd%7CWx1XSCQ0KVaZFMGZ%7C6a313fd34236d09bcedeec2c62c83573bafcab2bfb6f0459e9b9b9c2585499466744171173ff5080775d4f6c32df5b7734141e365ff6fd8c3036d3514f2fdf9d%3AGLkT5yCW5T"
}

This is because the upgrade logic loads the app.php and then it want to load the route which is not loaded via OC_App::loadApp

cc @Xenopathic @LukasReschke @nickvergessen

similiar to #8361 but on upgrade not in apps management.

@MorrisJobke
Copy link
Contributor Author

@Xenopathic This was introduced by #18374

@MorrisJobke
Copy link
Contributor Author

cc @PVince81

@MorrisJobke
Copy link
Contributor Author

Found that #18839 solves it \o/

@MorrisJobke
Copy link
Contributor Author

Fixed with #18839

@RobinMcCorkell
Copy link
Member

Ah, self-closing issues. They are the best! 😆

@MorrisJobke
Copy link
Contributor Author

Ah, self-closing issues. They are the best! 😆

Yep. I digged through a lot of code :(

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

No branches or pull requests

2 participants