richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

Internal Error 500 when creating office document in root directory.

Open pnstsk opened this issue 2 years ago • 3 comments

Internal Error 500 when creating an office file in user's root Nextcloud directory on the iOS App. File is not created.

No problems when creating one in a subdirectory and no problems creating those subdirectories. Creating a regular Nextcloud text-document (.md) also works without problem.

To Reproduce Steps to reproduce the behavior:

  1. Open iOS Nextcloud App
  2. Click on "+" button to create new file.
  3. Create new Document/Table/Presentation
  4. Empty template
  5. Path: "/"
  6. Filename: "test123"
  7. Save
  8. Receive "Error 500: Internal Server Error"

Expected behavior Create the file in the directory and open it with Collabora Online.

Client details:

  • OS: iOS 16.0
  • Device: iPhone 13

Version of the Nextcloud App: Nextcloud Liquid for iOS 4.4.0.18

Server details

Operating system: Ubuntu 22.04 Server

Web server: Built-in apache2 of the Docker container. Reverse-proxied through an Nginx container.

Database: MariaDB 10.6

PHP version: 8.0.23

Nextcloud version: 24.0.5

Version of the richdocuments app: 6.2.0

Version of Collabora Online: 22.05.6.1

Logs

Nextcloud throws the following error to the log:


[no app in context] Fehler: Exception: ltrim(): Argument #1 ($string) must be of type string, null given in file '/var/www/html/lib/private/Files/Node/LazyUserFolder.php' line 59 at <<closure>>

0. /var/www/html/lib/private/AppFramework/App.php line 172
   OC\AppFramework\Http\Dispatcher->dispatch(OCA\Richdocument ... {}, "createFromTemplate")
1. /var/www/html/lib/private/Route/Router.php line 298
   OC\AppFramework\App::main("OCA\\Richdocume ... r", "createFromTemplate", OC\AppFramework\ ... {}, ["ocs.richdocume ... "])
2. /var/www/html/ocs/v1.php line 62
   OC\Route\Router->match("/ocsapp/apps/ri ... w")
3. /var/www/html/ocs/v2.php line 23
   require_once("/var/www/html/ocs/v1.php")

POST /ocs/v2.php/apps/richdocuments/api/v1/templates/new?format=json
from ip by user at 2022-09-22T07:38:11+00:00

pnstsk avatar Sep 22 '22 08:09 pnstsk

Thanks for reporting, unfortunately the log message is missing some context. Could you paste the raw json data of the log error?

juliusknorr avatar Sep 23 '22 06:09 juliusknorr

Thanks for the reply. Here you go:

raw json

{"reqId":"iUCVbjzE2xljCGLRGh7y","level":3,"time":"2022-09-23T06:51:22+00:00","remoteAddr":"my ip","user":"username","app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/richdocuments/api/v1/templates/new?format=json","message":"ltrim(): Argument #1 ($string) must be of type string, null given in file '/var/www/html/lib/private/Files/Node/LazyUserFolder.php' line 59","userAgent":"Mozilla/5.0 (iOS) Nextcloud-iOS/4.4.0","version":"24.0.5.1","exception":{"Exception":"Exception","Message":"ltrim(): Argument #1 ($string) must be of type string, null given in file '/var/www/html/lib/private/Files/Node/LazyUserFolder.php' line 59","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Richdocuments\\Controller\\OCSController"},"createFromTemplate"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Richdocuments\\Controller\\OCSController","createFromTemplate",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},["ocs.richdocuments.OCS.createFromTemplate"]]},{"file":"/var/www/html/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/richdocuments/api/v1/templates/new"]},{"file":"/var/www/html/ocs/v2.php","line":23,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","Line":165,"Previous":{"Exception":"TypeError","Message":"ltrim(): Argument #1 ($string) must be of type string, null given","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/Node/LazyUserFolder.php","line":59,"function":"ltrim","args":[null,"/"]},{"file":"/var/www/html/custom_apps/richdocuments/lib/Controller/OCSController.php","line":322,"function":"get","class":"OC\\Files\\Node\\LazyUserFolder","type":"->","args":[null]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"createFromTemplate","class":"OCA\\Richdocuments\\Controller\\OCSController","type":"->","args":["Test1234.ods",3375]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Richdocuments\\Controller\\OCSController"},"createFromTemplate"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Richdocuments\\Controller\\OCSController"},"createFromTemplate"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Richdocuments\\Controller\\OCSController","createFromTemplate",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},["ocs.richdocuments.OCS.createFromTemplate"]]},{"file":"/var/www/html/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/richdocuments/api/v1/templates/new"]},{"file":"/var/www/html/ocs/v2.php","line":23,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Files/Node/LazyUserFolder.php","Line":59},"CustomMessage":"--"},"id":"632d576ded759"}

pnstsk avatar Sep 23 '22 07:09 pnstsk

Facing the same issue.

HeyWatchOutDude avatar Sep 25 '22 17:09 HeyWatchOutDude

Fixed by https://github.com/nextcloud/richdocuments/pull/2543

juliusknorr avatar Oct 27 '22 17:10 juliusknorr