OnlyOffice not opening (docs, spreadies) on NextCloud

ONLYOFFICE cloud: Free
Do you want to: Report a bug

For bug reports, provide the steps to reproduce and if possible a minimal demo of the problem.

I assume this happened after I upgraded NextCloud to 25.0.8 but not 100% definite. I have upgraded to 25.0.9 and there’s no change.

When I click on a doc or spreadie, I expected it to open in OnlyOffice, but it won’t. The screen flashes white and then snaps back to the NextCloud colour, showing the file URL still but no OnlyOffice. I can open PDFs, and download files, but not open them in OnlyOffice.

Where do I go from here please?

I deinstalled onlyoffice and redownloaded and enabled it. It made no difference.

I found this in the nextcloud log, but I can’t see how I can act on it:

{
   "reqId":"t0PQWExbah8cfG5AX9Xz",
   "level":3,
   "time":"2023-07-25T18:23:10+00:00",
   "remoteAddr":"xx.xxx.201.220",
   "user":"adam",
   "app":"index",
   "method":"GET",
   "url":"/core/preview?fileId=9850&x=250&y=250",
   "message":"Too few arguments to function Firebase\\JWT\\JWT::encode(), 2 passed in /home/carbonc/sites/cloud/apps/onlyoffice/lib/crypt.php on line 53 and at least 3 expected in file '/home/carbonc/sites/cloud/apps/oidc/vendor/firebase/php-jwt/src/JWT.php' line 193",
   "userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0",
   "version":"25.0.9.2",
   "exception":{
      "Exception":"Exception",
      "Message":"Too few arguments to function Firebase\\JWT\\JWT::encode(), 2 passed in /home/carbonc/sites/cloud/apps/onlyoffice/lib/crypt.php on line 53 and at least 3 expected in file '/home/carbonc/sites/cloud/apps/oidc/vendor/firebase/php-jwt/src/JWT.php' line 193",
      "Code":0,
      "Trace":[
         {
            "file":"/home/carbonc/sites/cloud/lib/private/AppFramework/App.php",
            "line":172,
            "function":"dispatch",
            "class":"OC\\AppFramework\\Http\\Dispatcher",
            "type":"->"
         },
         {
            "file":"/home/carbonc/sites/cloud/lib/private/Route/Router.php",
            "line":298,
            "function":"main",
            "class":"OC\\AppFramework\\App",
            "type":"::"
         },
         {
            "file":"/home/carbonc/sites/cloud/lib/base.php",
            "line":1053,
            "function":"match",
            "class":"OC\\Route\\Router",
            "type":"->"
         },
         {
            "file":"/home/carbonc/sites/cloud/index.php",
            "line":36,
            "function":"handleRequest",
            "class":"OC",
            "type":"::"
         }
      ],
      "File":"/home/carbonc/sites/cloud/lib/private/AppFramework/Http/Dispatcher.php",
      "Line":165,
      "Previous":{
         "Exception":"ArgumentCountError",
         "Message":"Too few arguments to function Firebase\\JWT\\JWT::encode(), 2 passed in /home/carbonc/sites/cloud/apps/onlyoffice/lib/crypt.php on line 53 and at least 3 expected",
         "Code":0,
         "Trace":[
            {
               "file":"/home/carbonc/sites/cloud/apps/onlyoffice/lib/crypt.php",
               "line":53,
               "function":"encode",
               "class":"Firebase\\JWT\\JWT",
               "type":"::"
            },
            {
               "file":"/home/carbonc/sites/cloud/apps/onlyoffice/lib/preview.php",
               "line":322,
               "function":"GetHash",
               "class":"OCA\\Onlyoffice\\Crypt",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/apps/onlyoffice/lib/preview.php",
               "line":393,
               "function":"getUrl",
               "class":"OCA\\Onlyoffice\\Preview",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/apps/onlyoffice/lib/preview.php",
               "line":261,
               "function":"getFileParam",
               "class":"OCA\\Onlyoffice\\Preview",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/Preview/ProviderV1Adapter.php",
               "line":53,
               "function":"getThumbnail",
               "class":"OCA\\Onlyoffice\\Preview",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/Preview/GeneratorHelper.php",
               "line":65,
               "function":"getThumbnail",
               "class":"OC\\Preview\\ProviderV1Adapter",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/Preview/Generator.php",
               "line":343,
               "function":"getThumbnail",
               "class":"OC\\Preview\\GeneratorHelper",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/Preview/Generator.php",
               "line":162,
               "function":"getMaxPreview",
               "class":"OC\\Preview\\Generator",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/Preview/Generator.php",
               "line":114,
               "function":"generatePreviews",
               "class":"OC\\Preview\\Generator",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/PreviewManager.php",
               "line":185,
               "function":"getPreview",
               "class":"OC\\Preview\\Generator",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/core/Controller/PreviewController.php",
               "line":144,
               "function":"getPreview",
               "class":"OC\\PreviewManager",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/core/Controller/PreviewController.php",
               "line":113,
               "function":"fetchPreview",
               "class":"OC\\Core\\Controller\\PreviewController",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/AppFramework/Http/Dispatcher.php",
               "line":225,
               "function":"getPreviewByFileId",
               "class":"OC\\Core\\Controller\\PreviewController",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/AppFramework/Http/Dispatcher.php",
               "line":133,
               "function":"executeController",
               "class":"OC\\AppFramework\\Http\\Dispatcher",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/AppFramework/App.php",
               "line":172,
               "function":"dispatch",
               "class":"OC\\AppFramework\\Http\\Dispatcher",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/Route/Router.php",
               "line":298,
               "function":"main",
               "class":"OC\\AppFramework\\App",
               "type":"::"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/base.php",
               "line":1053,
               "function":"match",
               "class":"OC\\Route\\Router",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/index.php",
               "line":36,
               "function":"handleRequest",
               "class":"OC",
               "type":"::"
            }
         ],
         "File":"/home/carbonc/sites/cloud/apps/oidc/vendor/firebase/php-jwt/src/JWT.php",
         "Line":193
      },
      "CustomMessage":"--"
   }
}

There is a second error as well:

{
   "reqId":"f6oe0Amhc2ZKViCS4apM",
   "level":3,
   "time":"2023-07-25T18:23:13+00:00",
   "remoteAddr":"51.155.201.220",
   "user":"adam",
   "app":"no app in context",
   "method":"GET",
   "url":"/ocs/v2.php/apps/onlyoffice/api/v1/config/491?filePath=%2FCarbon%20Account.xlsx&guestName=null&inframe=true",
   "message":"Too few arguments to function Firebase\\JWT\\JWT::encode(), 2 passed in /home/carbonc/sites/cloud/apps/onlyoffice/lib/crypt.php on line 53 and at least 3 expected in file '/home/carbonc/sites/cloud/apps/oidc/vendor/firebase/php-jwt/src/JWT.php' line 193",
   "userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0",
   "version":"25.0.9.2",
   "exception":{
      "Exception":"Exception",
      "Message":"Too few arguments to function Firebase\\JWT\\JWT::encode(), 2 passed in /home/carbonc/sites/cloud/apps/onlyoffice/lib/crypt.php on line 53 and at least 3 expected in file '/home/carbonc/sites/cloud/apps/oidc/vendor/firebase/php-jwt/src/JWT.php' line 193",
      "Code":0,
      "Trace":[
         {
            "file":"/home/carbonc/sites/cloud/lib/private/AppFramework/App.php",
            "line":172,
            "function":"dispatch",
            "class":"OC\\AppFramework\\Http\\Dispatcher",
            "type":"->"
         },
         {
            "file":"/home/carbonc/sites/cloud/lib/private/Route/Router.php",
            "line":298,
            "function":"main",
            "class":"OC\\AppFramework\\App",
            "type":"::"
         },
         {
            "file":"/home/carbonc/sites/cloud/ocs/v1.php",
            "line":64,
            "function":"match",
            "class":"OC\\Route\\Router",
            "type":"->"
         },
         {
            "file":"/home/carbonc/sites/cloud/ocs/v2.php",
            "line":23,
            "args":[
               "/home/carbonc/sites/cloud/ocs/v1.php"
            ],
            "function":"require_once"
         }
      ],
      "File":"/home/carbonc/sites/cloud/lib/private/AppFramework/Http/Dispatcher.php",
      "Line":165,
      "Previous":{
         "Exception":"ArgumentCountError",
         "Message":"Too few arguments to function Firebase\\JWT\\JWT::encode(), 2 passed in /home/carbonc/sites/cloud/apps/onlyoffice/lib/crypt.php on line 53 and at least 3 expected",
         "Code":0,
         "Trace":[
            {
               "file":"/home/carbonc/sites/cloud/apps/onlyoffice/lib/crypt.php",
               "line":53,
               "function":"encode",
               "class":"Firebase\\JWT\\JWT",
               "type":"::"
            },
            {
               "file":"/home/carbonc/sites/cloud/apps/onlyoffice/controller/editorapicontroller.php",
               "line":681,
               "function":"GetHash",
               "class":"OCA\\Onlyoffice\\Crypt",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/apps/onlyoffice/controller/editorapicontroller.php",
               "line":294,
               "function":"getUrl",
               "class":"OCA\\Onlyoffice\\Controller\\EditorApiController",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/AppFramework/Http/Dispatcher.php",
               "line":225,
               "function":"config",
               "class":"OCA\\Onlyoffice\\Controller\\EditorApiController",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/AppFramework/Http/Dispatcher.php",
               "line":133,
               "function":"executeController",
               "class":"OC\\AppFramework\\Http\\Dispatcher",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/AppFramework/App.php",
               "line":172,
               "function":"dispatch",
               "class":"OC\\AppFramework\\Http\\Dispatcher",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/lib/private/Route/Router.php",
               "line":298,
               "function":"main",
               "class":"OC\\AppFramework\\App",
               "type":"::"
            },
            {
               "file":"/home/carbonc/sites/cloud/ocs/v1.php",
               "line":64,
               "function":"match",
               "class":"OC\\Route\\Router",
               "type":"->"
            },
            {
               "file":"/home/carbonc/sites/cloud/ocs/v2.php",
               "line":23,
               "args":[
                  "/home/carbonc/sites/cloud/ocs/v1.php"
               ],
               "function":"require_once"
            }
         ],
         "File":"/home/carbonc/sites/cloud/apps/oidc/vendor/firebase/php-jwt/src/JWT.php",
         "Line":193
      },
      "CustomMessage":"--"
   }
}

I have discovered the error message in the issue tracker:

but I’m not familiar with github. The issue remains open, but it is marked “fixed by #855” and there is an annotation on the page saying “Successfully merging a pull request may close this issue.”

Can anyone tell me how to proceed from here to get a onlyoffice working again?

Hello @adam42

Please provide more information about the issue:

  • specify the guide that you have followed to install Document Server;
  • specify where do you host your instance, e.g. dedicated server or any hosting solution;
  • make a screenshot of the connector page when pressing Save button while connecting;

For it navigate to Administration Settings of your Nextcloud portal > ONLYOFFICE.
Once Save button pressed and a pop-up appeared, make screenshot of this page.

  • specify if you are using any proxy services in your environment;
  • a video demonstration of you opening the file to reproduce the issue as you described here:

Thanks for jumping in. I can appreciate you’ve got priorities but it’s getting a bit desperate.

  • the guide: I didn’t install it myself, it was set up for me by my hosting provider. It had worked for 2 years previously.

  • my host is a shared host. I can get a shell to the CLI & config.

  • when I click save in the Administration/OnlyOffice settings, I don’t get a pop-up, I just see a spinning cursor. I haven’t come across this before.

  • I’m not using a proxy

  • see attachmentCinnamon-Aug-01-2023_14:57:29pm.mkv (288.0 KB)

Perhaps contact your hosting provider about this issue?

I think that’s a poor idea. As soon as I tell them the error started after doing a routine upgrade to NextCloud, they’ll point me back here.

Just had to look twice at your avatar Chris - you ARE my hosting provider :laughing:

OK so knowing exactly how you installed it, and knowing what the bug is (linked earlier), do you think there’s something I can do about it?

Adam, can you open a support ticket by emailing support@webarchitects.coop with the server and user account details? Thanks.

1 Like