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

Upgrade from 14 to 15.0.0 failed with activated user_external #12506

Closed
twinkybot opened this Issue Nov 17, 2018 · 9 comments

Comments

Projects
None yet
8 participants
@twinkybot
Copy link

twinkybot commented Nov 17, 2018

Hi there,

I am getting the following errors after updating from 14.x to 15 Beta 1/2 on Ubuntu 17.04

The updater said all apps are compatible. After the Upgrade and continuing to the web updater I got the error that an app has not a valid version.
Goint to the console resulted in:

$ 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
UnexpectedValueException: The files of the app "user_external" were not correctly replaced before running the update
Update failed
Maintenance mode is kept active
Reset log level

$ sudo -u www-data php occ maintenance:repair

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
Failed to load repair step for dav: Repair step 'OCA\DAV\Migration\FixBirthdayCalendarComponent' is unknown
Failed to load repair step for dav: Repair step 'OCA\DAV\Migration\CalDAVRemoveEmptyValue' is unknown
Failed to load repair step for dav: Repair step 'OCA\DAV\Migration\BuildCalendarSearchIndex' is unknown
Failed to load repair step for dav: Repair step 'OCA\DAV\Migration\RefreshWebcalJobRegistrar' is unknown
Failed to load repair step for files_sharing: Repair step 'OCA\Files_Sharing\Migration\OwncloudGuestShareType' is unknown
Failed to load repair step for files_sharing: Repair step 'OCA\Files_Sharing\Migration\SetPasswordColumn' is unknown
Failed to load repair step for oauth2: Repair step 'OCA\OAuth2\Migration\SetTokenExpiration' is unknown
Failed to load repair step for twofactor_backupcodes: Repair step 'OCA\TwoFactorBackupCodes\Migration\CheckBackupCodes' is unknown

  • Repair MySQL collation
    • Not a mysql database -> nothing to do
  • Repair mime types
  • Clean tags and favorites
    • 0 tags of deleted users have been removed.
    • 0 tags for delete files have been removed.
    • 0 tag entries for deleted tags have been removed.
    • 0 tags with no entries have been removed.
  • Repair invalid shares
  • Remove shares of a users root folder
  • Move .step file of updater to backup location
  • Fix potential broken mount points
    • No mounts updated
  • Repair invalid paths in file cache
  • Add log rotate job
  • Clear frontend caches
    • Image cache cleared
    • SCSS cache cleared
    • JS cache cleared
  • Clear every generated avatar on major updates
    • Avatar cache cleared
  • Add preview background cleanup job
  • Queue a one-time job to cleanup old backups of the updater
  • Repair pending cron jobs
    • No need to repair pending cron jobs.
  • Extract the vcard uid and store it in the db

In AbstractPostgreSQLDriver.php line 73:
An exception occurred while executing 'SELECT "id", "carddata" FROM "oc_cards" WHERE "uid" IS NU
LL LIMIT 1000':
SQLSTATE[42703]: Undefined column: 7 ERROR: column "uid" does not exist
LINE 1: SELECT "id", "carddata" FROM "oc_cards" WHERE "uid" IS NULL ...
^

In PDOConnection.php line 106:
SQLSTATE[42703]: Undefined column: 7 ERROR: column "uid" does not exist
LINE 1: SELECT "id", "carddata" FROM "oc_cards" WHERE "uid" IS NULL ...
^

In PDOConnection.php line 104:
SQLSTATE[42703]: Undefined column: 7 ERROR: column "uid" does not exist
LINE 1: SELECT "id", "carddata" FROM "oc_cards" WHERE "uid" IS NULL ...
^
maintenance:repair [--include-expensive]

@nextcloud-bot nextcloud-bot added the bug label Nov 17, 2018

@nextcloud-bot

This comment has been minimized.

Copy link
Member

nextcloud-bot commented Nov 17, 2018

GitMate.io thinks possibly related issues are #10885 (NC 14.0.0 beta 4, web login failed after upgrade from 13.0.5.2), #3168 (Failed Upgrade to 11), #6410 (Nextcloud 11 - Upgrade to 12 failed - ), #5531 (Upgrade fails from NC11-12), and #11854 (Upgrade 14.0.3.0 Failed - Autoload path not allowed).

@gabriel-n

This comment has been minimized.

Copy link

gabriel-n commented Nov 19, 2018

I had the same problem.
To resolve it, I had, in a shell on my server, to disable the app "user_external" :
occ app:disable user_external

The launch again the upgrade :
occ upgrade

All went fine.

@violoncelloCH

This comment has been minimized.

Copy link
Member

violoncelloCH commented Dec 14, 2018

I just faced the same problem as I wanted to upgrade the instance I manage for my graduation project for our school to v15. (I rely on user_external for authenticating the students and teachers)
I tried manipulating the

        <dependencies>
                <nextcloud min-version="13" max-version="14" />
        </dependencies>

to max-version="15". Now I'm totally locked out, because this lead to an internal server error:

An unhandled exception has been thrown:
OCP\AutoloadNotAllowedException: Autoload path not allowed: /var/www/html/nextcloud/apps/user_external/lib/webdavauth.php in /var/www/html/nextcloud/lib/autoloader.php:137
Stack trace:
#0 /var/www/html/nextcloud/lib/autoloader.php(162): OC\Autoloader->isValidPath('/var/www/html/n...')
#1 [internal function]: OC\Autoloader->load('OCA\\User_Extern...')
#2 [internal function]: spl_autoload_call('OCA\\User_Extern...')
#3 /var/www/html/nextcloud/lib/private/legacy/user.php(138): class_exists('\\OCA\\User_Exter...')
#4 /var/www/html/nextcloud/lib/base.php(721): OC_User::setupBackends()
#5 /var/www/html/nextcloud/lib/base.php(1068): OC::init()
#6 /var/www/html/nextcloud/console.php(46): require_once('/var/www/html/n...')
#7 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')
#8 {main}
```{"reqId":"LUEYVW6aSphcoXCEdYBO","level":3,"time":"2018-12-14T16:51:59+01:00","remoteAddr":"213.188.241.79","user":"--","app":"index","method":"GET","url":"\/index.php\/204","message":{"Exception":"OCP\\AutoloadNotAllowedException","Message":"Autoload path not allowed: \/var\/www\/html\/nextcloud\/apps\/user_external\/lib\/webdavauth.php","Code":0,"Trace":[{"file":"\/var\/www\/html\/nextcloud\/lib\/autoloader.php","line":162,"function":"isValidPath","class":"OC\\Autoloader","type":"->","args":["\/var\/www\/html\/nextcloud\/apps\/user_external\/lib\/webdavauth.php"]},{"function":"load","class":"OC\\Autoloader","type":"->","args":["OCA\\User_External\\WebDAVAuth"]},{"function":"spl_autoload_call","args":["OCA\\User_External\\WebDAVAuth"]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/legacy\/user.php","line":138,"function":"class_exists","args":["\\OCA\\User_External\\WebDAVAuth"]},{"file":"\/var\/www\/html\/nextcloud\/lib\/base.php","line":721,"function":"setupBackends","class":"OC_User","type":"::","args":[]},{"file":"\/var\/www\/html\/nextcloud\/lib\/base.php","line":1068,"function":"init","class":"OC","type":"::","args":[]},{"file":"\/var\/www\/html\/nextcloud\/index.php","line":40,"args":["\/var\/www\/html\/nextcloud\/lib\/base.php"],"function":"require_once"}],"File":"\/var\/www\/html\/nextcloud\/lib\/autoloader.php","Line":137,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Android) ownCloud-android\/3.3.2","version":"15.0.0.10"}```

I now don't really know what I should do, because any occ command fails. Can I manually deactivate user_external?

Why do we ship user_external but no updated version for 15?
At least there should have been a warning about that. In the updatenotification section only apps from the appstore are listed, nothing was said about user_external. The updater does it's job, but then it fails on occ upgrade.
@MorrisJobke could you please have a look at this? EDIT: thank you, I finally managed to solve it (see below).

@violoncelloCH violoncelloCH changed the title Upgrade from 14 to 15 Beta failed Upgrade from 14 to 15.0.0 failed Dec 14, 2018

@violoncelloCH violoncelloCH changed the title Upgrade from 14 to 15.0.0 failed Upgrade from 14 to 15.0.0 failed with activated user_external Dec 14, 2018

@violoncelloCH

This comment has been minimized.

Copy link
Member

violoncelloCH commented Dec 15, 2018

I finally made it working again! 😄
I moved user_external away and back into apps/ and disabling/enabling it multiple times. I also had to change the max-version to 15 again, because it was somehow overwritten back to 14 and this finally solved it for me.

Also there is an open PR for this in nextcloud/apps#69.

@silas229

This comment has been minimized.

Copy link

silas229 commented Dec 21, 2018

Hi, how can I fix the problem without ssh access?

@cetcondor

This comment has been minimized.

Copy link

cetcondor commented Dec 22, 2018

@silas229: If you have database access, you can deactivate the app there. After that you will be able to continue with the upgrade to NC 15.
In MySQL e.g. that's done by
`UPDATE `oc_appconfig` SET `configvalue` = 'no' WHERE `oc_appconfig`.`appid` = 'user_external' AND `oc_appconfig`.`configkey` = 'enabled';`

[edit: had to escape ` to show up in markdown here correctly]

@skjnldsv

This comment has been minimized.

Copy link
Member

skjnldsv commented Dec 22, 2018

@cetcondor

This comment has been minimized.

Copy link

cetcondor commented Dec 22, 2018

@skjnldsv: For OCC command, you need SSH access. Silas asked what if he had no SSH access. Database is somewhat the last resort, isn't it?

@Danie10

This comment has been minimized.

Copy link

Danie10 commented Jan 9, 2019

@silas229: If you have database access, you can deactivate the app there. After that you will be able to continue with the upgrade to NC 15.
In MySQL e.g. that's done by
UPDATE oc_appconfigSETconfigvalue= 'no' WHEREoc_appconfig.appid= 'user_external' ANDoc_appconfig.configkey = 'enabled';

[edit: had to escape ` to show up in markdown here correctly]

Thanks that worked for me too. Scary how often NextCloud seems to upgrade issues were other services.

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