Skip to content

Create a backup of the original app folder so we can still install the app - #14716

Closed
nickvergessen wants to merge 1 commit into
stable8from
issue/14711-backup-for-app-folders
Closed

nickvergessen wants to merge 1 commit into
stable8from
issue/14711-backup-for-app-folders

Conversation

@nickvergessen

Copy link
Copy Markdown
Contributor

Fix #14711

Quick and dirty fix @DeepDiver1975 @karlitschek @PVince81 @georgehrke
If we don't need the information in the UI:
issue-14711

Only the edit on lib/private/installer.php is required.

@nickvergessen nickvergessen added this to the 8.0.1-current-maintenance milestone Mar 5, 2015
Comment thread lib/private/app.php

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHPDoc? :)

@jnfrmarks

Copy link
Copy Markdown

@nickvergessen

What triggers the message? We'll need that for testing.

@nickvergessen

Copy link
Copy Markdown
Contributor Author

@jnfrmarks create a read-only folder calendar in the apps/ folder and then try to install the calendar app via the apps page in your instance

Comment thread lib/private/installer.php

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this doesn't need a clearstatcache() ?

@PVince81

PVince81 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

The code looks good.

@ghost

ghost commented Mar 5, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/10234/
Test PASSed.

@PVince81

PVince81 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

I'm currently trying with a real calendar app instance, but it doesn't try to upgrade.
I guess I should try with the old "shipped" version ? Should the app be disabled before the attempt ? (probably disabled by the update)

@jnfrmarks

Copy link
Copy Markdown

@PVince81

When going from 7 (where we ship calendar) to 8, the app is disabled as part of the upgrade process.

@nickvergessen

Is that what a customer would do? I want to make sure I have a good handle on the use case we're resolving so that I have the right test cases lined up.

@PVince81

PVince81 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

It is still not clear how a RPM/DEB package upgrade would have left the calendar app hanging instead of removing it during upgrade. But this case could possibly be reproduced by using tarballs instead and have the "apps" folder read-only.

@PVince81

PVince81 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

Nope. The update process DOES NOT disable the calendar/contact app because they are "shipped". This is the problem from #14677 when you keep your apps folder as is.

I tried this from git:

  1. checkout stable7 for core
  2. checkout stable7 for the contacts app, which is inside "apps/contacts"
  3. setup OC, see the contacts app is enabled
  4. switch core to the branch from this PR
  5. leave the contacts app on the old version (to simulate what we think happened for other people)
  6. run the upgrade
  7. 💥 contacts app not disabled, getting an exception because the old app is not compatible
    (the problem from Upgrade failing 7.0.5 to 8.0.1 when keeping apps folder #14677)

@PVince81

PVince81 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

Now I wonder if this is about upgrading from 8.0.0 to 8.0.1 instead, like this guy: #14708 (not 7.0.4 to 8.0.1).

Because at this stage, all RPMs are already separated into separate packages, which means that the contacts/calendar apps are NOT shipped in this, so would be auto-disabled on upgrade.

I'll try this with git.

@PVince81

PVince81 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

Okay, based on my insights from #14711 (comment) the way to go is testing 8.0.0 -> 8.0.1 upgrade

@PVince81

PVince81 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

Testing with read-write apps folder

  1. Checkout v8.0.0 on core
  2. Setup OC
  3. Enable "contacts" and "calendar" from the "Recommended" section
  4. Check "apps" folder and see that the apps were installed there
  5. Checkout v8.0.1 on core
  6. Run upgrade
  7. Go to apps page, try enabling "contacts" or "calendar" from the "Recommended" section.
  8. A message appear "app folder already exists" (not sure why the button says "Enable" instead of "Upgrade", see Upgrade from 8.0.0 to 8.0.1 via CentOS 7 RPMs: unable to activate plugins #14708 (comment))
  9. Switch to the branch from this PR
  10. Try enabling them again: it works!

Please note that I didn't set anything to read-only. The message "app folder already exists" appeared even with those permissions !

@PVince81

PVince81 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

Before we merge this we need to look into the why the button says "Enable" instead of "Update", could it be an OCSID issue ? Because it is more likely to be the core issues than a read-only folder.

@karlitschek @georgehrke can you double check ?

@PVince81

PVince81 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

If the button said "Update" it is likely that there is logic to replace the old folder with a new one. (read-only case might need to be put there too, but still...)

@PVince81

PVince81 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

Just debugged: the OCS version is the same, so it's not technically an update.
It's just re-enable. But it still insists to redownload...

The "Enable" logic should probably check if the version on disk is already the wanted one, and instead of redownloading, just enable what is there.

@LukasReschke

Copy link
Copy Markdown
Contributor

Can confirm @PVince81's assumption. Also matches the screenshot from the blog post.

@georgehrke

Copy link
Copy Markdown
Contributor

Before we merge this we need to look into the why the button says "Enable" instead of "Update", could it be an OCSID issue ? Because it is more likely to be the core issues than a read-only folder.

The issue here is that a new app was published for the calendar app in ownCloud 8. This new app is called Calendar for ownCloud 8 or something like that. The ocsid we added to the calendar app before the release points to a different app (an empty calendar app). So ownCloud doesn't know that there is an relation between the already installed calendar and the Calendar for ownCloud 8.0. That's why it says enable instead of update

Edit: (I don't know why a new app was created and why we didn't use the placeholder (the empty app) on the app store.)

@PVince81

PVince81 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

OK so we might still need this PR here too for this special situation ?

Another issue: the backup folder in "apps" will still be detected as an app. So calendar would be detected twice. Might need to move it somewhere else.

@nickvergessen

Copy link
Copy Markdown
Contributor Author

I think this is no longer needed due to @LukasReschke work?
Or do we still need it because of the different ocsid?

(If that is the case, I'd say we can ignore the displaying of the message and make the patch simple)

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants