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

Can't use app data after upgrade to 13.0.0 #8526

Closed
detly opened this issue Feb 24, 2018 · 22 comments
Closed

Can't use app data after upgrade to 13.0.0 #8526

detly opened this issue Feb 24, 2018 · 22 comments

Comments

@detly
Copy link

detly commented Feb 24, 2018

For a while I've been running a script based on pyocclient that manipulates data in the app data store to keep track of what it's doing. Since upgrading to Nextcloud 13.0.0, it's suddenly started failing. I've reduced it down to this single example Python script. You need to do pip install pyocclient to be able to run it (or however you want to install dependencies). Put in the appropriate credentials and execute it to test.

#!/usr/bin/env python3

import owncloud

DOMAIN = "https://nextcloud.../"
USER = ""
PASSWORD = ""
APP_NAME = 'some-test-app'

oc = owncloud.Client(DOMAIN)
oc.login(USER, PASSWORD)
attrs = oc.get_attribute(APP_NAME)

from pprint import pprint
pprint(attrs)

With a Nextcloud server <= 12, this script runs fine — even if you have no data stored for APP_NAME, you'll just get an empty list back. Just to be clear, APP_NAME is made up, it doesn't have to correspond to any installed app to work.

Under 13, the script throws an exception ending in:

owncloud.owncloud.OCSResponseError: OCS error: 998

What's changed that might cause this? I realise that this is an Owncloud library, not a Nextcloud library, but I think they're similar enough for this to make sense.

@detly
Copy link
Author

detly commented Feb 24, 2018

By the way, as far as I could tell this data was just stored in the oc_privatedata table. It was usually empty unless my script had put anything there.

@detly
Copy link
Author

detly commented Feb 24, 2018

Looking through the source, it looks like the route for the privatedata key-value store is ocs/v2.php/privatedata/, whereas pyocclient uses ocs/v1.php/privatedata/. Monkey patching the script like so:

oc = owncloud.Client(DOMAIN)
oc.OCS_SERVICE_PRIVATEDATA = '../../ocs/v2.php/privatedata'
oc.login(USER, PASSWORD)
attrs = oc.get_attribute(APP_NAME)

...now results in a 404 (same as if I manually access the URL https://cloud.heeris.id.au//ocs/v2.php/privatedata/getattribute/some-test-app). Not much better, but at least I know what a 404 is.

I think I have to give up on using pyocclient because it now seems to be incompatible with Nextcloud's routes. Is there a Python library for Nextcloud itself though?

@rullzer
Copy link
Member

rullzer commented Feb 25, 2018

Mmm we moved this to an app. Please see https://github.com/nextcloud/privatedata

I will look into it.

@detly
Copy link
Author

detly commented Feb 25, 2018 via email

@detly
Copy link
Author

detly commented Feb 25, 2018

Oh I see, the route is different. Instead of /ocs/vX.php/... it's /ocs/privatedata. I'll change the patching in my script and see what happens.

@rullzer
Copy link
Member

rullzer commented Feb 26, 2018

Ah mmmit is not in the appstore indeed. I guess we forgot some steps when we moved it to an app.

@MorrisJobke shall I put it in the appstore? Or do we want to ship it by default?

@MorrisJobke
Copy link
Member

@MorrisJobke shall I put it in the appstore? Or do we want to ship it by default?

Ship it, or what to do here? Because it is a core feature of OCS, right?

@detly
Copy link
Author

detly commented Mar 27, 2018

What's the outcome of this? Should I wait for a separate app in the app store, or an update to core?

@MorrisJobke MorrisJobke added this to the Nextcloud 14 milestone Apr 3, 2018
@detly
Copy link
Author

detly commented Apr 15, 2018

If it's a core feature, isn't this more serious than an "enhancement"? Or is there a workaround?

@tflidd
Copy link
Contributor

tflidd commented Apr 16, 2018

It is a broken feature, so it's a regression, isn't it?

@detly
Copy link
Author

detly commented Apr 16, 2018

I would have thought so. But should the bug be in the other project or here?

@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jun 20, 2018
@detly
Copy link
Author

detly commented Jul 15, 2018

I'd love to help with this, but I don't know what the intent is. Is it a core function that needs to be fixed, or a separate app that needs to be published, or something else? Where should I start?

@nextcloud-bot nextcloud-bot removed the stale Ticket or PR with no recent activity label Jul 15, 2018
@detly
Copy link
Author

detly commented Jul 29, 2018

I see 14 is ready for beta testing but this is still missing. If private data is deprecated I'll need to find an alternative. Is it likely to be restored in the future?

@tflidd
Copy link
Contributor

tflidd commented Jul 29, 2018

@rullzer @MorrisJobke What is the status? The pyocclient can also be very useful for some testing on Nextcloud setups.

@detly
Copy link
Author

detly commented Aug 12, 2018

Hi @rullzer @MorrisJobke — it's been six months, and another major version, since we had any update on this. Could you, or any other dev, please just give some suggestion of what someone needs to do to restore this functionality? Even just where to start? I might have the time to help with something straightforward, but I definitely don't have the time to learn NextCloud's inner workings from scratch and reverse engineer what's going on here.

@MorrisJobke
Copy link
Member

@rullzer Is this the app you want to release in the appstore? nextcloud/app-certificate-requests#163

@MorrisJobke
Copy link
Member

We released the app now: https://apps.nextcloud.com/apps/privatedata

Just install this app and then the API is available.

@detly
Copy link
Author

detly commented Aug 24, 2018

I cannot find this in the apps directory within Nextcloud, and there's no way to search all apps. What category is it in?

@detly
Copy link
Author

detly commented Aug 24, 2018

Sorry, "integration", found it.

@MorrisJobke
Copy link
Member

I cannot find this in the apps directory within Nextcloud, and there's no way to search all apps. What category is it in?

We fixed this in 14.

@detly
Copy link
Author

detly commented Aug 24, 2018

It's in 13.x as well. I can confirm that my test script now works, thanks. Note that the route modification I suggested earlier is not necessary. Thanks for fixing.

@detly
Copy link
Author

detly commented Apr 1, 2019

Broken again! See nextcloud/privatedata#2

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

5 participants