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

Document server fails with "./x2t: Permission denied" #10

Open
Xeyk opened this issue Jan 17, 2020 · 67 comments
Open

Document server fails with "./x2t: Permission denied" #10

Xeyk opened this issue Jan 17, 2020 · 67 comments
Labels
bug Something isn't working

Comments

@Xeyk
Copy link

Xeyk commented Jan 17, 2020

Hey, all. I have updated my Nextcloud instance from 16 to 18. I uninstalled the OnlyOffice app, then reinstalled it. After doing that, I installed the Community Document Server app. Whenever I click on a .doc or .docx file, I get the error stated in the subject.

Please let me know if you need me to pull any logs and I will gladly do so.

@florian-obradovic
Copy link

florian-obradovic commented Jan 17, 2020

Same here, updated from 17>18
image

@tgurr
Copy link

tgurr commented Jan 18, 2020

I got the same error and for me it was a permission problem, installed the app from within Nextcloud, I had the following in the logs:

Error documentserver_community OCA\DocumentServer\Document\DocumentConversionException: sh: ./x2t: Permission denied

Which was fixed by:

$ cd /var/www/vhost.server.domain/htdocs/apps/documentserver_community/3rdparty/onlyoffice/documentserver/server/FileConverter/bin/
$ chmod u+x docbuilder x2t

@poVoq
Copy link

poVoq commented Jan 18, 2020

Same with the official 18.0.0RC2-apache Docker image.

I also just now upgraded from 17 to 18.

@HackintoshHD
Copy link

Thank you, @tgurr - I had similar errors in my logs when I tried to launch a newly installed OnlyOffice Community Edition of Nextcloud 18 and I can confirm a chmod u+x docbuilder x2t in apps/documentserver_community/3rdparty/onlyoffice/documentserver/server/FileConverter/bin/ fixes that.

@Xeyk
Copy link
Author

Xeyk commented Jan 18, 2020

@tgurr Thank you, this got me closer to a solution.

However, when I input this, it switched from a "Permission Denied" error to an "x2t not found" error.. Strangest thing. I am running my installation through docker, which may be the difference.

@skjnldsv skjnldsv added the bug Something isn't working label Jan 18, 2020
@florian-obradovic
Copy link

cd /var/www/nextcloud/apps/documentserver_community/3rdparty/onlyoffice/documentserver/server/FileConverter/bin/ chmod u+x docbuilder x2t
fixes the error "OCA\DocumentServer\Document\DocumentConversionException: sh: 1: ./x2t: Permission denied"
image

But it doesn't fix the main issue "Community document server is not supported for this instance, please setup and configure an external document server"

@xorbital
Copy link

I fixed it by:

  1. Deactivating and uninstalling OnlyOffice and the document server
  2. Reinstalling OnlyOffice
  3. Reinstalling Document Server
  4. Applying the chmod fix by @tgurr

@emasty
Copy link

emasty commented Jan 18, 2020

It fixed the permission denied log-entry but not the the "not supported" issue.
I also tried the solution @xorbital suggested.

I am running the official nextcloud:latest docker container behind a reverse proxy. Could that be an issue? There is a entry in the onlyoffice settings called "Service address" for the documentserver. The reverse proxy does forward that address to the docker container but I don't know if the docker image handles that correctly. On the other hand, the "permission denied" log entry shouldn't occur if the documentserver could not be accessed...

@molle100
Copy link

Thanks, but how can I realize the fix if my NC is running with a Webhoster: Where do I have to go and enter this?
$ cd/var/www/vhost.server.domain/htdocs/apps/documentserver_community/3rdparty/onlyoffice/documentserver/server/FileConverter/bin/
$ chmod u+x docbuilder x2t

Is it likely that there will be an update vor the apps that solve the problem without manually fixing it?

@autoize

This comment was marked as spam.

@Marcwa19197
Copy link

Marcwa19197 commented Jan 18, 2020

I got exactly the same issue.
I updated manually (Downloading ZIP, copying old config.php and run occ upgrade) from NC 17 (latest patchlevel) to NC 18.

I installed the Community Document Server App (which i did not found in any officlal documentation) and installed ONLYOFFICE-App.

I even tried the permission fix by @tgurr without success. I'm still getting the errormessage "Community document server is not supported for this instance, please setup and configure an external document server"

Edit: Using Ubuntu 16.04 here.

@OnyxSky
Copy link

OnyxSky commented Jan 18, 2020

$ cd /var/www/vhost.server.domain/htdocs/apps/documentserver_community/3rdparty/onlyoffice/documentserver/server/FileConverter/bin/
$ chmod u+x docbuilder x2t

For CentOS, RedHat & selinux distro do as root in addition to above

setsebool -P httpd_unified 1
ausearch -c 'x2t' --raw | audit2allow -M my-x2t
semodule -i my-x2t.pp

@NiTRoeSE
Copy link

NiTRoeSE commented Jan 18, 2020

Same problem here.. the "chmod fix" fixes only the error message but not the "Community document server is not supported for this instance, please setup and configure an external document server"
message.

I also deleted and reinstalled both apps, but it didnt help. Same config runs fine in NC18 RC2..thats strange. I also have done a manual upgrade from NC18 RC2 to NC18.

OS: Centos7 x64

@edwardscaleb9
Copy link

edwardscaleb9 commented Jan 19, 2020

Same issue here. I manually upgraded from 17.0.1 to 18.0.0, installed ONLYOFFICE then Community Document Server, ran the chmod fix. I'm running NextCloud on Ubuntu 18.04 behind a Citrix Netscaler doing SSL offloading.

@xthursdayx
Copy link

xthursdayx commented Jan 19, 2020

I'm having this same problem, and unfortunately the solution posted by @tgurr didn't work for me.

@icewind1991 icewind1991 changed the title "Community document server is not supported for this instance, please setup and configure an external document server" Document server fails with "./x2t: Permission denied" Jan 19, 2020
@icewind1991
Copy link
Member

0.1.2 should fix most of the "permission denied" errors.

For the sake of keeping the overview, if you're getting "Community document server not supported" errors with different causes in the log, please open a separate issue.

@Marcwa19197
Copy link

Marcwa19197 commented Jan 19, 2020

0.1.2 should fix most of the "permission denied" errors.

For the sake of keeping the overview, if you're getting "Community document server not supported" errors with different causes in the log, please open a separate issue.

It also fixed the "Community document server is not supported for this instance, please setup and configure an external document server" error for me! Nice!

Edit: Now if i click on an Office-Document in the Webinterface its showing just an white page an nothing else happens. If i do an manual refresh of the page, "Onlyoffice" is loading and i can edit/view the file!

Edit2: My issue seems to be: #13

Everything working now, thanks!

@NiTRoeSE
Copy link

0.1.2 should fix most of the "permission denied" errors.

For the sake of keeping the overview, if you're getting "Community document server not supported" errors with different causes in the log, please open a separate issue.

confirmed, version 0.1.2 works for me. :) thanks!

@xthursdayx
Copy link

Unfortunately I'm still getting the "Community document server is not supported for this instance, please setup and configure an external document server" error, but there are not any entires in my log, even with debug enabled. Any ideas where I should start trouble shooting?

@NiTRoeSE
Copy link

Unfortunately I'm still getting the "Community document server is not supported for this instance, please setup and configure an external document server" error, but there are not any entires in my log, even with debug enabled. Any ideas where I should start trouble shooting?

Was the same for me... upgrading document server to version 0.1.2 fixed it for me. Maybe its useful to restart webserver and deleting your browser cache... and/or deactivate and delete onlyoffice app and reinstall it after you have upgraded document-server app.

@poVoq
Copy link

poVoq commented Jan 19, 2020

You might also have to click the save button in the OO connector app at least once even if not changing anything?

@florian-obradovic
Copy link

Fixed with current version for me as well. Thx a lot for the fast fix!

@polandy
Copy link

polandy commented Jan 19, 2020

For me the Community Document Server upgrade to 0.1.2 fixed it! Awesome, thx a lot!

@ostasevych
Copy link

ostasevych commented Jan 20, 2020

I fixed my issues by upgrading glibc to 2.14+, what is normally required by the document server, so, please, check.

@Xeyk
Copy link
Author

Xeyk commented Jan 20, 2020

Unfortunately, upgrading to glibc 2.30 didn't work for me. I actually had to install it since I am running the Linuxserver.io version of Nextcloud which uses Alpine linux's musl libc. I think the installation worked as I got a new error stating

./x2t: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

I installed libstdc++6 which worked successfully, now I am back to the same message ""Community document server is not supported for this instance" However, no new error messages in the log are coming up.

@xthursdayx
Copy link

xthursdayx commented Jan 21, 2020

Unfortunately, upgrading to glibc 2.30 didn't work for me. I actually had to install it since I am running the Linuxserver.io version of Nextcloud which uses Alpine linux's musl libc. I think the installation worked as I got a new error stating

./x2t: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

I installed libstdc++6 which worked successfully, now I am back to the same message ""Community document server is not supported for this instance" However, no new error messages in the log are coming up.

I'm also running the Linuxserver Nextcloud container, so perhaps that has something to do with it? Anyway, please do update here if you find a solution.

I just reinstalled both apps, applied the chmod fix @tgurr described and am still getting the ./x2t not found error.

For anyone else running the Linuxserver Nextclouder Docker container, here is the related issue: linuxserver/docker-nextcloud#128

[documentserver_community] Error: OCA\DocumentServer\Document\DocumentConversionException: sh: ./x2t: not found
 at <<closure>>

0. /config/www/nextcloud/apps/documentserver_community/lib/Document/ConverterBinary.php line 64
   OCA\DocumentServer\Document\ConverterBinary->run("")
1. /config/www/nextcloud/apps/documentserver_community/lib/Controller/StaticController.php line 90
   OCA\DocumentServer\Document\ConverterBinary->test()
2. /config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 170
   OCA\DocumentServer\Controller\StaticController->webApps("apps/api/documents/api.js")
3. /config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 99
   OC\AppFramework\Http\Dispatcher->executeController(OCA\DocumentServ ... {}, "webApps")
4. /config/www/nextcloud/lib/private/AppFramework/App.php line 125
   OC\AppFramework\Http\Dispatcher->dispatch(OCA\DocumentServ ... {}, "webApps")
5. /config/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
   OC\AppFramework\App::main("OCA\\DocumentSe ... r", "webApps", OC\AppFramework\ ... {}, {path: "apps/api ... "})
6. <<closure>>
   OC\AppFramework\Routing\RouteActionHandler->__invoke({path: "apps/api ... "})
7. /config/www/nextcloud/lib/private/Route/Router.php line 299
   call_user_func(OC\AppFramework\ ... {}, {path: "apps/api ... "})
8. /config/www/nextcloud/lib/base.php line 1008
   OC\Route\Router->match("/apps/documents ... s")
9. /config/www/nextcloud/index.php line 38
   OC::handleRequest()

GET /apps/documentserver_community/web-apps/apps/api/documents/api.js
from 172.19.0.1 by xthursdayx at 2020-01-21T17:06:57+00:00

@GreySyntax
Copy link

Summarising the issue on: linuxserver/docker-nextcloud#128
Looking at the build process for this plugin it is currently extracting large parts of the onlyoffice/documentserver image. The version being extracted seems to only be x86-64 (won’t work on arm,ppc,etc). And the image itself is based on Ubuntu and installs the relevant deb package. This issue will likely be faced with any native binaries in the plugin.

It would probably be best if nextcloud shipped fat versions of native binaries to support multiple platforms and statically linked any dependencies to ensure they are portable across distros.

@marshalleq
Copy link

I'm also getting the ONLYOFFICE cannot be reached. Please contact admin. I've set the permissions of x2t as per above and still no luck. It would be useful to know if this is DNS related or permissions related. I suspect it's DNS related (or reverse proxy related) based on the below.

2020/01/29 20:31:06 [error] 347#347: *192092 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 172.18.0.3, server: _, request: "GET /ocs/v2.php/core/navigation/apps?absolute=true&format=json HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.domain.com"
2020/02/06 10:25:19 [error] 347#347: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.3, server: _, request: "PROPFIND /remote.php/dav/files/9e40bcc8-5a53-1039-9f93-d18f70623e38/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.domain.com"
2020/02/09 17:44:25 [error] 346#346: *72 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 172.18.0.3, server: _, request: "GET /csrftoken HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.domain.com"

And the result of that is OCA\DocumentServer\Document\DocumentConversionException: sh: ./x2t: not found

Nextcloud itself DOES resolve via my set up reverse proxy correctly, so unless there's an extra line needed for onlyoffice, but I assume they both communicate via the same web server over port 443. It is only the onlyoffice instance that's not working, so there must be something basic I'm missing. Also I assume the port 9000 above is some internal port that is set up for nextcloud / onlyoffice and doesn't need to be entered into the url anywhere...

BTW I'm using the linuxserver.io container...

@lalala119
Copy link

I got exactly same issue that xthursdayx has. Any hints?

@xthursdayx
Copy link

I got exactly same issue that xthursdayx has. Any hints?

To my knowledge, this hasn’t been fixed. Or at least nothing I’ve done has fixed the issue.

@sean-sullivan1
Copy link

sean-sullivan1 commented Feb 14, 2020

I'll throw my error into the party too hopefully someone can provide a fix. I did run the chmod command that @tgurr posted previously. I am also running this in docker.

[documentserver_community] Error: OCA\DocumentServer\Document\DocumentConversionException: sh: ./x2t: not found
 at <<closure>>

 0. /config/www/nextcloud/apps/documentserver_community/lib/Document/ConverterBinary.php line 72
    OCA\DocumentServer\Document\ConverterBinary->run("")
 1. /config/www/nextcloud/apps/documentserver_community/lib/SetupCheck.php line 34
    OCA\DocumentServer\Document\ConverterBinary->test()
 2. /config/www/nextcloud/apps/documentserver_community/lib/Controller/StaticController.php line 89
    OCA\DocumentServer\SetupCheck->check()
 3. /config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 170
    OCA\DocumentServer\Controller\StaticController->webApps("apps/api/documents/api.js")
 4. /config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 99
    OC\AppFramework\Http\Dispatcher->executeController(OCA\DocumentServ ... {}, "webApps")
 5. /config/www/nextcloud/lib/private/AppFramework/App.php line 125
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\DocumentServ ... {}, "webApps")
 6. /config/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main("OCA\\DocumentSe ... r", "webApps", OC\AppFramework\ ... {}, {path: "apps/api ... "})
 7. <<closure>>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({path: "apps/api ... "})
 8. /config/www/nextcloud/lib/private/Route/Router.php line 299
    call_user_func(OC\AppFramework\ ... {}, {path: "apps/api ... "})
 9. /config/www/nextcloud/lib/base.php line 1008
    OC\Route\Router->match("/apps/documents ... s")
10. /config/www/nextcloud/index.php line 38
    OC::handleRequest()

GET /apps/documentserver_community/web-apps/apps/api/documents/api.js
from 40.142.6.210 by sean at 2020-02-14T15:15:21+00:00

@kesselb
Copy link

kesselb commented Feb 15, 2020

https://autoize.com/building-onlyoffice-document-server-from-source/ is a guide how to compile document server from source. Could someone try to recompile with muslc?

@wuast94
Copy link

wuast94 commented Feb 15, 2020

I am using the actual nextcloud apache 18.xx version.. Onlyoffice working fine..the move to this container is a bit tricky but worked for me.

But for someone how don't know that much about sysadmin should stay on Linux server version and wait for a working onlyoffice version I think

@xthursdayx
Copy link

I just updated to nc18.0.1, reinstalled both the Community Document Server and OnlyOffice, and applied @tgurr 's fix and am still getting the ./x2t: not found error. However, I'm also getting a new linked error: Exception: trim() expects parameter 1 to be string, bool given. See the log below.

[index] Error: Exception: trim() expects parameter 1 to be string, bool given at <<closure>>

0. /config/www/nextcloud/lib/private/AppFramework/App.php line 125
   OC\AppFramework\Http\Dispatcher->dispatch(OCA\DocumentServ ... {}, "webApps")
1. /config/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
   OC\AppFramework\App::main("OCA\\DocumentSe ... r", "webApps", OC\AppFramework\ ... {}, {path: "apps/api ... "})
2. <<closure>>
   OC\AppFramework\Routing\RouteActionHandler->__invoke({path: "apps/api ... "})
3. /config/www/nextcloud/lib/private/Route/Router.php line 299
   call_user_func(OC\AppFramework\ ... {}, {path: "apps/api ... "})
4. /config/www/nextcloud/lib/base.php line 1008
   OC\Route\Router->match("/apps/documents ... s")
5. /config/www/nextcloud/index.php line 38
   OC::handleRequest()

GET /apps/documentserver_community/web-apps/apps/api/documents/api.js
from 172.19.0.1 by xthursdayx at 2020-02-16T20:49:08+00:00

@Disco1
Copy link

Disco1 commented Feb 24, 2020

For those on CentOS 7 / SELinux, do this first: #10 (comment)

... then, in nextcloud/apps/documentserver_community/3rdparty/onlyoffice/documentserver/server/FileConverter/bin/

chcon --type httpd_sys_script_exec_t *.so.58
chcon --type httpd_sys_script_exec_t *.so

@anatomism
Copy link

anatomism commented Feb 25, 2020

For those on CentOS 7 / SELinux, do this first: #10 (comment)

... then, in nextcloud/apps/documentserver_community/3rdparty/onlyoffice/documentserver/server/FileConverter/bin/

chcon --type httpd_sys_script_exec_t *.so.58
chcon --type httpd_sys_script_exec_t *.so

This worked for me when trying to view on mobile app, however as with the above (and comment 10) I had to also include the binary, x2t, so the following was done for me to make it work

cd <nextcloud_root_folder>/apps/documentserver_community/3rdparty/onlyoffice/documentserver/server/FileConverter/bin/

chmod u+x docbuilder x2t
setsebool -P httpd_unified 1
ausearch -c 'x2t' --raw | audit2allow -M my-x2t
semodule -i my-x2t.pp

chcon --type httpd_sys_script_exec_t *.so.58
chcon --type httpd_sys_script_exec_t *.so
chcon --type httpd_sys_script_exec_t x2t

My install is CentOS 7 latest with SELinux enabled

I also have an install with CentOS 8 and I haven't had to do the latter part of the above as far as I can remember, seems to be an issue with CentOS 7 only

@NoxInmortus
Copy link

Hello, there seems to be no reports from Nextcloud or DocumentServer staff here about the resolution of this issue. Does it progress in any way?

@skjnldsv
Copy link
Member

Please also remember that the files needs to be owned by the html user (www-data usually, adjust to your setup)

@siccovansas
Copy link

siccovansas commented Mar 14, 2020

For those who use an alpine Nextcloud image in their docker compose (which I had because Nextcloud uses alpine in their docker compose example code), you can switch to using the non-alpine Nextcloud image. That way I got Onlyoffice to work.

As always, make sure you have backups!

  • Remove the -alpine part from the nextcloud service in your docker-compose.yml (also remove alpine versions from containers that mount your nextcloud folder, like cron and web/nginx containers, and rebuild them)
  • Run docker-compose pull
  • Run docker-compose up -d
  • Change ownership permissions as alpine uses a different user id (change nextcloud_app_1 to your container name if it is different): docker exec nextcloud_app_1 chown -R www-data:root /var/www
  • You might need to do a docker-compose restart and/or reinstall the community document server and ONLYOFFICE apps

@gfiasco
Copy link

gfiasco commented Mar 16, 2020

I have tried everything in here but nothing seem to work around this

I'm using nextcloud:stable with mysql as db.

even fresh installation suffers of this

@oucil
Copy link

oucil commented Jul 28, 2020

setsebool -P httpd_unified 1

If anyone read this above with reference to CentOS and is serious about using SELinux properly, DO NOT do this, as it essentially tells SELinux to stop enforcing anything for httpd effectively giving it all permissions for any resources assigned to the Apache user. Do a little more work and figure out what specific contexts / boolean permissions you need and enable them, and only them. If you're using php_fpm, you can further isolate your permissions using sub-contexts, and different apache child users.

@zynexiz
Copy link

zynexiz commented Aug 7, 2020

As stated above, don't disable selniux to enforce it's policy's. I just had the same problem and solved it by adding a policy to selinux. The sever needs to execute the binary, so instead add the following (might have to change the path to your installation folder) for CentOS;

semanage fcontext -a -t httpd_sys_script_exec_t '/var/www/html/nextcloud/apps/documentserver_community/3rdparty/onlyoffice/documentserver(/.*)?'
restorecon -R -v /var/www/html/nextcloud

@yardbro
Copy link

yardbro commented Oct 14, 2020

Old thread but to anyone still experiencing this issue, ensure that you use -R when applying chown (chown -R www-data:www-data documentserver_community/) if you installed the Community Document Server app manually. I had this exact issue and realized that I had only been changing ownership of the main directory, not the sub-directories. Hope this helps someone

@deajan
Copy link

deajan commented Oct 14, 2020

For whoever might be concerned about the more recent problems with x2t and onlyoffice, eg OCA\DocumentServer\Document\DocumentConversionException: ./x2t: error while loading shared libraries: libgraphics.so: cannot open shared object file: No such file or directory

Check if your problem is SELinux related, eg disable selinux with setenforce 0 and try again.
If so, re-enable selinux with setenforce 1 and proceed to create the following Selinux policy:

Create file /root/my-onlyoffice.te containing


module my-onlyoffice 1.0;

require {
        type httpd_sys_script_exec_t;
        type httpd_t;
        type ld_so_t;
        type configfs_t;
        class file { execute_no_trans setattr };
        class dir { getattr };
}

#============= httpd_sys_script_exec_t ==============
allow httpd_t httpd_sys_script_exec_t:file setattr;
allow httpd_t ld_so_t:file execute_no_trans;
allow httpd_t configfs_t:dir getattr;

Now proceed to create a module from that file with command

checkmodule -M -m -o /root/my-onlyoffice.mod /root/my-onlyoffice.te

Now create a selinux loadable policy

semodule_package -o /root/my-onlyoffice.pp -m /root/my-onlyoffice.mod

Load the policy with cd /root && semodule -i my-onlyoffice.pp

Now it's time to label your nextcloud + onlyoffice setup (of course, adapt paths to your virtualhost)

# php specific session, tmp and opcache dirs
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/nextcloud/tmp(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/nextcloud/sessions(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/nextcloud/opcache(/.*)?'
# nextcloud data dir
semanage fcontext -a -t httpd_sys_rw_content_t '/data(/.*)?'
# nextcloud app
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/nextcloud/ftp/www/config(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/nextcloud/ftp/www/apps(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/nextcloud/ftp/www/.htaccess'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/nextcloud/ftp/www/.user.ini'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/nextcloud/ftp/www/3rdparty/aws/aws-sdk-php/src/data/logs(/.*)?'
# onlyoffice specific
semanage fcontext -a -t httpd_sys_script_exec_t '/var/www/nextcloud/ftp/www/apps/documentserver_community/3rdparty/onlyoffice/documentserver(/.*)?'
semanage fcontext -a -t ld_so_t '/var/www/nextcloud/ftp/www/apps/documentserver_community/3rdparty/onlyoffice/documentserver/server/FileConverter/bin/.*\.so.*'
# apply above contexts
restorecon -Rv '/var/www/nextcloud/'
restorecon -Rv '/data'

Should work ;)

@Wotisrv
Copy link

Wotisrv commented Nov 20, 2020

I was running OnlyOffice fine since it was included in Nextcloud 19. I needed to adjust the SELinux permissions as described here to get it work.
Now for a couple of days I figured out that I got back the x2t permission denied error. The solution from @deajan fixed the error.
Furthermore I needed to issue chmod u+x docbuilder since this one lost its permissions.
After all that, I can run OnlyOffice inside Nextcloud but with the mobile app I got still x2t permission denied error.
Everything works fine with disabled SELinux.
I upgraded also to Nextcloud 20.0.2 today, but permission error using mobile app still continues.
No log in SELinux about blocking but in Nextcloud.

System Fedora-Server 32 Edition, Nextcloud 20.0.2

@AndreasDekiert
Copy link

Even after applying @deajan 's SELinux module and contexts I still cannot get OnlyOffice to run. Checking the SELinux audits with ausearch -c 'x2t' I get several results like the following:
type=ANOM_ABEND msg=audit(1615135507.682:588047): audit=982 uid=982 gid=975 ses=82515 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=18453 comm="x2t" reason="memory violation" sig=4

Creating a custom SELinux module with audit2allow is not possible for this "memory violation". Any ideas?

System CentOS 7, Nextcloud 20.0.8

@Wotisrv
Copy link

Wotisrv commented Mar 8, 2021

I applied @deajan SELinux module and I get now:
"SELinux prevents php-fpm from accessing sock_file clamd.sock with write access."
type=AVC msg=audit(1615235215.940:543): avc: denied { write } for pid=1097 comm="php-fpm" name="clamd.sock" dev="tmpfs" ino=1812 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:antivirus_var_run_t:s0 tclass=sock_file permissive=0

I do not understand why php-fpm should get write access to clamd.sock file?
The SELinux policy allow antivirus to can scan system is activated:
boolean -m -1 antivirus_can_scan_system

System Fedora 33 Server-Edition, Nextcloud 20.0.8

@deajan
Copy link

deajan commented Mar 13, 2021

@Wotisrv Looks like you have the antivirus plugin in Nextcloud where nextcloud itself triggers an AV scan. Can you confirm ?

@Wotisrv
Copy link

Wotisrv commented Mar 13, 2021

@deajan yes that's right.

@j3qb
Copy link

j3qb commented May 10, 2021

On our server (managed by the provider) the same issue comes up (since yesterday). Error messages:
"Community document server is not supported for this instance, please setup and configure an external document server✖" and:
"can't execute x2t binary, ensure php can execute binaries in the app folder✖"
Running Nextcloud 21.0.1
Reinstalling both Apps didn't resolve the issue.

Since I have no admin access to the server itself i can't provide much more information. The provider claims it gives no support for the App but tells me, that other customers experience the same issue.

Bottonline: Issue is still unresolved and comes up under Nexcloud 21 as well.

@sich97
Copy link

sich97 commented Sep 28, 2021

Yeah I just got this error as well. I've read about the "chmod u+x docbuilder" solution, but I don't have a file path which corresponds to the where I'm supposed to run that command.
Under "<nextcloud_root_folder>/apps/documentserver_community/3rdparty/onlyoffice/documentserver/", I only have a folder called "web-apps".
This should be looked into more, since this was a fresh install. I installed nextcloud manually (not docker), but I installed OnlyOffice and Community Document Server through Nexctloud's App menu. So if I'm missing any dependencies then at least I should have been informed of such in the documentation or after setup. But of course the best thing would be if the app itself was plug and play.

@sitoexpress
Copy link

Same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests