cloud-py-api / mediadc

Nextcloud Media Duplicate Collector application
https://apps.nextcloud.com/apps/mediadc
GNU Affero General Public License v3.0
95 stars 8 forks source link

Settings list is empty & Internal Server Error #53

Closed kevinkuan1969 closed 1 year ago

kevinkuan1969 commented 2 years ago

Nextcloud 22.2.3 Python 3.8.10 Ubuntu 20.14 MySQL 8.0.28 PHP 7.43

An unhandled exception has been thrown: OCP\AppFramework\Db\DoesNotExistException: Did expect one result but found none when executing: query "SELECT FROM `PREFIX*mediadc_settingsWHEREname` = :dcValue1"; in /var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php:283

ibib commented 2 years ago

Is for me reproducible under a fresh nextcloud installation. Error occurs after trying to log on after installing mediadc.

andrey18106 commented 2 years ago

@kevinkuan1969 @ibib Hi! Yea, it's my flaw.

To fix it follow the next steps, before waiting for the next update (I'll re-release 0.1.9 soon):

  1. Disable MediaDC via GUI or CLI (occ app:disable mediadc)
  2. Update file /lib/Service/UtilsService.php like in the commit.
  3. Connect to your database via GUI or CLI and execute some queries to the Nextcloud database:
    • drop database table *prefix*_mediadc_settings (DROP TABLE oc_mediadc_settings;)
    • delete mediadc migration from *prefix*_migrations (DELETE FROM oc_migrations WHERE app='mediadc';)
  4. Enable MediaDC via GUI or CLI (occ app:enable mediadc)

The problem should be resolved and the mediadc_settings table should be filled with data now.

Let us know if it helps or not.

daufveila commented 2 years ago

I had the same issue and could solve it with the steps, from @andrey18106

kevinkuan1969 commented 2 years ago

Thanks @andrey18106 and it works.

DasGreff commented 2 years ago

I have the same issue here with the v0.1.9, even on fresh install and database cleanup

I'm on Nextcloud 22.2.5 Python 3.8.10 Ubuntu 20.04.4 LTS PHP : 7.4.25 MariaDB : 10.5.12

Here's a pastebin with the error i get when launching occ with mediadc enabled https://pastebin.com/mD2j0gnm

andrey18106 commented 2 years ago

@DasGreff Yea, it seems like something another causing an issue. Unfortunately, because of the war in Ukraine, I could investigate this later, as soon as it is possible, but for now, as for a quick view - looks like Dependency Injection not working for some reason. Are you using Nextcloud Docker or manual installation?

Try to install MediaDC manually by cloning this repository into your Nextcloud apps folder:

  1. Delete mediadc (installed from store).
  2. git clone https://github.com/andrey18106/mediadc.git --depth 1 -b main /path/to/nextcloud/apps/mediadc
  3. php -f /path/to/nextcloud/occ app:enable mediadc
DasGreff commented 2 years ago

It's a manual instalation of Nextcloud inside an LXC caontainer

I had the same issue instaling mediadc by cloning it, i rolled back to v 0.1.8

@andrey18106 hope you are safe, take care of yourself first, this can wait

andrey18106 commented 2 years ago

@DasGreff Thanks, I'm safe for now.

Just a little question, why in your error logs, collectorService written from the small letter - of course, it can't find it, because there is CollectorService in a capital case.

Can you describe your configuration in more detail, to have an overall understanding, of why it could happen?

With MediaDC v0.1.8 it works fine?

DasGreff commented 2 years ago

Yes it works fine with v0.1.8

I installed Nextcloud with the archive file downloadable on nextcloud site on my ubuntu which is a lxd container I then installed MediaDC app with the appstore within the nextcloud app

If you'll need more info, i will provide them

PAStheLoD commented 2 years ago

Hi, just one more datapoint, I get a similar error on version 0.1.9 on Hetzner's Storage Share 24.0.5 (which is their branded nextcloud [fork?]). Unfortunately it seems there's no way to access the server logs.

bigcat88 commented 1 year ago

Is this still a current issue?

SpyFax commented 1 year ago

@kevinkuan1969 @ibib Hi! Yea, it's my flaw.

To fix it follow the next steps, before waiting for the next update (I'll re-release 0.1.9 soon):

1. Disable MediaDC via GUI or CLI (`occ app:disable mediadc`)

2. Update file `/lib/Service/UtilsService.php` like in the commit.

3. Connect to your database via GUI or CLI and execute some queries to the Nextcloud database:

   * drop database table `*prefix*_mediadc_settings` (`DROP TABLE oc_mediadc_settings;`)
   * delete mediadc migration from `*prefix*_migrations` (`DELETE FROM oc_migrations WHERE app='mediadc';`)

4. Enable MediaDC via GUI or CLI (`occ app:enable mediadc`)

The problem should be resolved and the mediadc_settings table should be filled with data now.

Let us know if it helps or not.

Update form 0.2.0 to 0.3.1 on Nextcloud 25.0.2, and flow this step . MediaDC web page can open but task not work , always show pending, When use version 0.2.0 task run only take a few seconds.

andrey18106 commented 1 year ago

@SpyFax MediaDC starting from 0.3.0 version requires cloud_py_api app to be installed and enabled first. After that you can just re-enable MediaDC to properly update settings and download pre-compiled python binary, then it should work. Let us know if it works or not.

SpyFax commented 1 year ago

@SpyFax MediaDC starting from 0.3.0 version requires cloud_py_api app to be installed and enabled first. After that you can just re-enable MediaDC to properly update settings and download pre-compiled python binary, then it should work. Let us know if it works or not.

I had install cloud_py_api first, then error message showing in log file. like Did expect one result but found none when executing: query "SELECT * FROM *PREFIX*mediadc_settings WHERE name = :dcValue1"; , I tried delete database table and re-enable MediaDC, then MediaDC page can open, but restart an old task or create new task both forzen at pending status.

andrey18106 commented 1 year ago

@SpyFax Check Nextcloud appdata folder, where delete mediadc/binaries/main file if it exists and re-enable MediaDC - python binary should be downloaded correctly.

SpyFax commented 1 year ago

@SpyFax Check Nextcloud appdata folder, where delete mediadc/binaries/main file if it exists and re-enable MediaDC - python binary should be downloaded correctly.

There is not have folder name binaries, but when I update to mediadc 0.3.2, it auto download some thing in python folder like this image

Then I tried to re-enable MediaDC and create new task, it still forzen at pending status. image

andrey18106 commented 1 year ago

@SpyFax binaries folder is in nextcloud appdata folder (/var/www/nextcloud/data/appdata_ncinstanceid/mediadc/binaries). Please, verify it and try again. Python folder - it's a source that you can use instead of pre-compiled binaries, but you need to manully install all required packages, check out instruction for that in wiki 0.3.0 notice

SpyFax commented 1 year ago

@SpyFax binaries folder is in nextcloud appdata folder (/var/www/nextcloud/data/appdata_ncinstanceid/mediadc/binaries). Please, verify it and try again. Python folder - it's a source that you can use instead of pre-compiled binaries, but you need to manully install all required packages, check out instruction for that in wiki 0.3.0 notice

Thanks, after re-download a main file that about 223M, task seem working now

$ ls -alh /var/www/nextcloud/data/appdata_ocaad8s3ujca/mediadc/binaries/
total 223M
drwxr-xr-x 2 www-data www-data 4.0K Jan 16 16:30 .
drwxr-xr-x 4 www-data www-data 4.0K Jan 16 16:13 ..
-rwxr-xr-x 1 www-data www-data 223M Jan 16 16:30 main
andrey18106 commented 1 year ago

Closing as stale and resolved.

If have any questions feel free to create a new issue.

kanwarplaha commented 4 months ago

@andrey18106 I tried to install MediaDC manually via occ and I still see "Internal Server Error".

$ php -f /var/www/html/occ app:enable mediadc
mediadc 0.3.9 enabled

I am running NextCloud AIO v29.0.3.