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

Migrate away from IDb #17

Closed
MichaIng opened this issue May 6, 2017 · 17 comments
Closed

Migrate away from IDb #17

MichaIng opened this issue May 6, 2017 · 17 comments

Comments

@MichaIng
Copy link

MichaIng commented May 6, 2017

IDb has been removed from Nextcloud 12. See here the equivalent fix for Nextcloud JavaScript Xmpp Client: nextcloud/jsxc.nextcloud#12

Found bug after NC 12 Beta 1 upgrade: https://help.nextcloud.com/t/upgrade-to-nc-12-beta-1-problems/12225

Was found earlier for JSXC here: https://help.nextcloud.com/t/nc12-breaking-changes/11798

I hope this helps to fix it fast. I really like OwnBackup :)!

@pbek
Copy link
Owner

pbek commented May 6, 2017

Thank you for letting me know. That's a bummer, IDb was the pillar of ownBackup. I can't promise that I rewrite the whole app any time soon... :/

@MichaIng
Copy link
Author

MichaIng commented May 6, 2017

Oh, sad to hear. I am not too experienced in programming, but let me know, if I can help with some simple task, replacing certain kind of functions or what.

@pbek
Copy link
Owner

pbek commented May 6, 2017

If we find a way to dump and restore the database structure and store and restore the content of tables that is database-agnostic (MySQL, PostgreSQL, Sqlite, ...) I will take a look at it.
Doctrine might help us...

@pbek
Copy link
Owner

pbek commented May 6, 2017

The backing up and restoring is done in https://github.com/pbek/ownbackup/blob/develop/service/backupservice.php.

@pbek
Copy link
Owner

pbek commented May 11, 2017

@MichaIng, @Laupe
Could you please test the current develop branch, I now did a migration from IDB to IDBConnection and backup and restoring did finally work for me in the end under NC 12.
Only https://github.com/pbek/ownbackup/blob/develop/service/backupservice.php was changed, so it should be enough if you just update that one file.

@Laupe
Copy link

Laupe commented May 11, 2017

@pbek Tomorrow I will test and let me know

@MichaIng
Copy link
Author

Just tested it:

  • I still get internal server error on opening additional admin settings.
  • Nextcloud log error still the same:
    Error index OCP\AppFramework\QueryException: Could not resolve AppName! Class AppName does not exist /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php - line 117: OC\AppFramework\Utility\SimpleContainer->resolve('AppName') /var/www/owncloud/lib/private/ServerContainer.php - line 116: OC\AppFramework\Utility\SimpleContainer->query('AppName') /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php - line 66: OC\ServerContainer->query('AppName') /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php - line 96: OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass)) /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php - line 117: OC\AppFramework\Utility\SimpleContainer->resolve('OCA\\OwnBackup\\C...') /var/www/owncloud/lib/private/ServerContainer.php - line 116: OC\AppFramework\Utility\SimpleContainer->query('OCA\\OwnBackup\\C...') /var/www/owncloud/lib/private/AppFramework/DependencyInjection/DIContainer.php - line 410: OC\ServerContainer->query('OCA\\OwnBackup\\C...') /var/www/owncloud/apps/ownbackup/admin.php - line 19: OC\AppFramework\DependencyInjection\DIContainer->query('\\OCA\\OwnBackup\\...') /var/www/owncloud/lib/private/legacy/app.php - line 727: include('/var/www/ownclo...') /var/www/owncloud/settings/Controller/AdminSettingsController.php - line 102: OC_App getForms('admin') /var/www/owncloud/settings/Controller/AdminSettingsController.php - line 93: OC\Settings\Controller\AdminSettingsController->getLegacyForms() /var/www/owncloud/settings/Controller/AdminSettingsController.php - line 73: OC\Settings\Controller\AdminSettingsController->getSettings('additional') [internal function] OC\Settings\Controller\AdminSettingsController->index('additional') /var/www/owncloud/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array) /var/www/owncloud/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OC\Settings\Controller\AdminSettingsController), 'index') /var/www/owncloud/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OC\Settings\Controller\AdminSettingsController), 'index') /var/www/owncloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OC\\Settings\\Con...', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array) [internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array) /var/www/owncloud/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array) /var/www/owncloud/lib/base.php - line 975: OC\Route\Router->match('/settings/admin...') /var/www/owncloud/index.php - line 40: OC handleRequest() {main} 2017-05-12T10:29:58+0200
  • Error does not show up on cron job execution, but also no additional backup was made: last ownBackup unix timestamp (subfolder) is: 1494016216

@pbek
Copy link
Owner

pbek commented May 12, 2017

what's the content of your apps/ownbackup/service/backupservice.php?

@MichaIng
Copy link
Author

Found use of IDb in /tests/integration/BackupIntegrationTest.php
14: use OCP\IDb; -> use OCP\IDBConnection 44: $this->db = $this->container->query('OCP\IDb'); -> $this->db = $this->container->query('OCP\IDBConnection'); ...

Just guess, I did never look into the API and https://docs.nextcloud.com/server/12/developer_manual/app/changelog.html#id2 does not give all necessary changes as far as I can see ;).

@pbek
Copy link
Owner

pbek commented May 12, 2017

Thank you, I didn't fix the tests yet. So can you open the settings page and run a backup?

@MichaIng
Copy link
Author

MichaIng commented May 12, 2017

backupservice.php is definitely the one from develop channel/commit, I rechecked and also tested with different browsers/mobile to be sure that cache or what didn't prevent the change to appear.

Settings/additional admin page isn't opening because of internal server error:
error

As there is no occ command: Is there a way to test backup manually calling the php files from terminal?

@pbek
Copy link
Owner

pbek commented May 12, 2017

That's strange, I don't get that error under NC 12 (current master branch) any more...

@MichaIng
Copy link
Author

I tried back and forth to adjust some things in comparison to other apps (ojsxc) with no success so far. I don't use current master but current Beta2 of Nextcloud. Might there be some bug on Nextcloud side that was fixed in between?

Let's see what @Laupe gets during his test. As I have some other issues with Nextcloud currently, there might be something wrong on my side.

@pbek
Copy link
Owner

pbek commented May 13, 2017

I now released a new version of ownbackup into the NC store and posted an issue Certificate is not valid · Issue #4852 · nextcloud/server · GitHub.

@pbek
Copy link
Owner

pbek commented May 13, 2017

@Laupe, could you please update ownbackup from the store...

@MichaIng
Copy link
Author

With new version from store, everything works fine for me now. Could the issue I still had be caused by the remaining IDb call in ..test.php? However, thank you very much for this fast fix.

@pbek
Copy link
Owner

pbek commented May 13, 2017

Most unlikely that the test could have caused that for you... They are optional and executed manually...
Thank you for testing!

@pbek pbek closed this as completed May 13, 2017
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