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

Missing app repair may cause skipped migrations #426

Closed
VicDeo opened this issue Nov 30, 2018 · 2 comments
Closed

Missing app repair may cause skipped migrations #426

VicDeo opened this issue Nov 30, 2018 · 2 comments
Assignees
Milestone

Comments

@VicDeo
Copy link
Member

VicDeo commented Nov 30, 2018

Manual upgrade scenario

  1. user removed all apps from the instance, leaving config and data
  2. during the repair step an event for "missing but enabled" app was triggered.
  3. app was reinstalled but the marketplace had newer version of the app so it was used

result: missing migrations as reinstall doesn't run migrations
https://github.com/owncloud/market/blob/master/lib/Listener.php#L50

there is a possibility that newer core is not compatible with a prev app version

repairing an app could be done like this:

  1. Check if there is a compatible release, stop if there is not any
  2. Install version that was installed before skipping migrations
  3. Update it to the compatible release
@VicDeo VicDeo changed the title Repairing missing app may cause skipping migrations Missing app repair may cause skipped migrations Nov 30, 2018
@PVince81 PVince81 added this to the backlog milestone Nov 30, 2018
@PVince81 PVince81 modified the milestones: backlog, development Dec 18, 2018
@davitol davitol mentioned this issue Dec 20, 2018
24 tasks
@VicDeo
Copy link
Member Author

VicDeo commented Jan 25, 2019

@PVince81 this is a probably no-issue.

  1. user removed all apps from the instance, leaving config and data
  2. during the repair step an event for "missing but enabled" app was triggered.
  3. app was reinstalled but the marketplace had newer version of the app so it was used

result: missing migrations as reinstall doesn't run migrations

This is correct but within before upgrade repair step only.
Major upgrade of the app is correctly detected and migrations are run properly after the core is upgraded.
Tested on the password_policy app while trying to reproduce #423

Needs direct revalidation

We start with

> php occ a:l
Enabled:
  - comments: 0.3.0
  - configreport: 0.1.1
  - dav: 0.4.0
  - federatedfilesharing: 0.3.1
  - federation: 0.1.0
  - files: 1.5.1
  - files_external: 0.7.1
  - files_sharing: 0.11.0
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - firstrunwizard: 1.1
  - market: 0.2.5
  - notifications: 0.3.5
  - password_policy: 1.0.3
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - updatenotification: 0.2.1

> php occ migra:status password_policy
    >> App:                                                password_policy
    >> Version Table Name:                                 oc_migrations
    >> Migrations Namespace:                               OCA\password_policy\Migrations
    >> Migrations Directory:                               /home/deo/public_html/10010/apps/password_policy/appinfo/Migrations
    >> Previous Version:                                   Already at first migration step
    >> Current Version:                                    0
    >> Next Version:                                       Already at latest migration step
    >> Latest Version:                                     
    >> Executed Migrations:                                0
    >> Executed Unavailable Migrations:                    0
    >> Available Migrations:                               0
    >> New Migrations:                                     0

Then

> rm -rf apps/password_policy/
> php occ upgrade
ownCloud 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
2019-01-25T12:47:22+00:00 Set log level to debug
2019-01-25T12:47:22+00:00 Turned on maintenance mode
2019-01-25T12:47:22+00:00 Repair step: Upgrade app code from the marketplace
2019-01-25T12:47:22+00:00 Repair info: Using market to update existing apps
2019-01-25T12:47:22+00:00 Repair info: Attempting to update the following existing but incompatible app from market: market
2019-01-25T12:47:22+00:00 Repair info: Fetching app from market: market
2019-01-25T12:47:23+00:00 Repair info: App (market) is not known at the marketplace.
2019-01-25T12:47:23+00:00 Repair info: Attempting to update the following missing apps from market: password_policy
2019-01-25T12:47:23+00:00 Repair info: Fetching app from market: password_policy
2019-01-25T12:47:28+00:00 Repair info: Attempting to update the following existing compatible apps from market: comments, configreport, dav, federatedfilesharing, federation, files, files_external, files_sharing, files_trashbin, files_versions, firstrunwizard, notifications, provisioning_api, systemtags, updatenotification                                                                                 
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: comments
2019-01-25T12:47:28+00:00 Repair info: App (comments) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: configreport
2019-01-25T12:47:28+00:00 Repair info: App (configreport) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: dav
2019-01-25T12:47:28+00:00 Repair info: App (dav) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: federatedfilesharing
2019-01-25T12:47:28+00:00 Repair info: App (federatedfilesharing) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: federation
2019-01-25T12:47:28+00:00 Repair info: App (federation) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: files
2019-01-25T12:47:28+00:00 Repair info: App (files) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: files_external
2019-01-25T12:47:28+00:00 Repair info: App (files_external) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: files_sharing
2019-01-25T12:47:28+00:00 Repair info: App (files_sharing) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: files_trashbin
2019-01-25T12:47:28+00:00 Repair info: App (files_trashbin) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: files_versions
2019-01-25T12:47:28+00:00 Repair info: App (files_versions) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: firstrunwizard
2019-01-25T12:47:28+00:00 Repair info: App (firstrunwizard) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: notifications
2019-01-25T12:47:28+00:00 Repair info: App (notifications) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: provisioning_api
2019-01-25T12:47:28+00:00 Repair info: App (provisioning_api) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: systemtags
2019-01-25T12:47:28+00:00 Repair info: App (systemtags) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: Fetching app from market: updatenotification
2019-01-25T12:47:28+00:00 Repair info: App (updatenotification) is not known at the marketplace.
2019-01-25T12:47:28+00:00 Repair info: App was not updated: comments
2019-01-25T12:47:28+00:00 Repair info: App was not updated: configreport
2019-01-25T12:47:28+00:00 Repair info: App was not updated: dav
2019-01-25T12:47:28+00:00 Repair info: App was not updated: federatedfilesharing
2019-01-25T12:47:28+00:00 Repair info: App was not updated: federation
2019-01-25T12:47:28+00:00 Repair info: App was not updated: files
2019-01-25T12:47:28+00:00 Repair info: App was not updated: files_external
2019-01-25T12:47:28+00:00 Repair info: App was not updated: files_sharing
2019-01-25T12:47:28+00:00 Repair info: App was not updated: files_trashbin
2019-01-25T12:47:28+00:00 Repair info: App was not updated: files_versions
2019-01-25T12:47:28+00:00 Repair info: App was not updated: firstrunwizard
2019-01-25T12:47:28+00:00 Repair info: App was not updated: notifications
2019-01-25T12:47:28+00:00 Repair info: App was not updated: provisioning_api
2019-01-25T12:47:28+00:00 Repair info: App was not updated: systemtags
2019-01-25T12:47:28+00:00 Repair info: App was not updated: updatenotification
2019-01-25T12:47:28+00:00 Repair step: Repair MySQL database engine
2019-01-25T12:47:28+00:00 Repair info: Not a mysql database -> nothing to do
2019-01-25T12:47:28+00:00 Repair step: Repair MySQL collation
2019-01-25T12:47:28+00:00 Repair info: Not a mysql database -> nothing to do
2019-01-25T12:47:28+00:00 Repair step: Repair SQLite autoincrement
2019-01-25T12:47:28+00:00 Repair step: Repair orphaned reshare
2019-01-25T12:47:28+00:00 Repair step: Repair duplicate entries in oc_lucene_status
2019-01-25T12:47:28+00:00 Repair info: lucene_status table does not exist -> nothing to do
2019-01-25T12:47:28+00:00 Updating database schema
2019-01-25T12:47:29+00:00 Updated database
2019-01-25T12:47:29+00:00 Updating <market> ...
2019-01-25T12:47:29+00:00 Updated <market> to 0.3.0
2019-01-25T12:47:29+00:00 Updating <password_policy> ...
2019-01-25T12:47:29+00:00 Updated <password_policy> to 2.11.0
2019-01-25T12:47:29+00:00 Updating <notifications> ...
2019-01-25T12:47:29+00:00 Updated <notifications> to 0.4.1
2019-01-25T12:47:29+00:00 Repair step: Repair mime types
2019-01-25T12:47:29+00:00 Repair step: Detect file cache entries with path that does not match parent-child relationships
2019-01-25T12:47:29+00:00 Repair step: Generate ETags for file where no ETag is present.
2019-01-25T12:47:29+00:00 Repair info: ETags have been fixed for 0 files/folders.
2019-01-25T12:47:29+00:00 Repair step: Clean tags and favorites
2019-01-25T12:47:29+00:00 Repair info: 0 tags of deleted users have been removed.
2019-01-25T12:47:29+00:00 Repair info: 0 tags for delete files have been removed.
2019-01-25T12:47:29+00:00 Repair info: 0 tag entries for deleted tags have been removed.
2019-01-25T12:47:29+00:00 Repair info: 0 tags with no entries have been removed.
2019-01-25T12:47:29+00:00 Repair step: Drop old database tables
2019-01-25T12:47:29+00:00 Drop old database tables
2019-01-25T12:47:29+00:00 
                                                    2019-01-25T12:47:29+00:00  Done
 28/28 [============================] 100%2019-01-25T12:47:29+00:00 
2019-01-25T12:47:29+00:00 Repair step: Drop old background jobs
2019-01-25T12:47:29+00:00 Repair step: Remove getetag entries in properties table
2019-01-25T12:47:29+00:00 Repair info: Removed 0 unneeded "{DAV:}getetag" entries from properties table.
2019-01-25T12:47:29+00:00 Repair step: Repair outdated OCS IDs
2019-01-25T12:47:29+00:00 Repair step: Repair invalid shares
2019-01-25T12:47:29+00:00 Repair step: Remove old share propagation app entries
2019-01-25T12:47:29+00:00 Repair step: Move user avatars outside the homes to the new location
2019-01-25T12:47:29+00:00 Repair step: Remove shares of a users root folder
2019-01-25T12:47:29+00:00 Repair step: Repair unmerged shares
2019-01-25T12:47:29+00:00 Repair step: Disable extra themes
2019-01-25T12:47:29+00:00 Repair step: Repair sub shares
2019-01-25T12:47:29+00:00 Starting code integrity check...
2019-01-25T12:48:37+00:00 Finished code integrity check
2019-01-25T12:48:37+00:00 Update successful
2019-01-25T12:48:37+00:00 Turned off maintenance mode
2019-01-25T12:48:37+00:00 Reset log level

and finally

> php occ migra:status password_policy
    >> App:                                                password_policy
    >> Version Table Name:                                 oc_migrations
    >> Migrations Namespace:                               OCA\password_policy\Migrations
    >> Migrations Directory:                               /home/deo/public_html/10010/apps/password_policy/appinfo/Migrations
    >> Previous Version:                                   0
    >> Current Version:                                    20180123143343
    >> Next Version:                                       Already at latest migration step
    >> Latest Version:                                     20180123143343
    >> Executed Migrations:                                1
    >> Executed Unavailable Migrations:                    1
    >> Available Migrations:                               1
    >> New Migrations:                                     1

@VicDeo
Copy link
Member Author

VicDeo commented Jan 25, 2019

closing

@VicDeo VicDeo closed this as completed Jan 25, 2019
@patrickjahns patrickjahns modified the milestones: development, 0.3.0 Jun 6, 2019
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

3 participants