otetard / ownpad

Ownpad is a Nextcloud application that allows to create and open Etherpad and Ethercalc documents.
GNU Affero General Public License v3.0
57 stars 24 forks source link

[Bug] Plugin ownpad Crash Nextcloud 27.0.2 greater than 0.9.0 #131

Closed Alpha6333 closed 10 months ago

Alpha6333 commented 10 months ago

Since today we have installed the new plugin via the appstore on doe 0.9.4

As soon as I go into my Nextcloud home dir and there is a .pad in it, some javascript loads in the infinite loop. The browser (Fireforx and Chrome) asks me if I want to stop the script.

Version below 0.9.0 can no longer open the pad files.

sudo -u www-data php8.2 /var/www/nextcloud2/occ status
  - installed: true
  - version: 27.0.2.1
  - versionstring: 27.0.2
  - edition:
  - maintenance: false
  - needsDbUpgrade: false
  - productname: Nextcloud
  - extendedSupport: false
Alpha6333 commented 10 months ago
[ownpad] Fatal: Error: Failed opening required '/var/www/nextcloud2/apps/ownpad/lib/AppInfo/../../3rdparty/autoload.php' (include_path='/var/www/nextcloud2/3rdparty/pear/archive_tar:/var/www/nextcloud2/3rdparty/pear/console_getopt:/var/www/nextcloud2/3rdparty/pear/pear-core-minimal/src:/var/www/nextcloud2/3rdparty/pear/pear_exception:/var/www/nextcloud2/apps') at <<closure>>

0. /var/www/nextcloud2/lib/private/AppFramework/Bootstrap/Coordinator.php line 142
   OCA\Ownpad\AppInfo\Application->register()
1. /var/www/nextcloud2/lib/private/AppFramework/Bootstrap/Coordinator.php line 90
   OC\AppFramework\Bootstrap\Coordinator->registerApps()
2. /var/www/nextcloud2/lib/base.php line 703
   OC\AppFramework\Bootstrap\Coordinator->runInitialRegistration()
3. /var/www/nextcloud2/lib/base.php line 1180
   OC::init()
4. /var/www/nextcloud2/remote.php line 119
   require_once("/var/www/nextcloud2/lib/base.php")

PROPFIND /remote.php/dav/files/xxxxx.xxxxxx/
from xx.xxx.xxx.xx at 2023-08-15T21:56:26+02:00
[PHP] Fehler: require_once(/var/www/nextcloud2/apps/ownpad/lib/AppInfo/../../3rdparty/autoload.php): Failed to open stream: No such file or directory at /var/www/nextcloud2/apps/ownpad/lib/AppInfo/Application.php#46
otetard commented 10 months ago
[PHP] Fehler: require_once(/var/www/nextcloud2/apps/ownpad/lib/AppInfo/../../3rdparty/autoload.php): Failed to open stream: No such file or directory at /var/www/nextcloud2/apps/ownpad/lib/AppInfo/Application.php#46

Are you sure that this error is encoutered with Ownpad 0.9.4? It look very similar to an issue that was fixed in 0.9.1 (missing 3rdparty directory in the produced .tar.gz file).

otetard commented 10 months ago

As soon as I go into my Nextcloud home dir and there is a .pad in it, some javascript loads in the infinite loop. The browser (Fireforx and Chrome) asks me if I want to stop the script.

Can you check the content of config/mimetypealiases.json and config/mimetypemapping.json file please? You can have a look at the README.md file to check their content.

What version of Ownpad was known to work properly?

Alpha6333 commented 10 months ago

Hello, thank you for your quick reply.

Unfortunately I can't tell you if the upper log is from 0.9.0 or higher. I had deleted my logs after your message, activated plugin with the 0.9.4 on Nextcloud 27 and my problem was back. But it did not log the errors. Nextcloud freeze.

The hint with the mimetype was gold and has solved the problem.

$ vi ./config/mimetypealiases.json
# before
{
    "pad": [
        "application/x-ownpad"
    ],
    "": "x-office/document"
}

# after:
{
    "application/x-ownpad": "pad",
    "application/x-ownpad-calc": "calc"
}
$ vi ./config/mimetypemapping.json
# before:
# Entry was missing

# after:
{
    "pad": ["application/x-ownpad"],
    "calc": ["application/x-ownpad-calc"]
}
$ sudo -u www-data php8.2 ./occ maintenance:mimetype:update-js

It works with 0.9.4 under Nextcloud 27 now,

Alpha6333 commented 10 months ago

Mhm, sideeffect.

i have run sudo -u www-data php8.2 ./occ files:scan --all

After that nextcloud not open etherpad files anymore. But the freezing effect is away But create a new pad works

Alpha6333 commented 10 months ago

The effect that I can't open .pad is only with .pad in the home folder. In group folder it works.

A new pad in the home folder works.

Alpha6333 commented 10 months ago

I have expanded the mimetype with the one old entry.

$ vi config/mimetypealiases.json

{
    "application/x-ownpad": "pad",
    "application/x-ownpad-calc": "calc"
    "pad": [ "application/x-ownpad" ]
}

Then I executed the command including a scan.

$ sudo -u www-data php8.2 ./occ maintenance:mimetype:update-js
$ sudo -u www-data php8.2 ./occ files:scan --all

after that i could open the pad in homedir. Then I deleted the one line again and ran a filescan again.

$ vi config/mimetypealiases.json

{
    "application/x-ownpad": "pad",
    "application/x-ownpad-calc": "calc"
}

It worked.

Alpha6333 commented 10 months ago

Thanks for your help